Hi Pervesh FWIW you don't need to use SAXContentHandler directly, you can use SAXReader which wraps up the use of SAX, JAXP etc.
SAXReader reader = new SAXReader(); Document doc = reader.read( "foo.xml" ); For XPath support you really need a document of some kind; a subset of XPath can work on SAX events but its a pretty small subset of XPath. To learn more about XPath try these links; the Zvon gives you a quick 20 minute intro to xpath with heaps of examples http://www.zvon.org/xxl/XPathTutorial/General/examples.html also there's Elliotte's chapter from the great XML in a nutshell book... http://www.oreilly.com/catalog/xmlnut/chapter/ch09.html Essentailly to do XPath from dom4j Nodes (Document, Element, Attribute etc) there are these main methods.. List results = doc.selectNodes( "//a" ); Node node = doc.selectSingleNode( "/foo/bar" ); String text = doc.valueOf( "/foo/bar/@x" ); James ----- Original Message ----- From: "Purvesh Vora" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 17, 2002 6:12 AM Subject: RE: [dom4j-user] Beginner to dom4j Hi Christian Holmqvist & Soumanjoy, Thanks for your quick response and useful info. I want to parse xml using sax. I used SAXContentHandler and done it. I don't know about xpath. Does xpath internally uses sax only? or it uses DOM. Performance is the main issue on our side. Thanks in advance. Best Regards, Purvesh. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Christian Holmqvist, IT, Posten Sent: Tuesday, May 14, 2002 3:26 PM To: 'Purvesh Vora'; [EMAIL PROTECTED] Subject: SV: [dom4j-user] Beginner to dom4j I would say that these places is a good start to look at: http://www.dom4j.org/guide.html http://www.dom4j.org/cookbook/cookbook.html Have fun and keep parsing *smile* Cheers Christian > -----Ursprungligt meddelande----- > Fr�n: Purvesh Vora [mailto:[EMAIL PROTECTED]] > Skickat: den 14 maj 2002 09:05 > Till: [EMAIL PROTECTED] > �mne: [dom4j-user] Beginner to dom4j > > Hi Friends, > Today only I joined dom4j list. > I am new to dom4j,xml. > I have to parse and xml and read the data of each element and fill the > java objects using SAX. > Can you please give me some sample code. Or related links. > Thanks in Advance. > > Regards > Purvesh Vora _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
