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/16 08:00:48 UTC

[jira] [Commented] (XERCESJ-1568) NPE when overridden schema does not exist

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

Radu Coravu commented on XERCESJ-1568:
--------------------------------------

Thank you.
                
> NPE when overridden schema does not exist
> -----------------------------------------
>
>                 Key: XERCESJ-1568
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1568
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>            Assignee: Mukul Gandhi
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I try to validate a schema with the following content:
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://xstest-tns/schema11_S3_4_2_4"
>     elementFormDefault="qualified"
>     attributeFormDefault="qualified"
>     xmlns:tns="http://xstest-tns/schema11_S3_4_2_4"
>     defaultAttributes="tns:defaultAttrGroup">
>     
>     <override schemaLocation="s3_4_2_4ii10b.xsd">
>         <complexType name="c1" defaultAttributesApply="false">
>             <sequence>
>                 <element name="element_added" minOccurs="1"/>
>             </sequence>
>         </complexType>
>     </override>
> </schema>
> The "s3_4_2_4ii10b.xsd" is missing.
> One of the received errors is a NPE:
> java.lang.NullPointerException
> 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> 	at org.apache.xerces.impl.xs.traversers.override.DOMOverrideImpl.cloneOverridenSchema(DOMOverrideImpl.java:283)
> 	at org.apache.xerces.impl.xs.traversers.override.DOMOverrideImpl.transform(DOMOverrideImpl.java:106)
> 	at org.apache.xerces.impl.xs.traversers.override.OverrideTransformationManager.transform(Unknown Source)
> 	at org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.constructTrees(XSDHandlerXerces.java:1182)
> 	at org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.parseSchema(XSDHandlerXerces.java:684)
> 	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
> 	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
> 	at org.apache.xerces.parsers.XMLGrammarPreparserXerces.preparseGrammar(XMLGrammarPreparserXerces.java:210)
> Somehow the code tries to clone the DOM document for the overridden schema, even if it is not available.

--
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