You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Chu Minh Toan (JIRA)" <xe...@xml.apache.org> on 2009/09/23 11:43:16 UTC

[jira] Created: (XERCESJ-1396) key/keyref does not validate with recursion

key/keyref does not validate with recursion
-------------------------------------------

                 Key: XERCESJ-1396
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1396
             Project: Xerces2-J
          Issue Type: Bug
         Environment: Window, with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400
            Reporter: Chu Minh Toan


Hi everyone,
Is it true that key/keyref does not validate with recursion? I have this question because that when I validate the following xml file, the validation of an element defined with recursion doesn't work. Following is xml and the corresponding xsd file. (I validate xml file with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400). Thanks in advance!
Toan.

xsd file :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="CompositeType" type="CompositeType" />
 <xsd:element name="Model" type="Model">
  <!-- CompositeTypeKey/KeyRef -->
  <xsd:key name="CompositeTypeKey">
   <xsd:selector
    xpath=".//CompositeType" />
   <xsd:field xpath="./typeName" />
  </xsd:key>
  <xsd:keyref name="CompositeTypeRef" refer="CompositeTypeKey">
   <xsd:selector
    xpath=".//Attribute/CompositeTypeReference" />
   <xsd:field xpath="." />
  </xsd:keyref>
 </xsd:element>

 <xsd:complexType name="CompositeType">
  <xsd:sequence>
   <xsd:element minOccurs="0" name="typeName"
    type="xsd:string" />
   <xsd:element maxOccurs="unbounded" minOccurs="0"
    name="Attribute" type="Attribute" />
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="Attribute">
  <xsd:sequence>
   <xsd:element minOccurs="0" name="name" type="xsd:string" />
   <xsd:choice minOccurs="1">
    <xsd:element minOccurs="1" maxOccurs="1"
     name="CompositeType" type="CompositeType" />
    <xsd:element minOccurs="1" maxOccurs="1"
     name="CompositeTypeReference" type="xsd:string" />
   </xsd:choice>
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="Model">
  <xsd:sequence>
   <xsd:element maxOccurs="unbounded" minOccurs="0"
    name="CompositeType" type="CompositeType" />
  </xsd:sequence>
 </xsd:complexType>
</xsd:schema>

xml file :

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="test.xsd" >
 <CompositeType>
  <typeName>Bozo</typeName>
 </CompositeType>
 <CompositeType>
  <typeName>MyData</typeName>
  <Attribute>
   <name>b</name>
   <CompositeTypeReference>Bozo</CompositeTypeReference>
  </Attribute>
  <Attribute>
   <name>d</name>
   <CompositeType>
    <typeName>CustomData</typeName>
   </CompositeType>
  </Attribute>
  <Attribute>
   <name>n</name>
   <CompositeType>
    <typeName>NewData</typeName>
    <Attribute>
     <name>m</name>
     <CompositeTypeReference>My</CompositeTypeReference>
    </Attribute>
    <Attribute>
     <name>c</name>
     <CompositeTypeReference>Custom</CompositeTypeReference>
    </Attribute>
   </CompositeType>
  </Attribute>
 </CompositeType>
</Model>

Notice that when validate if the validation of recursion works, there will be two errors at :
     <CompositeTypeReference>My</CompositeTypeReference>
     <CompositeTypeReference>Custom</CompositeTypeReference>
because the right references are :
     <CompositeTypeReference>MyData</CompositeTypeReference>
     <CompositeTypeReference>CustomData</CompositeTypeReference>

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


[jira] Updated: (XERCESJ-1396) key/keyref does not validate with recursion

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich updated XERCESJ-1396:
------------------------------------------

          Component/s: XML Schema 1.0 Structures
    Affects Version/s: 2.9.1

