Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I validate an XML:
<root xmlns="http://xstest-tns/schema11_D4_3_15"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xstest-tns/schema11_D4_3_15 npeXerces.xsd"/>
with an XML Schema 1.1:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://xstest-tns/schema11_D4_3_15"
targetNamespace="http://xstest-tns/schema11_D4_3_15"
elementFormDefault="qualified">
<xs:element name="root">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:assertion test="/root = 'present'" xpathDefaultNamespace="##targetNamespace" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
Although the schema is 1.1, it is parsed in 1.0-mode.
The NPE is like:
java.lang.NullPointerException
at org.apache.xerces.impl.xs.traversers.XSDAbstractTraverser.traverseFacets(XSDAbstractTraverser.java:468)
at org.apache.xerces.impl.xs.traversers.XSDSimpleTypeTraverser.getSimpleType(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDSimpleTypeTraverser.traverseLocal(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDElementTraverserXerces.traverseNamedElement(XSDElementTraverserXerces.java:397)
at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseNamedElement(XSDElementTraverser.java:69)
at org.apache.xerces.impl.xs.traversers.XSDElementTraverserXerces.traverseGlobal(XSDElementTraverserXerces.java:240)
at org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.traverseSchemas(XSDHandlerXerces.java:1557)
at org.apache.xerces.impl.xs.traversers.XSDHandlerXerces.parseSchema(XSDHandlerXerces.java:694)
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)