[
https://issues.apache.org/jira/browse/XERCESJ-1474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Mäsing reopened XERCESJ-1474:
------------------------------------
Dears Sirs,
for example in the xlink.xsd there is a global attribute declaration:
<xs:attribute name="show">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="new"/>
<xs:enumeration value="replace"/>
<xs:enumeration value="embed"/>
<xs:enumeration value="other"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
and a attributeGroup defaulting it to replace:
<xs:attributeGroup name="XLINKBEH">
<xs:attribute ref="xlink:show" default="replace"/>
<xs:attribute ref="xlink:actuate" default="onRequest"/>
</xs:attributeGroup>
Therefore I conclude the following:
The attribute xlink:show has to appear prefixed e.g. with xlink:show and the
prefix bound to the desired namespace in the XML infoset.
I verified this using Xerces with a modified test file. For the unprefixed
attribute I got the following error as aspected:
test_new.XML:28:66: cvc-complex-type.3.2.2: Attribute 'show' is not allowed to
appear in element 'refdm'.
With this citation from the XML Schema recommendation:
{value constraint} reproduces the functions of XML 1.0 default and #FIXED
attribute values. default specifies that the attribute is to appear
unconditionally in the - post-schema-validation infoset- , with the supplied
value used whenever the attribute is not actually present; fixed indicates that
the attribute value if present must equal the supplied constraint value, and if
absent receives the supplied value as for default. Note that it is values that
are supplied and/or checked, not strings.
I conclude that the attribute has to appear in the post-schema-validation
infoset in the same way at it has been in the XML infoset itself.
This is not the case at the moment. The attribute of the example appears
without a prefix in the SAX Event, therefore belongs to no Namespace and
therefore does not appear in post-schema-validation infoset, because the
attribute, which has to appear, belongs to the Namespace.
Best regards
Thomas Mäsing
> Defaulted attributes with attributeForm="qualified"
> ---------------------------------------------------
>
> Key: XERCESJ-1474
> URL: https://issues.apache.org/jira/browse/XERCESJ-1474
> Project: Xerces2-J
> Issue Type: Bug
> Components: SAX, XML Schema 1.0 Structures
> Affects Versions: 2.10.0
> Reporter: Thomas Mäsing
> Priority: Critical
> Attachments: dc.xsd, rdf.xsd, schedul.xsd, test.XML, test_new.XML,
> xlink.xsd
>
>
> Dear Sirs,
> I have attached an example using the xlink namespace (xlink.xsd). There are
> some defaulted attributes. These are reported without a namespace prefix
> although the
> XML Schema declares attributeForm"qaulified". To check the namespace
> awareness I added on of this attributes with a prefix to source document.
> Best regards
> Thomas Mäsing
--
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: [email protected]
For additional commands, e-mail: [email protected]