[
https://issues.apache.org/jira/browse/XERCESJ-1619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742971#comment-13742971
]
Mukul Gandhi commented on XERCESJ-1619:
---------------------------------------
When I validate the schema documents Restriction-1.xsd and Restriction-2.xsd,
using our SVN implementation at xml-schema-1.1-dev, I get following results :
Using XSD 1.0 mode : both these schemas are reported as invalid, with following
error
The particle of the type is not a valid restriction of the particle of the base.
I suspect, our codebase on trunk (which is XSD 1.0 only) would produce the same
outcome (but I haven't verified it yet).
Using XSD 1.1 mode : both these schemas are reported as valid. Which is what
you expect. I had a chance to look at schema Restriction-1.xsd in little
detail, and can confirm from my reading of XSD 1.1 spec, that this schema
should be valid.
I also find from my reading of the spec, that complexType restriction rules are
simplified in XSD 1.1 while they have same intent in principle as XSD 1.0 for
many of the cases.
Therefore, if we move to XSD 1.1 language, we would get a better spec in this
area of language (and ofcourse in various other areas).
> Restricting a sequence of three elements with final wildcard to the wildcard
> alone yields error
> -----------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1619
> URL: https://issues.apache.org/jira/browse/XERCESJ-1619
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema 1.0 Structures
> Affects Versions: 2.11.0
> Environment: oXygen 14.1 with Xerces 2.11 sentenced to work with
> Windows 7
> Reporter: Michael Hermann Malburg
> Attachments: Restriction-1.xsd, Restriction-2.xsd
>
>
> I receive validation errors for #cos-particle-restrict and
> #derivation-ok-restriction when restricting a sequence consisting of two
> optional elements followed by an wildcard to a wildcard standing alone, see
> example for details. The situation turn curious in inspecting the attached
> file (attachment "Restriction-2.xsd") which has an intermediate class
> working fine.
> Example (attachment "Restriction-1.xsd")
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="vdpNs"
> version="1.0" xml:lang="en" xmlns:vdp="vdpNs"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <xsd:complexType name="TopType">
> <xsd:sequence>
> <xsd:element maxOccurs="1" minOccurs="0" name="first" type="xsd:int" />
> <xsd:element maxOccurs="1" minOccurs="0" name="second"
> type="xsd:string" />
> <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other"
> processContents="skip" />
> </xsd:sequence>
> </xsd:complexType>
> <xsd:complexType name="BottomType">
> <xsd:complexContent>
> <xsd:restriction base="vdp:TopType">
> <xsd:sequence>
> <xsd:element maxOccurs="0" minOccurs="0" name="first"
> type="xsd:int" />
> <xsd:element maxOccurs="0" minOccurs="0" name="second"
> type="xsd:string" />
> <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other"
> processContents="skip" />
> </xsd:sequence>
> </xsd:restriction>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:schema>
> Extract from oXygen's formatted result (belonging both to line 11 = "…
> complexType … BottomType …"):
> Engine name: Xerces
> Severity: error
> Description: cos-particle-restrict.2: Forbidden particle restriction:
> 'any:choice,sequence,all,elt'.
> URL: http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict
> Engine name: Xerces
> Severity: error
> Description: derivation-ok-restriction.5.4.2: Error for type 'BottomType'.
> The particle of the type is not a valid restriction of the particle of the
> base.
> URL: http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
> Further observations:
> - only forbiding one of elements "first" and "second" validates fine in both
> cases
> - both examples are validated with success by the W3C validator
> - example printed inline above seems minimal in some sense
> - changing the wildcard's namespace only leads to slightly differing results
> - incrementing all "maxOccurs" values by 1 results in successful validation
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]