XPath xp=DocumentHelper.createXPath("//rect");
List list=xp.selectNodes(document);
List list=xp.selectNodes(document);
the list is not empty. And i think the expressions: //rect and //*[name()='rect'] are equivalent, or am i wrong??
You need jaxen.jar too.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of bader houmad
Sent: Thursday, August 18, 2005 6:18 AM
To: dom4j-user@lists.sourceforge.net
Subject: [dom4j-user] getting started with dom4j
Hi,
I am new to dom4j.
I tried to to use it in a simple example:
153 SAXReader reader= new SAXReader();
154 URL url = "" URL(" file:///C:/Documents and Settings/Bader/Bureau/gradien.xml");
155 Document document = reader.read(url);
156 XPath xp=DocumentHelper.createXPath("//test:Symbol");
157 List list=xp.selectNodes(document);
but it did not work, i got the follwing Exception stack trace:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jaxen/JaxenException
at org.dom4j.DocumentFactory.createXPath (DocumentFactory.java:230)
at org.dom4j.DocumentHelper.createXPath (DocumentHelper.java:121)
at Viewer.FSViewer.UpdateFrame(FSViewer.java:156)
at Viewer.FSViewer.access$0(FSViewer.java:133)
at Viewer.FSViewer$1.actionPerformed (FSViewer.java:76)can somebody help me?
Thanks in advance