You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Fabio Vitali (JIRA)" <xe...@xml.apache.org> on 2008/05/01 08:22:55 UTC
[jira] Updated: (XERCESJ-1305) Restricting an extension on
attribute uses of mixed content reports errors
[ https://issues.apache.org/jira/browse/XERCESJ-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Vitali updated XERCESJ-1305:
----------------------------------
Attachment: TestMixedContent.xsd
> Restricting an extension on attribute uses of mixed content reports errors
> --------------------------------------------------------------------------
>
> Key: XERCESJ-1305
> URL: https://issues.apache.org/jira/browse/XERCESJ-1305
> Project: Xerces2-J
> Issue Type: Bug
> Components: XML Schema Structures
> Affects Versions: 2.9.0, 2.9.1
> Environment: Xerces-J 2.9.* within Oxygen 8.* on both MacOS X and Windows XP
> Reporter: Fabio Vitali
> Attachments: TestMixedContent.xsd
>
>
> I receive an error when restricting an extension on a mixed content type. Both the extension and the restriction happen on the attribute use, but the error is returned on the particle restriction.
> --
> The example:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:complexType name="baseType" mixed="true">
> <xs:choice>
> <xs:element name="a" type="xs:string"/>
> <xs:element name="b" type="xs:string" minOccurs="0" maxOccurs="1"/>
> </xs:choice>
> <xs:attribute name="att1" type="xs:string"/>
> </xs:complexType>
> <xs:complexType name="extensionType" mixed="true">
> <xs:complexContent>
> <xs:extension base="baseType">
> <xs:attribute name="att2" type="xs:string"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:complexType name="restrictionType" mixed="true">
> <xs:complexContent>
> <xs:restriction base="extensionType">
> <xs:choice>
> <xs:element name="a" type="xs:string"/>
> <xs:element name="b" type="xs:string" minOccurs="0" maxOccurs="1"/>
> </xs:choice>
> <xs:attribute name="att2" type="xs:string" fixed="somevalue"/>
> </xs:restriction>
> </xs:complexContent>
> </xs:complexType>
>
> </xs:schema>
> --
> Errors reported:
> * cos-particle-restrict.2: Forbidden particle restriction: 'choice:all,sequence,elt'. URL: http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict
> * derivation-ok-restriction.5.4.2: Error for type 'restrT'. 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
> --
> Comments:
> In neither extensionType or restrictionType the content model is changed, but we just add first an attribute, and then restrict its values. So I don't see why #cos-particle-restrict should have anything to say about it.
> Neither MSXML nor XQC have anything wrong to say about the example
> Remove the mixed="true" everywhere and the thing works.
> Change the choices into sequences and the thing works.
> Forbid element "b" in restrictionType and the thing works
> (e.g., <xs:element name="b" type="xs:string" minOccurs="0" maxOccurs="0"/> )
> Require element "b" in restrictionType and the error remains
> (e.g., <xs:element name="b" type="xs:string" minOccurs="1" maxOccurs="1"/> )
>
> Thank you for any light you may shed on this
> Fabio Vitali
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org