Support #3641
closedXML validation via XSD does not handle conditionally required fields
0%
Description
when the 'requiredLevel' tag in an XSD file has a value of 'Conditionally Required' it is not properly validated against in the XML. Fields that would become required based on the value of another field and not being checked. I am providing XSD files, xml, and the output of the call to execute the saxon-EE call.
Files
Updated by Cam Scofield almost 7 years ago
Would like to set this as a HIGH priority. It is impeding daily work for our corporation. Feed back on this issue would much appreciated.
Updated by Michael Kay almost 7 years ago
- Category set to Schema conformance
- Priority changed from Low to Normal
Thanks for reporting it. I've run it and get the same results, that the instance document is valid.
Your schema contains xs:appInfo entries with declarations such as:
<xsd:appinfo>
<wm:requiredLevel value="Conditionally Required"/>
<wm:conditionalAttributes>
<wm:conditionalAttributeGroup>
<wm:conditionalAttribute name="hasBatteries" value="Yes"/>
</wm:conditionalAttributeGroup>
</wm:conditionalAttributes>
<wm:displayName>Contained Battery Type</wm:displayName>
<wm:group>Compliance</wm:group>
<wm:rank>51000</wm:rank>
</xsd:appinfo>
where the wm namespace is defined by xmlns:wm="http://walmart.com/". I've no idea what the semantics of these declarations are, but it's not something defined by the W3C specifications, and it's not something recognized by Saxon (schema processor ignore the contents of appInfo unless it's in a namespace that they explicitly recognize).
So as far as I can see, these schema documents are using some kind of proprietary extension to the W3C XSD syntax which Saxon does not recognize. (Therefore: no bug).
To define conditional constraints like this to work with Saxon you need to use the features of XSD 1.1 such as xs:assert and xs:conditionalContent.
Updated by Michael Kay almost 7 years ago
- Status changed from New to AwaitingInfo
Updated by Cam Scofield almost 7 years ago
Thank you very much, we are grateful for your help. I believe that there is no reason to keep this issue open and that it be marked as resolved.
Updated by Michael Kay almost 7 years ago
- Tracker changed from Bug to Support
- Status changed from AwaitingInfo to Closed
- Assignee set to Michael Kay
Please register to edit this issue