The xml.xsd file at w3.org references an "XMLSchema.dtd" file which
doesn't seem to get resolved. I found that I could either download the
xml.xsd file and comment out the DOCTYPE line or download the xml.xsd,
the XMLSchema.dtd file, and the datatypes.dtd file (XMLSchema.dtd refers
to this one) and then using my local version (i.e. set the
schemaLocation of the xsd:import to the local file on disk), get things
to work.
Pat
Adam Rabung wrote:
I have a question about validating against a schema which uses elements from
the default xml namespace,
http://www.w3.org/XML/1998/namespace. Using these attributes (base, space, and
lang) require a schema import, like so:
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/03/xml.xsd" />.
It seems that passing a custom xsd into schemaLocation is illegal:
The prefix "xml" cannot be bound to any namespace other than its usual namespace; neither
can the namespace for "xml" be bound to
any prefix other than "xml".
However, not using the schemaLocation at all will result in errors like these:
src-resolve: Cannot resolve the name 'xml:base' to a(n) 'attribute declaration'
component.
What is the default value of schemaLocation? If it is only allowed to be set
to one value legally
(http://www.w3.org/2001/03/xml.xsd), would it be possible to have it default to
that? Is there any way to configure the parser to
allow for custom xml schemas?
This is closely related to the problem reported here:
http://issues.apache.org/eyebrowse/ReadMsg?listId=85&msgNo=4072
And may be related to:
http://nagoya.apache.org/jira/browse/XERCESJ-1002
I'm using Xerces-J 2.6.2.
Example schema:
<?xml version="1.0"?>
<xsd:schema xmlns="http://example.com"
targetNamespace="http://example.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
elementFormDefault="unqualified">
<!-- Leaving off schemaLocation, or setting it to anything besides
http://www.w3.org/2001/03/xml.xsd will result in an error. -->
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
<xsd:attributeGroup name="attr.base">
<xsd:attribute ref="xml:base" use="optional"/>
</xsd:attributeGroup>
<xsd:element name="father" type="fatherType"/>
<xsd:element name="child" type="childType"/>
<xsd:complexType name="fatherType">
<xsd:sequence>
<xsd:element ref="child"/>
</xsd:sequence>
<xsd:attribute ref="xml:base"/>
</xsd:complexType>
<xsd:complexType name="childType">
<xsd:attributeGroup ref="attr.base"/>
</xsd:complexType>
</xsd:schema>
Thank you,
Adam Rabung
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]