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/07/13 11:02:34 UTC

[jira] [Created] (XERCESJ-1571) Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

Radu Coravu created XERCESJ-1571:
------------------------------------

             Summary: Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)
                 Key: XERCESJ-1571
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1571
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema 1.1 Datatypes
    Affects Versions: 2.11.0
            Reporter: Radu Coravu


If I validate in 1.1 mode a certain XML Schema, the validation never finishes.

The XML Schema is below:

---------------------------------
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="a"
        xmlns:a="a">
        
<!-- 
Test Case Type: Valid test
Description   : Tests openContent in complexType derived by restriction 
-->

<defaultOpenContent mode="suffix">
 <any processContents="lax"/>
</defaultOpenContent>

<!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->

<complexType name="c">
 <openContent >
  <any processContents="lax"/>
 </openContent>
 <all>
  <element name="x" type="integer"/>
  <element name="y" type="integer"/>
 </all>
</complexType>

<complexType name="d">
 <complexContent>
  <restriction base="a:c">
   <all>
    <element name="x" type="integer"/>
    <element name="y" type="integer"/>   
   </all>
  </restriction>
 </complexContent>
</complexType>

<element name="root">
 <complexType>
  <sequence>
   <element name="p" type="a:d"/>	<!-- tests openContent -->
  </sequence>
 </complexType>
</element>

</schema>
 ----------------------------------

In the method:

org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()

the code:

while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {

loops endlessly when wd1 and wd are both anyType.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1571) Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

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

Michael Glavassevich resolved XERCESJ-1571.
-------------------------------------------

    Resolution: Cannot Reproduce

With the current code in SVN I cannot reproduce this problem either. Looks like it got fixed at some point.
                
> Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1571
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1571
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Datatypes
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> If I validate in 1.1 mode a certain XML Schema, the validation never finishes.
> The XML Schema is below:
> ---------------------------------
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="a"
>         xmlns:a="a">
>         
> <!-- 
> Test Case Type: Valid test
> Description   : Tests openContent in complexType derived by restriction 
> -->
> <defaultOpenContent mode="suffix">
>  <any processContents="lax"/>
> </defaultOpenContent>
> <!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->
> <complexType name="c">
>  <openContent >
>   <any processContents="lax"/>
>  </openContent>
>  <all>
>   <element name="x" type="integer"/>
>   <element name="y" type="integer"/>
>  </all>
> </complexType>
> <complexType name="d">
>  <complexContent>
>   <restriction base="a:c">
>    <all>
>     <element name="x" type="integer"/>
>     <element name="y" type="integer"/>   
>    </all>
>   </restriction>
>  </complexContent>
> </complexType>
> <element name="root">
>  <complexType>
>   <sequence>
>    <element name="p" type="a:d"/>	<!-- tests openContent -->
>   </sequence>
>  </complexType>
> </element>
> </schema>
>  ----------------------------------
> In the method:
> org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()
> the code:
> while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {
> loops endlessly when wd1 and wd are both anyType.

--
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-1571) Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

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

Radu Coravu commented on XERCESJ-1571:
--------------------------------------

No, it happens when the schema grammar is compiled, I added a stack trace to see how the code works:

	at org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase(XS11CMRestriction.java:573)
	at org.apache.xerces.impl.xs.models.XS11CMRestriction.check(XS11CMRestriction.java:366)
	at org.apache.xerces.impl.xs.XS11Constraints.typeSubsumption(Unknown Source)
	at org.apache.xerces.impl.xs.XSConstraints.fullSchemaChecking(XSConstraints.java:469)
	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
	at org.apache.xerces.parsers.XMLGrammarPreparserXerces.preparseGrammar(XMLGrammarPreparserXerces.java:210)

Then the code enters "matchWildcardInBase" and stays in one of the "while" loops.
                
> Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1571
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1571
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Datatypes
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> If I validate in 1.1 mode a certain XML Schema, the validation never finishes.
> The XML Schema is below:
> ---------------------------------
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="a"
>         xmlns:a="a">
>         
> <!-- 
> Test Case Type: Valid test
> Description   : Tests openContent in complexType derived by restriction 
> -->
> <defaultOpenContent mode="suffix">
>  <any processContents="lax"/>
> </defaultOpenContent>
> <!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->
> <complexType name="c">
>  <openContent >
>   <any processContents="lax"/>
>  </openContent>
>  <all>
>   <element name="x" type="integer"/>
>   <element name="y" type="integer"/>
>  </all>
> </complexType>
> <complexType name="d">
>  <complexContent>
>   <restriction base="a:c">
>    <all>
>     <element name="x" type="integer"/>
>     <element name="y" type="integer"/>   
>    </all>
>   </restriction>
>  </complexContent>
> </complexType>
> <element name="root">
>  <complexType>
>   <sequence>
>    <element name="p" type="a:d"/>	<!-- tests openContent -->
>   </sequence>
>  </complexType>
> </element>
> </schema>
>  ----------------------------------
> In the method:
> org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()
> the code:
> while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {
> loops endlessly when wd1 and wd are both anyType.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1571) Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

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

