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 "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2007/08/02 12:45:53 UTC

[jira] Commented: (XERCESC-1728) Element defined in the imported schema file can not be correctly referred to

    [ https://issues.apache.org/jira/browse/XERCESC-1728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517206 ] 

Boris Kolpackov commented on XERCESC-1728:
------------------------------------------

XMLSpy is well-known for its non-conforming schema processor. As such it cannot be used as a reference. I am not sure whether it is legal or not to reference a type from a namespace without an explicit import directive for that namespace. I suggest that you at least check it with a schema processor other than XMLSpy and better yet post your example to the xmlschema-dev@w3.org mailing list.

> Element defined in the imported schema file can not be correctly referred to
> ----------------------------------------------------------------------------
>
>                 Key: XERCESC-1728
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1728
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.7.0
>         Environment: Windows XP
>            Reporter: Bill Yan
>
> There are there schema files in the following:
> testelemref.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="ns2" xmlns:nm1="ns1" targetNamespace="ns2" elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<xs:import namespace="ns1" schemaLocation="testelemref1.xsd"/>
> 	<xs:element name="elem3">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="nm1:elem1"/>
> 			</xs:sequence>
> 		</xs:complexType>
> 	</xs:element>
> </xs:schema>
> testelemref1.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:n0="ns1" xmlns:n1="ns2" targetNamespace="ns1" elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<xs:import namespace="ns2" schemaLocation="testelemref2.xsd"/> 
> 	<xs:element name="elem1">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="n0:elem2" minOccurs="0"/>
> 				<xs:element ref="n1:elem4" minOccurs="0"/>
> 			</xs:sequence>
> 		</xs:complexType>
> 	</xs:element>
> 	<xs:element name="elem2" type="xs:string"/>
> </xs:schema>
> testelemref2.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="ns2" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:nm1="ns2">
> 	<xs:element name="elem4" type="xs:string"/>
> </xs:schema>
> When I use XercesDOMParser::loadGrammar() to check the validity of testelemref.xsd, the following error is reported:
> "Type not found in ns2:elem4 - Line 8, Col 47"
> but when I use XMLSpy to check, it's valid, no error is found.

-- 
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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org