I am getting error while generating Java from WSDL. I wanted to use XML Schema's 1.1 feature (xsd:assert). It is asserting if an element is available in the Web Service Request.
<xsd:assert test="(count(InstanceDetail[@OrderCodeType eq 'OFFERID']) eq 1)" />
I am using Apache CXF v 2.6.1. I am getting an error while using mvn generate-sources option:
Thrown by JAXB: Unexpected
<xsd:assert>
appears at line 200 column 3 of schema file:
Researching upon the error, I found out that JAXB only supports XML Schema 1.0 and this feature is available in XML Schema 1.1. If it is true, what are the other options do I have?
No, current version of JAXB does not support XSD 1.1. See these issues, for instance:
Update:
Concerning the solution. Me personally, I'd run an XSLT which would strip all the XSD 1.1. features and return vanilla XSD 1.0 as the result and compile that with JAXB. Not sure how to do this technically with CXF, though.
You could always use schematron (http://schematron.com/) on top of XSD 1.0. It's a bit tricky but by doing so you will have the conditional validation features of XSD 1.1 and compatibility with the XSD parser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With