> key/keyref does not validate with recursion
> -------------------------------------------
>
>                 Key: XERCESJ-1396
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1396
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.9.1
>         Environment: Window, with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400
>            Reporter: Chu Minh Toan
>
> Hi everyone,
> Is it true that key/keyref does not validate with recursion? I have this question because that when I validate the following xml file, the validation of an element defined with recursion doesn't work. Following is xml and the corresponding xsd file. (I validate xml file with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400). Thanks in advance!
> Toan.
> xsd file :
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>  <xsd:element name="CompositeType" type="CompositeType" />
>  <xsd:element name="Model" type="Model">
>   <!-- CompositeTypeKey/KeyRef -->
>   <xsd:key name="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//CompositeType" />
>    <xsd:field xpath="./typeName" />
>   </xsd:key>
>   <xsd:keyref name="CompositeTypeRef" refer="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//Attribute/CompositeTypeReference" />
>    <xsd:field xpath="." />
>   </xsd:keyref>
>  </xsd:element>
>  <xsd:complexType name="CompositeType">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="typeName"
>     type="xsd:string" />
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="Attribute" type="Attribute" />
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Attribute">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="name" type="xsd:string" />
>    <xsd:choice minOccurs="1">
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeType" type="CompositeType" />
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeTypeReference" type="xsd:string" />
>    </xsd:choice>
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Model">
>   <xsd:sequence>
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="CompositeType" type="CompositeType" />
>   </xsd:sequence>
>  </xsd:complexType>
> </xsd:schema>
> xml file :
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
> <Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="test.xsd" >
>  <CompositeType>
>   <typeName>Bozo</typeName>
>  </CompositeType>
>  <CompositeType>
>   <typeName>MyData</typeName>
>   <Attribute>
>    <name>b</name>
>    <CompositeTypeReference>Bozo</CompositeTypeReference>
>   </Attribute>
>   <Attribute>
>    <name>d</name>
>    <CompositeType>
>     <typeName>CustomData</typeName>
>    </CompositeType>
>   </Attribute>
>   <Attribute>
>    <name>n</name>
>    <CompositeType>
>     <typeName>NewData</typeName>
>     <Attribute>
>      <name>m</name>
>      <CompositeTypeReference>My</CompositeTypeReference>
>     </Attribute>
>     <Attribute>
>      <name>c</name>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
>     </Attribute>
>    </CompositeType>
>   </Attribute>
>  </CompositeType>
> </Model>
> Notice that when validate if the validation of recursion works, there will be two errors at :
>      <CompositeTypeReference>My</CompositeTypeReference>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
> because the right references are :
>      <CompositeTypeReference>MyData</CompositeTypeReference>
>      <CompositeTypeReference>CustomData</CompositeTypeReference>

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


[jira] Commented: (XERCESJ-1396) key/keyref does not validate with recursion

Posted by "George Bina (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877080#action_12877080 ] 

George Bina commented on XERCESJ-1396:
--------------------------------------

This issue is fixed by the implementation of XPathMatcher attached to XERCESJ-832
https://issues.apache.org/jira/secure/attachment/12446685/XPathMatcher.java

