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=5240>.
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=5240

Segmentation fault occuring when parsing a xml schema document with validation 
switched on

           Summary: Segmentation fault occuring when parsing a xml schema
                    document with validation switched on
           Product: Xerces2-J
           Version: 2.0.0 [beta 3]
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: SAX
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


I try to parse a XML schema document with the validation feature switched on
(xmlReader.setFeature("http://apache.org/xml/features/validation/schema";, true);),
and a segmentation fault occurs. It does not if the feature is switched off.
Here the xml file:

<?xml version="1.0" encoding="UTF-8"?>
<person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:noNamespaceSchemaLocation="person.xsd">
  <name>Isabelle</name>
  <age>1234</age>
</person>

And the xsd file:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
  <xs:element name="person">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name" type="xs:string"/>
        <xs:element name="age" type="xs:decimal"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

The code is an extension of the class DefaultHandler and redefines the functions
 just to print the contents of the xml file. The startDocument() method is
called, and then the segmentation fault occurs.

The xmlReader is created through a SAXParserFactory. 

        SAXParserFactory spf = SAXParserFactory.newInstance();

If the following function is not called

        spf.setNamespaceAware(true);

Then i do not get a segmentation fault, but the following error:

        org.xml.sax.SAXException: cvc-elt.1: Cannot find the declaration of
element 'person'.

The code is compiled with the version 1.4 of the jdk.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to