[ 
https://issues.apache.org/jira/browse/XERCESC-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alberto Massari resolved XERCESC-1726.
--------------------------------------

    Resolution: Invalid

The xs:include instruction includes "valid schemas", so every subschema must 
include the needed pieces to be consistent, without relying on that pieces to 
have been already loaded somewhere.

Alberto

> The type defined in the preceding included schema file can not be used by the 
> rear included schema file.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: XERCESC-1726
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1726
>             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 several schema files:
> test.xsd:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema targetNamespace="http://www.hprim.org/hprimXML"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns="http://www.hprim.org/hprimXML"; elementFormDefault="qualified" 
> attributeFormDefault="unqualified">
>    <xsd:include schemaLocation="sa_pieceJointe.xsd"/>
>    <xsd:include schemaLocation="sa_typesTAA.xsd"/>
>    <xsd:element name="evenementsServeurEtatsPatient"/>
> </xsd:schema>
> sa_pieceJointe.xsd:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema targetNamespace="http://www.hprim.org/hprimXML"; 
> xmlns:insee="http://www.hprim.org/inseeXML"; 
> xmlns="http://www.hprim.org/hprimXML"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" 
> attributeFormDefault="unqualified">
>    <xsd:include schemaLocation="sa_typesDeBase.xsd"/>
>    <xsd:complexType name="typePiecesJointes">
>       <xsd:sequence>
>          <xsd:element name="pieceJointe" type="xsd:string" 
> maxOccurs="unbounded"/>
>       </xsd:sequence>
>    </xsd:complexType>
> </xsd:schema>
> sa_typesDeBase.xsd:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema targetNamespace="http://www.hprim.org/hprimXML"; 
> xmlns="http://www.hprim.org/hprimXML"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" 
> attributeFormDefault="unqualified">
>    <xsd:complexType name="typeIdentifiant">
>       <xsd:sequence>
>          <xsd:element name="emetteur" type="xsd:string" minOccurs="0"/>
>          <xsd:element name="recepteur" type="xsd:string" minOccurs="0"/>
>       </xsd:sequence>
>    </xsd:complexType>
> </xsd:schema>
> sa_typesTAA.xsd:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema targetNamespace="http://www.hprim.org/hprimXML"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns="http://www.hprim.org/hprimXML"; elementFormDefault="qualified" 
> attributeFormDefault="unqualified">
>    <xsd:complexType name="typeInterventionBase">
>       <xsd:sequence>
>          <xsd:element name="identifiant" type="typeIdentifiant"/>
>       </xsd:sequence>
>    </xsd:complexType>
> </xsd:schema>
> when using XercesDOMParser::loadGrammar() to check the validity of 
> "test.xsd", the following error info is reported: 
> "Type not found in http://www.hprim.org/hprimXML:typeIdentifiant - Line 5, 
> Col 66", 
> I think the error is reported for "sa_typesTAA.xsd", but type 
> "typeIdentifiant " is defined in "sa_typesDeBase.xsd", and it's included in 
> "sa_pieceJointe.xsd", and "sa_pieceJointe.xsd" is included in "test.xsd", and 
> the including of  "sa_pieceJointe.xsd" is preceding to the "sa_typesTAA.xsd", 
> so I think it should be ok, no error should be reported by 
> XercesDOMParser::loadGrammar().

-- 
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]

Reply via email to