[ 
https://issues.apache.org/jira/browse/XERCESJ-1578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447585#comment-13447585
 ] 

Octavian Nadolu commented on XERCESJ-1578:
------------------------------------------

I still reproduce the exception.
The locationHint seems to be not correctly expanded. The base system id where 
the locationHint is expanded is locationHint. I think the base system id for 
the locationHint should be fSchemaGrammarDescription.getBaseSystemId(). Also 
the schemaSource systemId is already expanded in the "schemaId" variable. so 
you don't need to expand it again, just pass the "schemaId" to the 
isValidTargetUriForIncludeOrOverride() method instead of schemaSource.

The example used to reproduce the exception:

main.xsd
--------------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <xs:include schemaLocation="include1.xsd"/>
    <xs:override schemaLocation="main.xsd"/>
</xs:schema>
--------------------------

include1.xsd
-----------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <xs:include schemaLocation="include2.xsd"/>
</xs:schema>
----------------------- 

include2.xsd
-----------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <xs:override schemaLocation="main.xsd"/>
</xs:schema>
----------------------- 
                
> Stack overflow when validating schema with emtpy @href in <override>
> --------------------------------------------------------------------
>
>                 Key: XERCESJ-1578
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1578
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>            Assignee: Mukul Gandhi
>
> When validating with XML Schema 1.1 support the following schema:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
> elementFormDefault="qualified">
>     <xs:include schemaLocation="testSimple.xsd"/>
>     <xs:override schemaLocation=""/>
> </xs:schema>
> which references a very simple schema "testSimple.xsd":
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
> elementFormDefault="qualified"> </xs:schema>
> I obtain a stack overflow:
> java.lang.StackOverflowError
>       at java.net.URLStreamHandler.setURL(URLStreamHandler.java:516)
>       at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:288)
>       at sun.net.www.protocol.file.Handler.parseURL(Handler.java:50)
>       at java.net.URL.<init>(URL.java:596)
>       at java.net.URL.<init>(URL.java:464)
>       at java.net.URL.<init>(URL.java:413)
>       at ro.sync.util.URLUtil.clearUserInfo(URLUtil.java:434)
>       at 
> ro.sync.xml.catalogresolver.ExtendedCatalogResolver.debugResolve(ExtendedCatalogResolver.java:171)
>       at 
> ro.sync.xml.catalogresolver.ExtendedCatalogResolver.resolveEntity(ExtendedCatalogResolver.java:136)
>       at 
> ro.sync.xml.catalogresolver.CatalogEntityResolver.resolveEntity(CatalogEntityResolver.java:69)
>       at 
> ro.sync.xml.catalogresolver.DelegatingXMLEntityResolver.resolveEntity(DelegatingXMLEntityResolver.java:151)
>       at 
> org.apache.xerces.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:710)
>       at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown 
> Source)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.resolveSchemaSource(XSDHandler.java:2297)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandler.java:1163)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandler.java:1224)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandler.java:1224)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandler.java:1224)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandler.java:1224)
>       at 
> org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandler.java:1224)

--
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to