[jdom-interest] XPath and JDOM
Mark Hortman
mark.hortman at jcafeinc.com
Tue Nov 19 10:40:26 PST 2002
Use the XPath features in jdom.
XPath idXpath = new XPath("//*[@id=5]");
Element id5Element = idXpath.selectSingleNode(myDocument);
// Now remove the element.
id5Element.getParent().remove(id5Element);
-----Original Message-----
From: Stefanos Kaklamanis [mailto:stefka at gnt.gr]
Sent: Monday, November 18, 2002 8:13 AM
To: JDOM-interest list
Subject: [jdom-interest] XPath and JDOM
Hi,
I want to get a specific element ( where attribute id =5 ) from an JDOM
document and edit/remove it from the document.
Any suggestion about solutions and tools?
Thanks,
Stefan
PS. I already have a look at Jaxen and SAXPath, but I could take what i
want.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20021119/fd7a6388/attachment.htm
More information about the jdom-interest
mailing list