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 "Savorjava (JIRA)" <xe...@xml.apache.org> on 2005/09/15 06:21:54 UTC

[jira] Created: (XERCESC-1497) 2.6 & 2.7 don't support validate a xml with two or more schema files.

2.6 & 2.7 don't support validate a xml with two or more schema files.
---------------------------------------------------------------------

         Key: XERCESC-1497
         URL: http://issues.apache.org/jira/browse/XERCESC-1497
     Project: Xerces-C++
        Type: Bug
    Reporter: Savorjava


I have tried to validate following xml with two schema files, one is resource_list.xsd and another one is rls_services.xsd, I have place these files on my local disk and made my own EntityResolver for them. when I run my program, Xerces can tell me something wrong with rls-service schema, but Xerces cannot tell me the problems with resource-list schema. but in the following xml I have two elements come from resource-list schema: rl:entry and rl:entry-ref.

xml:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><rls-services xmlns="urn:
ietf:params:xml:ns:rls-services" xmlns:rl="urn:ietf:params:xml:ns:resource-lists
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:
ietf:params:xml:ns:resource-lists resource_lists.xsd urn:ietf:params:xml:ns:rls-
services rls_services.xsd http://www.w3.org/2001/xml.xsd xml.xsd">
    <service uri="sip:mybuddies@example.com">
     <resource-list>http://xcap.example.com/resource-lists/users/joe/index/~~/re
source-lists/list%5b@name=%22l1%22%5d</resource-list>
     <packages>
      <package>presence</package>
     </packages>
    </service>
    <service uria="sip:marketing@example.com">
      <list name="marketing">
        <rl:entryabc uri="123"/>
        <rl:entry-ref abc="sip:sudhir@example.com"/>
      </list>
      <packages>
        <package>presence</package>
      </packages>
    </service>
   </rls-services>
-----------------------------------------
output info:
Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
  Message: Complex type 'listType' violates the Unique Particle Attribution rule
 in its components '##other' and '##other'

Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
  Message: Complex type '__AnonC3' violates the Unique Particle Attribution rule
 in its components '##other' and '##other'
systemId: rls_services.xsd
baseURI: E:\works\IMS\PS\XML/test.xml
FileName: rls_services.xsd

Error at file E:\works\IMS\PS\XML/rls_services.xsd, line 18, char 52
  Message: Schema Representation Constraint: Namespace 'urn:ietf:params:xml:ns:r
esource-lists' is referenced without <import> declaration
systemId: xml.xsd
baseURI: E:\works\IMS\PS\XML/test.xml
FileName: xml.xsd

Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
  Message: Schema in xml.xsd has a different target namespace from the one speci
fied in the instance document http://www.w3.org/2001/xml.xsd.

Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
  Message: Attribute 'uria' is not declared for element 'service'

Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
  Message: Required attribute 'uri' was not provided

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Resolved: (XERCESC-1497) 2.6 & 2.7 don't support validate a xml with two or more schema files.

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1497?page=all ]
     
Alberto Massari resolved XERCESC-1497:
--------------------------------------

    Resolution: Invalid

