[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: parse using DOM

Subject: Re: parse using DOM
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Thu, 03 Feb 2000 09:49:50 +1300
ravi akireddy
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.