> key/keyref does not validate with recursion
> -------------------------------------------
>
>                 Key: XERCESJ-1396
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1396
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.9.1
>         Environment: Window, with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400
>            Reporter: Chu Minh Toan
>
> Hi everyone,
> Is it true that key/keyref does not validate with recursion? I have this question because that when I validate the following xml file, the validation of an element defined with recursion doesn't work. Following is xml and the corresponding xsd file. (I validate xml file with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400). Thanks in advance!
> Toan.
> xsd file :
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>  <xsd:element name="CompositeType" type="CompositeType" />
>  <xsd:element name="Model" type="Model">
>   <!-- CompositeTypeKey/KeyRef -->
>   <xsd:key name="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//CompositeType" />
>    <xsd:field xpath="./typeName" />
>   </xsd:key>
>   <xsd:keyref name="CompositeTypeRef" refer="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//Attribute/CompositeTypeReference" />
>    <xsd:field xpath="." />
>   </xsd:keyref>
>  </xsd:element>
>  <xsd:complexType name="CompositeType">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="typeName"
>     type="xsd:string" />
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="Attribute" type="Attribute" />
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Attribute">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="name" type="xsd:string" />
>    <xsd:choice minOccurs="1">
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeType" type="CompositeType" />
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeTypeReference" type="xsd:string" />
>    </xsd:choice>
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Model">
>   <xsd:sequence>
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="CompositeType" type="CompositeType" />
>   </xsd:sequence>
>  </xsd:complexType>
> </xsd:schema>
> xml file :
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
> <Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="test.xsd" >
>  <CompositeType>
>   <typeName>Bozo</typeName>
>  </CompositeType>
>  <CompositeType>
>   <typeName>MyData</typeName>
>   <Attribute>
>    <name>b</name>
>    <CompositeTypeReference>Bozo</CompositeTypeReference>
>   </Attribute>
>   <Attribute>
>    <name>d</name>
>    <CompositeType>
>     <typeName>CustomData</typeName>
>    </CompositeType>
>   </Attribute>
>   <Attribute>
>    <name>n</name>
>    <CompositeType>
>     <typeName>NewData</typeName>
>     <Attribute>
>      <name>m</name>
>      <CompositeTypeReference>My</CompositeTypeReference>
>     </Attribute>
>     <Attribute>
>      <name>c</name>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
>     </Attribute>
>    </CompositeType>
>   </Attribute>
>  </CompositeType>
> </Model>
> Notice that when validate if the validation of recursion works, there will be two errors at :
>      <CompositeTypeReference>My</CompositeTypeReference>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
> because the right references are :
>      <CompositeTypeReference>MyData</CompositeTypeReference>
>      <CompositeTypeReference>CustomData</CompositeTypeReference>

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


[jira] Commented: (XERCESJ-1396) key/keyref does not validate with recursion

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790000#action_12790000 ] 

Michael Glavassevich commented on XERCESJ-1396:
-----------------------------------------------

Right. There should be errors reported for those two elements because they have no corresponding key value. Probably a bug in the XPath matcher.

> key/keyref does not validate with recursion
> -------------------------------------------
>
>                 Key: XERCESJ-1396
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1396
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.9.1
>         Environment: Window, with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400
>            Reporter: Chu Minh Toan
>
> Hi everyone,
> Is it true that key/keyref does not validate with recursion? I have this question because that when I validate the following xml file, the validation of an element defined with recursion doesn't work. Following is xml and the corresponding xsd file. (I validate xml file with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400). Thanks in advance!
> Toan.
> xsd file :
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>  <xsd:element name="CompositeType" type="CompositeType" />
>  <xsd:element name="Model" type="Model">
>   <!-- CompositeTypeKey/KeyRef -->
>   <xsd:key name="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//CompositeType" />
>    <xsd:field xpath="./typeName" />
>   </xsd:key>
>   <xsd:keyref name="CompositeTypeRef" refer="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//Attribute/CompositeTypeReference" />
>    <xsd:field xpath="." />
>   </xsd:keyref>
>  </xsd:element>
>  <xsd:complexType name="CompositeType">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="typeName"
>     type="xsd:string" />
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="Attribute" type="Attribute" />
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Attribute">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="name" type="xsd:string" />
>    <xsd:choice minOccurs="1">
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeType" type="CompositeType" />
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeTypeReference" type="xsd:string" />
>    </xsd:choice>
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Model">
>   <xsd:sequence>
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="CompositeType" type="CompositeType" />
>   </xsd:sequence>
>  </xsd:complexType>
> </xsd:schema>
> xml file :
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
> <Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="test.xsd" >
>  <CompositeType>
>   <typeName>Bozo</typeName>
>  </CompositeType>
>  <CompositeType>
>   <typeName>MyData</typeName>
>   <Attribute>
>    <name>b</name>
>    <CompositeTypeReference>Bozo</CompositeTypeReference>
>   </Attribute>
>   <Attribute>
>    <name>d</name>
>    <CompositeType>
>     <typeName>CustomData</typeName>
>    </CompositeType>
>   </Attribute>
>   <Attribute>
>    <name>n</name>
>    <CompositeType>
>     <typeName>NewData</typeName>
>     <Attribute>
>      <name>m</name>
>      <CompositeTypeReference>My</CompositeTypeReference>
>     </Attribute>
>     <Attribute>
>      <name>c</name>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
>     </Attribute>
>    </CompositeType>
>   </Attribute>
>  </CompositeType>
> </Model>
> Notice that when validate if the validation of recursion works, there will be two errors at :
>      <CompositeTypeReference>My</CompositeTypeReference>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
> because the right references are :
>      <CompositeTypeReference>MyData</CompositeTypeReference>
>      <CompositeTypeReference>CustomData</CompositeTypeReference>

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


