We are moving over from the Sun XML package.  We were using the
com.sun.xml.tree.XmlDocument.getSystemId() to retrieve the URI of the
document we are working on.  I can not find a similar function in the
org.w3c.doc.Document interface or any of the implementors.

I have the following code to now parse our XML documents.

public org.w3c.dom.Document getDocument(String fileName) {
        //          instantiate parser
        DOMParser parser = new DOMParser();

        //          installing error handler
        parser.setErrorHandler(new CPUTErrorHandler ());

        //          parsing document from URI string
        parser.parse(new File(fileName).toURL().toString());

        //          querying document after parse
        return parser.getDocument();
}

The concrete type of the Document is
"org.apache.xerces.dom.DeferredDocumentImpl".  



This really is the only thing holding us up from using Xerces in our Web
App.

Thanks!

Donald R. Kichline
Senior Programmer/Analyst
 
Penske Truck Leasing 
Rt. 10 Green Hills / P.O. Box 563 
Reading, PA 19603-0563 
610.796.4190 / Fax: 610.603.8402
E-MAIL: [EMAIL PROTECTED] 

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

Reply via email to