NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
I've written previously about fixing HL7 CDA schema compilation with XJC
, now that I've been looking at FHIR
it seems that there are name collisions in that schema too. The actual problem arises out of the W3C XHTML 1.0 Schema
and not the FHIR
schema per se.
This is the kind of error that XJC
throws whenever trying to compile the FHIR
Ok so that says that "Lang" is already defined and looking at that part of the XSD
It's pretty obvious why XJC
would complain. There's a name collisions between the xml:lang
reference and the lang
attribute, both would get mapped to a variable named 'lang'
in the generated Java
To fix it, it's just a matter of telling XJC
to rename the xml:lang
reference to 'xmlLang'
when generating Java
code while leaving the lang
attribute as is. The following bindings would be suitable, see my CDA
article linked above for the full binding file definition:
Here's an answer
from StackOverlow that is similar in nature and covers it in more detail.
Then it's just a matter of telling XJC
that you want to use a binding file and the FHIR
schema should compile!
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...