[jira] Assigned: (XERCESJ-1396) key/keyref does not validate with recursion

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich reassigned XERCESJ-1396:
---------------------------------------------

    Assignee: Michael Glavassevich

> key/keyref does not validate with recursion
> -------------------------------------------
>
>                 Key: XERCESJ-1396
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1396
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.9.1
>         Environment: Window, with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400
>            Reporter: Chu Minh Toan
>            Assignee: Michael Glavassevich
>
> Hi everyone,
> Is it true that key/keyref does not validate with recursion? I have this question because that when I validate the following xml file, the validation of an element defined with recursion doesn't work. Following is xml and the corresponding xsd file. (I validate xml file with Eclipse and the xerces plug-in is org.apache.xerces_2.9.0.v200805270400). Thanks in advance!
> Toan.
> xsd file :
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>  <xsd:element name="CompositeType" type="CompositeType" />
>  <xsd:element name="Model" type="Model">
>   <!-- CompositeTypeKey/KeyRef -->
>   <xsd:key name="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//CompositeType" />
>    <xsd:field xpath="./typeName" />
>   </xsd:key>
>   <xsd:keyref name="CompositeTypeRef" refer="CompositeTypeKey">
>    <xsd:selector
>     xpath=".//Attribute/CompositeTypeReference" />
>    <xsd:field xpath="." />
>   </xsd:keyref>
>  </xsd:element>
>  <xsd:complexType name="CompositeType">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="typeName"
>     type="xsd:string" />
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="Attribute" type="Attribute" />
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Attribute">
>   <xsd:sequence>
>    <xsd:element minOccurs="0" name="name" type="xsd:string" />
>    <xsd:choice minOccurs="1">
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeType" type="CompositeType" />
>     <xsd:element minOccurs="1" maxOccurs="1"
>      name="CompositeTypeReference" type="xsd:string" />
>    </xsd:choice>
>   </xsd:sequence>
>  </xsd:complexType>
>  <xsd:complexType name="Model">
>   <xsd:sequence>
>    <xsd:element maxOccurs="unbounded" minOccurs="0"
>     name="CompositeType" type="CompositeType" />
>   </xsd:sequence>
>  </xsd:complexType>
> </xsd:schema>
> xml file :
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
> <Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="test.xsd" >
>  <CompositeType>
>   <typeName>Bozo</typeName>
>  </CompositeType>
>  <CompositeType>
>   <typeName>MyData</typeName>
>   <Attribute>
>    <name>b</name>
>    <CompositeTypeReference>Bozo</CompositeTypeReference>
>   </Attribute>
>   <Attribute>
>    <name>d</name>
>    <CompositeType>
>     <typeName>CustomData</typeName>
>    </CompositeType>
>   </Attribute>
>   <Attribute>
>    <name>n</name>
>    <CompositeType>
>     <typeName>NewData</typeName>
>     <Attribute>
>      <name>m</name>
>      <CompositeTypeReference>My</CompositeTypeReference>
>     </Attribute>
>     <Attribute>
>      <name>c</name>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
>     </Attribute>
>    </CompositeType>
>   </Attribute>
>  </CompositeType>
> </Model>
> Notice that when validate if the validation of recursion works, there will be two errors at :
>      <CompositeTypeReference>My</CompositeTypeReference>
>      <CompositeTypeReference>Custom</CompositeTypeReference>
> because the right references are :
>      <CompositeTypeReference>MyData</CompositeTypeReference>
>      <CompositeTypeReference>CustomData</CompositeTypeReference>

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