Re: [dom4j-user] newbie question: unable to get xpath values

2007-06-19 Thread Anand Raman
Thanks Edwin. This really helps. I will take care of the default namespaces from here on. The tbody ommission is even more funny. I am using firebug to extract XPaths from the document. It turns out firebug is adding the Tbody element to the xpath. Thanks for spotting it out for me. Thanks anand

Re: [dom4j-user] newbie question: unable to get xpath values

2007-06-19 Thread Edwin Dankert
The problem is your default namespace, you will have to map this namespace to a prefix and use the prefix in your xpath expressions HashMap map = new HashMap(); map.put("html", "http://www.w3.org/1999/xhtml";); XPath xpath = doc.createXPath("/html:html/html:head/html:title"); xpath.setNamespaceCo

[dom4j-user] newbie question: unable to get xpath values

2007-06-19 Thread Anand Raman
hi all, I need to parse a html file and retrieve a few values from a table contained in the body. To begin with I am using the following code snippet to retrieve value for the "title" attribute. Document doc = new SAXReader().read(new File( "D:/work//javascript/mo

RE: [dom4j-user] newbie question

2002-08-30 Thread Mike Skells
lf Of > Gregory Dulski (s) > Sent: Thursday 29 August 2002 16:54 > To: '[EMAIL PROTECTED]' > Subject: [dom4j-user] newbie question > > > I am new to XPATH and I have to convert a string containing > an XML tree into a document then search the document for > s

[dom4j-user] newbie question

2002-08-29 Thread Gregory Dulski (s)
I am new to XPATH and I have to convert a string containing an XML tree into a document then search the document for specific elements and attribute values. Here's a small example of my code... I just do not know how to access the values of the FirstName, LastName elements and the '@Type' attribu

Re: [dom4j-user] newbie question

2001-07-06 Thread James Strachan
Hi Piero > - Node.getUniquePath() does not give me a unique path> > If I have this xml: > > > > > > > i am here > > > and my node is pointing to the second tag, > and I do getUniquePath(), instead of getting > /root/section[2]/page , > I get > /root/section/page Which ve

[dom4j-user] newbie question

2001-07-06 Thread piero de salvia
hi guys, I'm trying to get started with dom4j, and I need a little help: - Node.getUniquePath() does not give me a unique path> If I have this xml: i am here and my node is pointing to the second tag, and I do getUniquePath(), instead of getting /root/section[2]/page ,