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 bu...@apache.org on 2003/02/21 15:36:55 UTC

DO NOT REPLY [Bug 17286] New: - Nullpointer exception when using

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17286>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17286

Nullpointer exception when using <xs:complexType mixed="true"/>

           Summary: Nullpointer exception when using <xs:complexType
                    mixed="true"/>
           Product: Xerces2-J
           Version: 2.3.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: XML Schema Structures
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: sander@x-hive.com


When I have the schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
 <xs:element name="personnel">
  <xs:complexType mixed="true"/>
 </xs:element>
 <xs:element name="person" type="xs:anyType"/>
</xs:schema>

and I parse with schema validation the document:

<?xml version="1.0" encoding="UTF-8"?>
<personnel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:noNamespaceSchemaLocation='personal.xsd'>
  <person/>
</personnel>

I get:

java.lang.NullPointerException
        at org.apache.xerces.impl.xs.XSModelGroupImpl.toString(Unknown Source)
        at org.apache.xerces.impl.xs.XSParticleDecl.appendParticle(Unknown 
Source)
        at org.apache.xerces.impl.xs.XSParticleDecl.toString(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement
(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown 
Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.
dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at sax.Counter.main(Counter.java:543)

I am not sure whether <xs:complexType mixed="true"/> is even valid XML Schema 
(don't shoot the messenger, this is what XML Spy produces when converting a DTD 
with an 'ANY' element declaration), but I don't think it should give a 
NullPointerException if it is wrong.

(I changed the schema declarations to type="xs:anyType", so it is no problem 
for me)

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org