AW: [jdom-interest] problem with a slash in xpath dir

Philipp Berner mailinglist at
Thu Nov 13 05:40:50 PST 2003

I\'m also using JDOM b-9.

The Xpath path work under a tool called \"xmlspy\". But it don\'t work with JDOMs Xpath. I\'m using Sun Java 1.3.

The jaxen version is 1.10.

The source:

xpathString = \"/AAB/germany[node()=\\\'munich/berlin\\\']\";
/*copy the element from new doc to result doc.*/

	Element copy = (Element)XPath.selectSingleNode(newDocument,xpathString);
	Element target = (Element)XPath.selectSingleNode(resultDocument, xpathTargetString);
	copy = (Element)copy.clone();
catch (JDOMException e)
	System.out.println(\"error: XPath failed to select Node. Node: \" + xpathString);

The XML file looks like:


-----Ursprüngliche Nachricht-----
Von: Per Norrman [mailto:pernorrman at] 
Gesendet: Donnerstag, 13. November 2003 11:47
An: \'Philipp Berner\'; jdom-interest at
Betreff: SV: [jdom-interest] problem with a slash in xpath dir


this works for me using JDOM b-9 and the supporting
jaxen-* libraries. Can you provide more details?


> -----Ursprungligt meddelande-----
> Från: jdom-interest-admin at 
> [mailto:jdom-interest-admin at] För Philipp Berner
> Skickat: den 13 november 2003 09:39
> Till: jdom-interest at
> Ämne: [jdom-interest] problem with a slash in xpath dir
> Hello,
> I have a problem with xpath path.
> I can’t get a node with xpath from a jdom document, when 
> there is a slash in the node text. For example:
> error: XPath failed to select Node. Node: 
> /AAB/germany[node()=\\\'munich/berlin\\\']
> The problem is the slash between \\\"munich/berlin\\\".
> Does someone have a idea, how i can fix this problem?
> Thanks a lot.
> Philipp
> _______________________________________________
> To control your jdom-interest membership: 
uraddr at

More information about the jdom-interest mailing list