> 2.6 & 2.7 don't support validate a xml with two or more schema files.
> ---------------------------------------------------------------------
>
>          Key: XERCESC-1497
>          URL: http://issues.apache.org/jira/browse/XERCESC-1497
>      Project: Xerces-C++
>         Type: Bug
>     Reporter: Savorjava
>  Attachments: draft-ietf-simple-xcap-list-usage-05.txt, resource_lists.xsd, rls_services.xsd
>
> I have tried to validate following xml with two schema files, one is resource_list.xsd and another one is rls_services.xsd, I have place these files on my local disk and made my own EntityResolver for them. when I run my program, Xerces can tell me something wrong with rls-service schema, but Xerces cannot tell me the problems with resource-list schema. but in the following xml I have two elements come from resource-list schema: rl:entry and rl:entry-ref.
> xml:
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><rls-services xmlns="urn:
> ietf:params:xml:ns:rls-services" xmlns:rl="urn:ietf:params:xml:ns:resource-lists
> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:
> ietf:params:xml:ns:resource-lists resource_lists.xsd urn:ietf:params:xml:ns:rls-
> services rls_services.xsd http://www.w3.org/2001/xml.xsd xml.xsd">
>     <service uri="sip:mybuddies@example.com">
>      <resource-list>http://xcap.example.com/resource-lists/users/joe/index/~~/re
> source-lists/list%5b@name=%22l1%22%5d</resource-list>
>      <packages>
>       <package>presence</package>
>      </packages>
>     </service>
>     <service uria="sip:marketing@example.com">
>       <list name="marketing">
>         <rl:entryabc uri="123"/>
>         <rl:entry-ref abc="sip:sudhir@example.com"/>
>       </list>
>       <packages>
>         <package>presence</package>
>       </packages>
>     </service>
>    </rls-services>
> -----------------------------------------
> output info:
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type 'listType' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type '__AnonC3' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> systemId: rls_services.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: rls_services.xsd
> Error at file E:\works\IMS\PS\XML/rls_services.xsd, line 18, char 52
>   Message: Schema Representation Constraint: Namespace 'urn:ietf:params:xml:ns:r
> esource-lists' is referenced without <import> declaration
> systemId: xml.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: xml.xsd
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Schema in xml.xsd has a different target namespace from the one speci
> fied in the instance document http://www.w3.org/2001/xml.xsd.
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Attribute 'uria' is not declared for element 'service'
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Required attribute 'uri' was not provided

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1497) 2.6 & 2.7 don't support validate a xml with two or more schema files.

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESC-1497?page=comments#action_12329397 ] 

Alberto Massari commented on XERCESC-1497:
------------------------------------------

1) what do you mean by "Xerces cannot tell me the problems with resource-list schema"; do you expect it to be invalid?
2) start by fixing the errors that Xerces reported
3) please attach the schemas, otherwise this bug is incomplete

> 2.6 & 2.7 don't support validate a xml with two or more schema files.
> ---------------------------------------------------------------------
>
>          Key: XERCESC-1497
>          URL: http://issues.apache.org/jira/browse/XERCESC-1497
>      Project: Xerces-C++
>         Type: Bug
>     Reporter: Savorjava

>
> I have tried to validate following xml with two schema files, one is resource_list.xsd and another one is rls_services.xsd, I have place these files on my local disk and made my own EntityResolver for them. when I run my program, Xerces can tell me something wrong with rls-service schema, but Xerces cannot tell me the problems with resource-list schema. but in the following xml I have two elements come from resource-list schema: rl:entry and rl:entry-ref.
> xml:
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><rls-services xmlns="urn:
> ietf:params:xml:ns:rls-services" xmlns:rl="urn:ietf:params:xml:ns:resource-lists
> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:
> ietf:params:xml:ns:resource-lists resource_lists.xsd urn:ietf:params:xml:ns:rls-
> services rls_services.xsd http://www.w3.org/2001/xml.xsd xml.xsd">
>     <service uri="sip:mybuddies@example.com">
>      <resource-list>http://xcap.example.com/resource-lists/users/joe/index/~~/re
> source-lists/list%5b@name=%22l1%22%5d</resource-list>
>      <packages>
>       <package>presence</package>
>      </packages>
>     </service>
>     <service uria="sip:marketing@example.com">
>       <list name="marketing">
>         <rl:entryabc uri="123"/>
>         <rl:entry-ref abc="sip:sudhir@example.com"/>
>       </list>
>       <packages>
>         <package>presence</package>
>       </packages>
>     </service>
>    </rls-services>
> -----------------------------------------
> output info:
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type 'listType' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type '__AnonC3' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> systemId: rls_services.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: rls_services.xsd
> Error at file E:\works\IMS\PS\XML/rls_services.xsd, line 18, char 52
>   Message: Schema Representation Constraint: Namespace 'urn:ietf:params:xml:ns:r
> esource-lists' is referenced without <import> declaration
> systemId: xml.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: xml.xsd
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Schema in xml.xsd has a different target namespace from the one speci
> fied in the instance document http://www.w3.org/2001/xml.xsd.
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Attribute 'uria' is not declared for element 'service'
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Required attribute 'uri' was not provided

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1497) 2.6 & 2.7 don't support validate a xml with two or more schema files.

