[ https://issues.apache.org/jira/browse/XERCESJ-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mukul Gandhi updated XERCESJ-1605: ---------------------------------- Fix Version/s: 2.12.0 > NPE when comparing alternative types > ------------------------------------ > > Key: XERCESJ-1605 > URL: https://issues.apache.org/jira/browse/XERCESJ-1605 > Project: Xerces2-J > Issue Type: Bug > Components: XML Schema 1.1 Structures > Affects Versions: 2.11.0 > Reporter: Octavian Nadolu > Assignee: Mukul Gandhi > Priority: Minor > Fix For: 2.12.0 > > > When I validate the following schema I get an NPE. It seems that one of the > default alternative types is null. The schema is bigger but I extracted only > a part of it, just to reproduce the problem. > I tested on the xml-schema-1.1-dev branch. > ---- schema.xsd------------------------ > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > <xsd:complexType name="type1"> > <xsd:choice> > <xsd:sequence> > <xsd:element name="Element1"> > <xsd:alternative test="@index='3'" type="TypeI3"/> > <xsd:alternative type="TypeI5"/> > </xsd:element> > </xsd:sequence> > <xsd:sequence> > <xsd:element name="Element1"> > <xsd:alternative test="@index='3'" type="TypeI3"/> > <xsd:alternative type="TypeI5"/> > <xsd:unique name="TypeI5_U"> > <xsd:selector xpath="*"/> > <xsd:field xpath="@index"/> > </xsd:unique> > </xsd:element> > </xsd:sequence> > </xsd:choice> > </xsd:complexType> > <xsd:complexType name="TypeI3"/> > <xsd:complexType name="TypeI5"/> > </xsd:schema> > ---------------------------------------------------------- > ----------- NPE------------------------------ > java.lang.NullPointerException > at > org.apache.xerces.impl.xs.XS11Constraints.isTypeAlternativesEquivalent(XS11Constraints.java:235) > at > org.apache.xerces.impl.xs.XS11Constraints.isTypeTablesEquivalent(XS11Constraints.java:227) > at > org.apache.xerces.impl.xs.XS11Constraints.findElemInTable(XS11Constraints.java:137) > at > org.apache.xerces.impl.xs.XS11Constraints.checkElementDeclsConsistent(XS11Constraints.java:105) > at > org.apache.xerces.impl.xs.XSConstraints.fullSchemaChecking(XSConstraints.java:422) > at > org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:618) > at > org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:577) > at > org.apache.xerces.jaxp.validation.BaseSchemaFactory.newSchema(BaseSchemaFactory.java:223) > at XercesValidation.main(XercesValidation.java:256) > ---------------------------------------------------- -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: j-dev-h...@xerces.apache.org