Radu Coravu commented on XERCESJ-1571:
--------------------------------------

I can reproduce the problem running the command line in the Xerces schema 1.1 beta distribution and so if you cannot reproduce it in the current snapshot it has indeed probably been fixed.
Sorry for the false alarm. You can close this one as well.
                
> Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1571
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1571
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Datatypes
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> If I validate in 1.1 mode a certain XML Schema, the validation never finishes.
> The XML Schema is below:
> ---------------------------------
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="a"
>         xmlns:a="a">
>         
> <!-- 
> Test Case Type: Valid test
> Description   : Tests openContent in complexType derived by restriction 
> -->
> <defaultOpenContent mode="suffix">
>  <any processContents="lax"/>
> </defaultOpenContent>
> <!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->
> <complexType name="c">
>  <openContent >
>   <any processContents="lax"/>
>  </openContent>
>  <all>
>   <element name="x" type="integer"/>
>   <element name="y" type="integer"/>
>  </all>
> </complexType>
> <complexType name="d">
>  <complexContent>
>   <restriction base="a:c">
>    <all>
>     <element name="x" type="integer"/>
>     <element name="y" type="integer"/>   
>    </all>
>   </restriction>
>  </complexContent>
> </complexType>
> <element name="root">
>  <complexType>
>   <sequence>
>    <element name="p" type="a:d"/>	<!-- tests openContent -->
>   </sequence>
>  </complexType>
> </element>
> </schema>
>  ----------------------------------
> In the method:
> org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()
> the code:
> while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {
> loops endlessly when wd1 and wd are both anyType.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1571) Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

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

Mukul Gandhi commented on XERCESJ-1571:
---------------------------------------

again, it seems you might be using Xerces schema 1.1 beta version. When I check the schema you've posted, for correctness with XSD 1.1 rules from the SVN code base, the schema is reported as correct.

The following command doesn't give an error,

java jaxp.SourceValidator -a yourschema.xsd -f -xsd11
                
> Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1571
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1571
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Datatypes
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> If I validate in 1.1 mode a certain XML Schema, the validation never finishes.
> The XML Schema is below:
> ---------------------------------
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="a"
>         xmlns:a="a">
>         
> <!-- 
> Test Case Type: Valid test
> Description   : Tests openContent in complexType derived by restriction 
> -->
> <defaultOpenContent mode="suffix">
>  <any processContents="lax"/>
> </defaultOpenContent>
> <!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->
> <complexType name="c">
>  <openContent >
>   <any processContents="lax"/>
>  </openContent>
>  <all>
>   <element name="x" type="integer"/>
>   <element name="y" type="integer"/>
>  </all>
> </complexType>
> <complexType name="d">
>  <complexContent>
>   <restriction base="a:c">
>    <all>
>     <element name="x" type="integer"/>
>     <element name="y" type="integer"/>   
>    </all>
>   </restriction>
>  </complexContent>
> </complexType>
> <element name="root">
>  <complexType>
>   <sequence>
>    <element name="p" type="a:d"/>	<!-- tests openContent -->
>   </sequence>
>  </complexType>
> </element>
> </schema>
>  ----------------------------------
> In the method:
> org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()
> the code:
> while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {
> loops endlessly when wd1 and wd are both anyType.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1571) Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

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

Mukul Gandhi commented on XERCESJ-1571:
---------------------------------------

If I simply check the schema you've posted for correctness with XSD 1.1 rules, Xerces reports that this is a correct 1.1 schema. Is the problem you're facing appears at XML instance validation time? -- if yes, can you please post the instance document as well for us to look at it.  
                
> Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)
> ----------------------------------------------------------------------
>
>                 Key: XERCESJ-1571
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1571
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Datatypes
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> If I validate in 1.1 mode a certain XML Schema, the validation never finishes.
> The XML Schema is below:
> ---------------------------------
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="a"
>         xmlns:a="a">
>         
> <!-- 
> Test Case Type: Valid test
> Description   : Tests openContent in complexType derived by restriction 
> -->
> <defaultOpenContent mode="suffix">
>  <any processContents="lax"/>
> </defaultOpenContent>
> <!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->
> <complexType name="c">
>  <openContent >
>   <any processContents="lax"/>
>  </openContent>
>  <all>
>   <element name="x" type="integer"/>
>   <element name="y" type="integer"/>
>  </all>
> </complexType>
> <complexType name="d">
>  <complexContent>
>   <restriction base="a:c">
>    <all>
>     <element name="x" type="integer"/>
>     <element name="y" type="integer"/>   
>    </all>
>   </restriction>
>  </complexContent>
> </complexType>
> <element name="root">
>  <complexType>
>   <sequence>
>    <element name="p" type="a:d"/>	<!-- tests openContent -->
>   </sequence>
>  </complexType>
> </element>
> </schema>
>  ----------------------------------
> In the method:
> org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()
> the code:
> while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {
> loops endlessly when wd1 and wd are both anyType.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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