xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] Retrieving the path from root of an Element
- From: Benoît Thiébault <thiebault AT artenum.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] Retrieving the path from root of an Element
- Date: Wed, 11 Jul 2012 10:29:13 +0200
Hi everyone,
I am new to XOM and so far, I managed to use it successfully.
There is however something that I would like to do and can't find a way to do it.
I want to retrieve, as a String, the path to root of a given Element.
For instance, consider the following XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price>
</book>
</bookstore>
When reading the Element associated with the <title> tag, I would like to build the String: /bookstore/book/title.
I thought the following line would work :
element.getValue();
But this only returns a bunch of spaces (it seems to be the indentation spaces of the XML file)...
What did I do wrong?
-
[XOM-interest] Retrieving the path from root of an Element,
Benoît Thiébault, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Benoît Thiébault, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Michael Kay, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Benoît Thiébault, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Michael Kay, 07/11/2012
- Re: [XOM-interest] Retrieving the path from root of an Element, Benoît Thiébault, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Michael Kay, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Benoît Thiébault, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Michael Kay, 07/11/2012
-
Re: [XOM-interest] Retrieving the path from root of an Element,
Benoît Thiébault, 07/11/2012
Archive powered by MHonArc 2.6.24.