Hello,
I need to read a huge XML document, so I've been trying to get several smaller parts to search into.
As a first step, I've created a Document object, under the
javax.xml.xpath.* and
javax.xml.parsers.* model:
domFactory = DocumentBuilderFactory.newInstance();
builder = domFactory.newDocumentBuilder();
doc = builder.parse(new File(inXML));
xpath = XPathFactory.newInstance().newXPath();
Later, I used a first
evaluate to get a
NodeList (my subset of the original Document):
NodeList de = (NodeList) xpath.evaluate("//sampleLabel/smallPart", doc, XPathConstants.NODESET);
And I would like to search into the
de NodeList, like this:
NodeList subSet = (NodeList) xpath.evaluate("//firstElementofSet/text()", de, XPathConstants.NODESET);
However, I've got a "javax.xml.transform.TransformerException" (Unknown Xpath Error)
What am I doing wrong?
For your support, thank you in advance.