Posted by "Savorjava (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1497?page=all ]

Savorjava updated XERCESC-1497:
-------------------------------

    Attachment: resource_lists.xsd
                rls_services.xsd
                draft-ietf-simple-xcap-list-usage-05.txt

these two schema files could be found in "draft-ietf-simple-xcap-list-usage-05.txt", and example xml file could be found in it too, following is the content of the example xml file:
<?xml version="1.0" encoding="UTF-8"?>
   <rls-services xmlns="urn:ietf:params:xml:ns:rls-services"
      xmlns:rl="urn:ietf:params:xml:ns:resource-lists"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <service uri="sip:mybuddies@example.com">
     <resource-list>http://xcap.example.com/resource-lists/users/joe/index/~~/
   resource-lists/list%5b@name=%22l1%22%5d</resource-list>
     <packages>
      <package>presence</package>
     </packages>
    </service>
    <service uri="sip:marketing@example.com">
      <list name="marketing">
        <rl:entry uri="sip:joe@example.com"/>
        <rl:entry uri="sip:sudhir@example.com"/>
      </list>
      <packages>
        <package>presence</package>
      </packages>
    </service>
   </rls-services>

this one  is correct one and it's not same with the one I submit last time.

> 2.6 & 2.7 don't support validate a xml with two or more schema files.
> ---------------------------------------------------------------------
>
>          Key: XERCESC-1497
>          URL: http://issues.apache.org/jira/browse/XERCESC-1497
>      Project: Xerces-C++
>         Type: Bug
>     Reporter: Savorjava
>  Attachments: draft-ietf-simple-xcap-list-usage-05.txt, resource_lists.xsd, rls_services.xsd
>
> I have tried to validate following xml with two schema files, one is resource_list.xsd and another one is rls_services.xsd, I have place these files on my local disk and made my own EntityResolver for them. when I run my program, Xerces can tell me something wrong with rls-service schema, but Xerces cannot tell me the problems with resource-list schema. but in the following xml I have two elements come from resource-list schema: rl:entry and rl:entry-ref.
> xml:
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><rls-services xmlns="urn:
> ietf:params:xml:ns:rls-services" xmlns:rl="urn:ietf:params:xml:ns:resource-lists
> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:
> ietf:params:xml:ns:resource-lists resource_lists.xsd urn:ietf:params:xml:ns:rls-
> services rls_services.xsd http://www.w3.org/2001/xml.xsd xml.xsd">
>     <service uri="sip:mybuddies@example.com">
>      <resource-list>http://xcap.example.com/resource-lists/users/joe/index/~~/re
> source-lists/list%5b@name=%22l1%22%5d</resource-list>
>      <packages>
>       <package>presence</package>
>      </packages>
>     </service>
>     <service uria="sip:marketing@example.com">
>       <list name="marketing">
>         <rl:entryabc uri="123"/>
>         <rl:entry-ref abc="sip:sudhir@example.com"/>
>       </list>
>       <packages>
>         <package>presence</package>
>       </packages>
>     </service>
>    </rls-services>
> -----------------------------------------
> output info:
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type 'listType' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type '__AnonC3' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> systemId: rls_services.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: rls_services.xsd
> Error at file E:\works\IMS\PS\XML/rls_services.xsd, line 18, char 52
>   Message: Schema Representation Constraint: Namespace 'urn:ietf:params:xml:ns:r
> esource-lists' is referenced without <import> declaration
> systemId: xml.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: xml.xsd
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Schema in xml.xsd has a different target namespace from the one speci
> fied in the instance document http://www.w3.org/2001/xml.xsd.
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Attribute 'uria' is not declared for element 'service'
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Required attribute 'uri' was not provided

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1497) 2.6 & 2.7 don't support validate a xml with two or more schema files.

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESC-1497?page=comments#action_12329821 ] 

