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

Validating DocumentBuilderFactory

           Summary: Validating DocumentBuilderFactory
           Product: Xerces2-J
           Version: 2.0.0
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: JAXP
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When validating foo.xml the following code should work:

import javax.xml.parsers.*; // use generic JAXP interface
DocumentBuilderFactory f=javax.xml.parsers.DocumentBuilderFactory.newInstance();
f.setValidating(true);
DocumentBuilder builder=f.newDocumentBuilder();

//Exceptions should appear if foo.xml is invalid
org.w3c.dom.Document doc=builder.parse("foo.xml");
 
I just use the generic javax.xml.parsers.*.
The code above causes no Exception even if foo.xml is invalid.

With xerces f is an instance of org.apache.xerces.jaxp.DocumentBuilderFactory.
In f no ErrorHandler is set for the builder, thus the above code causes no
Exception even if foo.xml is invalid.

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

Reply via email to