[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: parse using DOM
Try String filename = "foo.xml"; DOMParser parser = new DOMParser(); FileInputStream fileStream = new FileInputStream(filename); InputSource inputSource = new InputSource(fileStream); inputSource.setSystemId("file:" + filename); parser.parse(inputSource); Document fdoc = parser.getDocument(); fileStream.close(); The InputSource class (see API docs for more info) contains a reference to the incoming data stream and is used to store some information about the file's role and location. Calling "setSystemId()" is critical for most parsers if we want to be able to locate DTDs or external entities that are referenced with relative URIs. Hope this helps. -- Warren Hedley Department of Engineering Science Auckland University New Zealand XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|