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 "Radu Coravu (JIRA)" <xe...@xml.apache.org> on 2012/09/05 10:15:07 UTC

[jira] [Created] (XERCESJ-1585) Change in behavior when a keyref refers an out-of-scope unique or key

Radu Coravu created XERCESJ-1585:
------------------------------------

             Summary: Change in behavior when a keyref refers an out-of-scope unique or key
                 Key: XERCESJ-1585
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1585
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema 1.0 Structures
    Affects Versions: 2.11.0
            Reporter: Radu Coravu


If I have the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<Top xmlns="www.bla.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="www.bla.com test.xsd">
    <Sub_1>
        <Sub_2/>
        <Sub_2/>
    </Sub_1>
    <Sub_1a>
        <Sub_2a/>
    </Sub_1a>
</Top>

and validate it with the following XML Schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
    targetNamespace="www.bla.com" xmlns:ns="www.bla.com">
    
    <xs:element name="Top">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Sub_1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="Sub_2">
                                <xs:complexType>
                                    <xs:attribute name="SubID" use="optional"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:key name="newKey">
                        <xs:selector xpath="Sub_2a"/>
                        <xs:field xpath="@SubID"/>
                    </xs:key>
                </xs:element>
                <xs:element name="Sub_1a">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Sub_2a">
                                <xs:complexType>
                                    <xs:attribute name="SubIDPtr"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:keyref name="newKeyref" refer="ns:newKey">
                        <xs:selector xpath="Sub_2a"/>
                        <xs:field xpath="SubIDPtr"/>
                    </xs:keyref>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

In Xerces 2.9.0 the following error was reported:

Identity Constraint error:  identity constraint "KeyRef@79ff89" has a keyref which refers to a key or unique that is out of scope. 
@Line 11 Column 14

In Xerces 2.11.0 (using the 'xerces-java-xml-schema-1.1-dev' branch) the sample is considered valid when validated either with XML Schema 1.0 or 1.1 support.

Was there any functionality lost?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (XERCESJ-1585) Change in behavior when a keyref refers an out-of-scope unique or key

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

Mukul Gandhi commented on XERCESJ-1585:
---------------------------------------

I agree, that this improvement was desirable. This is now in SVN revision, 1392722.
                
> Change in behavior when a keyref refers an out-of-scope unique or key
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1585
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1585
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>            Assignee: Mukul Gandhi
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> If I have the following XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <Top xmlns="www.bla.com"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="www.bla.com test.xsd">
>     <Sub_1>
>         <Sub_2/>
>         <Sub_2/>
>     </Sub_1>
>     <Sub_1a>
>         <Sub_2a/>
>     </Sub_1a>
> </Top>
> and validate it with the following XML Schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
>     targetNamespace="www.bla.com" xmlns:ns="www.bla.com">
>     
>     <xs:element name="Top">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="Sub_1">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element maxOccurs="unbounded" name="Sub_2">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubID" use="optional"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:key name="newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="@SubID"/>
>                     </xs:key>
>                 </xs:element>
>                 <xs:element name="Sub_1a">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element name="Sub_2a">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubIDPtr"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:keyref name="newKeyref" refer="ns:newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="SubIDPtr"/>
>                     </xs:keyref>
>                 </xs:element>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
> In Xerces 2.9.0 the following error was reported:
> Identity Constraint error:  identity constraint "KeyRef@79ff89" has a keyref which refers to a key or unique that is out of scope. 
> @Line 11 Column 14
> In Xerces 2.11.0 (using the 'xerces-java-xml-schema-1.1-dev' branch) the sample is considered valid when validated either with XML Schema 1.0 or 1.1 support.
> Was there any functionality lost?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Resolved] (XERCESJ-1585) Change in behavior when a keyref refers an out-of-scope unique or key

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

Mukul Gandhi resolved XERCESJ-1585.
-----------------------------------

    Resolution: Fixed
      Assignee: Mukul Gandhi

a fix was committed for this issue. the relevant SVN revision id is 1388740.
                
> Change in behavior when a keyref refers an out-of-scope unique or key
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1585
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1585
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>            Assignee: Mukul Gandhi
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> If I have the following XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <Top xmlns="www.bla.com"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="www.bla.com test.xsd">
>     <Sub_1>
>         <Sub_2/>
>         <Sub_2/>
>     </Sub_1>
>     <Sub_1a>
>         <Sub_2a/>
>     </Sub_1a>
> </Top>
> and validate it with the following XML Schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
>     targetNamespace="www.bla.com" xmlns:ns="www.bla.com">
>     
>     <xs:element name="Top">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="Sub_1">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element maxOccurs="unbounded" name="Sub_2">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubID" use="optional"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:key name="newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="@SubID"/>
>                     </xs:key>
>                 </xs:element>
>                 <xs:element name="Sub_1a">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element name="Sub_2a">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubIDPtr"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:keyref name="newKeyref" refer="ns:newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="SubIDPtr"/>
>                     </xs:keyref>
>                 </xs:element>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
> In Xerces 2.9.0 the following error was reported:
> Identity Constraint error:  identity constraint "KeyRef@79ff89" has a keyref which refers to a key or unique that is out of scope. 
> @Line 11 Column 14
> In Xerces 2.11.0 (using the 'xerces-java-xml-schema-1.1-dev' branch) the sample is considered valid when validated either with XML Schema 1.0 or 1.1 support.
> Was there any functionality lost?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (XERCESJ-1585) Change in behavior when a keyref refers an out-of-scope unique or key

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

Octavian Nadolu commented on XERCESJ-1585:
------------------------------------------

Can you change also the error message. Now the error message displays the hash code of the keyRef. I think you should change idcConstraint.toString() in idcConstraint.getName() when you report the error message.
                
> Change in behavior when a keyref refers an out-of-scope unique or key
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1585
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1585
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>            Assignee: Mukul Gandhi
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> If I have the following XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <Top xmlns="www.bla.com"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="www.bla.com test.xsd">
>     <Sub_1>
>         <Sub_2/>
>         <Sub_2/>
>     </Sub_1>
>     <Sub_1a>
>         <Sub_2a/>
>     </Sub_1a>
> </Top>
> and validate it with the following XML Schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
>     targetNamespace="www.bla.com" xmlns:ns="www.bla.com">
>     
>     <xs:element name="Top">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="Sub_1">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element maxOccurs="unbounded" name="Sub_2">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubID" use="optional"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:key name="newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="@SubID"/>
>                     </xs:key>
>                 </xs:element>
>                 <xs:element name="Sub_1a">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element name="Sub_2a">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubIDPtr"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:keyref name="newKeyref" refer="ns:newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="SubIDPtr"/>
>                     </xs:keyref>
>                 </xs:element>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
> In Xerces 2.9.0 the following error was reported:
> Identity Constraint error:  identity constraint "KeyRef@79ff89" has a keyref which refers to a key or unique that is out of scope. 
> @Line 11 Column 14
> In Xerces 2.11.0 (using the 'xerces-java-xml-schema-1.1-dev' branch) the sample is considered valid when validated either with XML Schema 1.0 or 1.1 support.
> Was there any functionality lost?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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