Alberto Massari commented on XERCESC-1497:
------------------------------------------

Hi Savorjava,
the schema files have two errors in it:

1) resource_lists.xsd defines this "listType" as a sequence of

      <xs:element name="display-name" type="display-nameType" minOccurs="0"/>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:choice>
          [...]
          <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:choice>
      </xs:sequence>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

and this is ambiguous because the unbound choice contains a xs:any that is the same of the xs:any of the main sequence.
So, in an XML like this

<display-name>...</display-name>
<entry>...</entry>
<prefix:other>...</prefix:other>

the validator doesn't know if the "prefix:other" element should be validated against the "<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>" or the " <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>"

2) rls_service.xsd declares a prefix "rl" and uses it to refer to the "rl:listType" type, but it doesn't import the corresponding schema. There should be a

	<xs:import namespace="urn:ietf:params:xml:ns:resource-lists" schemaLocation="resource_lists.xsd"/>

as the first child of the xs:schema element

> 2.6 & 2.7 don't support validate a xml with two or more schema files.
> ---------------------------------------------------------------------
>
>          Key: XERCESC-1497
>          URL: http://issues.apache.org/jira/browse/XERCESC-1497
>      Project: Xerces-C++
>         Type: Bug
>     Reporter: Savorjava
>  Attachments: draft-ietf-simple-xcap-list-usage-05.txt, resource_lists.xsd, rls_services.xsd
>
> I have tried to validate following xml with two schema files, one is resource_list.xsd and another one is rls_services.xsd, I have place these files on my local disk and made my own EntityResolver for them. when I run my program, Xerces can tell me something wrong with rls-service schema, but Xerces cannot tell me the problems with resource-list schema. but in the following xml I have two elements come from resource-list schema: rl:entry and rl:entry-ref.
> xml:
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><rls-services xmlns="urn:
> ietf:params:xml:ns:rls-services" xmlns:rl="urn:ietf:params:xml:ns:resource-lists
> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:
> ietf:params:xml:ns:resource-lists resource_lists.xsd urn:ietf:params:xml:ns:rls-
> services rls_services.xsd http://www.w3.org/2001/xml.xsd xml.xsd">
>     <service uri="sip:mybuddies@example.com">
>      <resource-list>http://xcap.example.com/resource-lists/users/joe/index/~~/re
> source-lists/list%5b@name=%22l1%22%5d</resource-list>
>      <packages>
>       <package>presence</package>
>      </packages>
>     </service>
>     <service uria="sip:marketing@example.com">
>       <list name="marketing">
>         <rl:entryabc uri="123"/>
>         <rl:entry-ref abc="sip:sudhir@example.com"/>
>       </list>
>       <packages>
>         <package>presence</package>
>       </packages>
>     </service>
>    </rls-services>
> -----------------------------------------
> output info:
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type 'listType' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Complex type '__AnonC3' violates the Unique Particle Attribution rule
>  in its components '##other' and '##other'
> systemId: rls_services.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: rls_services.xsd
> Error at file E:\works\IMS\PS\XML/rls_services.xsd, line 18, char 52
>   Message: Schema Representation Constraint: Namespace 'urn:ietf:params:xml:ns:r
> esource-lists' is referenced without <import> declaration
> systemId: xml.xsd
> baseURI: E:\works\IMS\PS\XML/test.xml
> FileName: xml.xsd
> Error at file E:\works\IMS\PS\XML/test.xml, line 4, char 231
>   Message: Schema in xml.xsd has a different target namespace from the one speci
> fied in the instance document http://www.w3.org/2001/xml.xsd.
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Attribute 'uria' is not declared for element 'service'
> Error at file E:\works\IMS\PS\XML/test.xml, line 11, char 47
>   Message: Required attribute 'uri' was not provided

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org