You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by CANDAT Jerome <je...@c-s.fr> on 2003/11/03 18:17:51 UTC
[JXPath] Problem while removing nodes
Hello everyone,
I'm trying to remove nodes from my XML file using JXPath.
I'm doing the following :
context.getVariables().declareVariable("sourcePath", sourcePath); // sourcePath being a string and correspond to an attribute in my XML
context.removePath("//project[@sourcePath=$sourcePath]");
If I replace the $sourcePath string by 'D:/TEST/' for example it works... But if sourcePath is "D:/TEST" it doesn't work...
I get the following error :
org.apache.commons.jxpath.JXPathException: Exception trying to remove xpath file://project[@sourcePath=$popol]; Cannot remove an object that is not some other object's property or a collection element.
Has anyone an idea?
Thanks in advance,
Jérôme.