You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by xe...@xml.apache.org on 2004/08/10 00:52:20 UTC
[jira] Created: (XERCESC-1249) Xerces complains about missing import namespace when it is imported within an included schema
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/XERCESC-1249
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XERCESC-1249
Summary: Xerces complains about missing import namespace when it is imported within an included schema
Type: Bug
Status: Unassigned
Priority: Major
Project: Xerces-C++
Components:
Validating Parser (Schema) (Xerces 1.5 or up only)
Versions:
2.5.0
Assignee:
Reporter: Andrew Fang
Created: Mon, 9 Aug 2004 3:51 PM
Updated: Mon, 9 Aug 2004 3:51 PM
Environment: Windows XP
Description:
Xerces emit error message:
"Schema Representation Constraint: Namespace 'efg' is referenced without <import> declaration" when parsing the Schema attached below. Schema main.xsd has namespace "abc" and it refers to attribute defined in "efg" namespace. Although there is no <xsd:import> in main.xsd but it is declared in a file included in main.xsd (include.xsd). I believe that the file included using xsd:include is considered as part of the main.xsd, the error message above is not necessary.
****** main.xsd
<xsd:schema
targetNamespace="abc"
xmlns:e="efg"
xmlns="abc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="include.xsd"/>
<xsd:complexType name="S">
<xsd:sequence>
<xsd:element name="Title"/>
</xsd:sequence>
<xsd:attribute ref="e:attr"/>
</xsd:complexType>
</xsd:schema>
****** include.xsd
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import
namespace="efg"
schemaLocation="import.xsd"/>
</xsd:schema>
****** import.xsd
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="efg"
xmlns="efg">
<xsd:attribute name="attr">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKENS"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:schema>
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
[jira] Commented: (XERCESC-1249) Xerces complains about missing import namespace when it is imported within an included schema
Posted by xe...@xml.apache.org.
The following comment has been added to this issue:
Author: Jian Zheng
Created: Wed, 11 Aug 2004 5:15 PM
Body:
I have a very similar problem. My main.xsd references aaa.xsd (never bbb.xsd). aaa.xsd imports bbb. However bbb.xsd references aaa without <import>ing. I looked at XML Schema recommendation, but couldn't find an answer as to whether bbb.xsd needs to import aaa or not. My colleagues using XMLSpy doesn't have a problem with it.
****** aaa.xsd
<xsd:schema
targetNamespace="aaa"
xmlns:aaa="aaa"
xmlns:bbb="bbb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import
namespace="bbb"
schemaLocation="bbb.xsd"/>
...
</xsd:schema>
****** bbb.xsd
<xsd:schema
targetNamespace="bbb"
xmlns:bbb="bbb"
xmlns:aaa="aaa"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...using bbb: ...
</xsd:schema>
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/XERCESC-1249?page=comments#action_37194
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/XERCESC-1249
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XERCESC-1249
Summary: Xerces complains about missing import namespace when it is imported within an included schema
Type: Bug
Status: Unassigned
Priority: Major
Project: Xerces-C++
Components:
Validating Parser (Schema) (Xerces 1.5 or up only)
Versions:
2.5.0
Assignee:
Reporter: Andrew Fang
Created: Mon, 9 Aug 2004 3:51 PM
Updated: Wed, 11 Aug 2004 5:15 PM
Environment: Windows XP
Description:
Xerces emit error message:
"Schema Representation Constraint: Namespace 'efg' is referenced without <import> declaration" when parsing the Schema attached below. Schema main.xsd has namespace "abc" and it refers to attribute defined in "efg" namespace. Although there is no <xsd:import> in main.xsd but it is declared in a file included in main.xsd (include.xsd). I believe that the file included using xsd:include is considered as part of the main.xsd, the error message above is not necessary.
****** main.xsd
<xsd:schema
targetNamespace="abc"
xmlns:e="efg"
xmlns="abc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="include.xsd"/>
<xsd:complexType name="S">
<xsd:sequence>
<xsd:element name="Title"/>
</xsd:sequence>
<xsd:attribute ref="e:attr"/>
</xsd:complexType>
</xsd:schema>
****** include.xsd
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import
namespace="efg"
schemaLocation="import.xsd"/>
</xsd:schema>
****** import.xsd
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="efg"
xmlns="efg">
<xsd:attribute name="attr">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKENS"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:schema>
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org