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
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
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
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
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
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
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 ,