The original problem was that I was dynamically building XPath strings that contained quotes and/or apostrophes. It looks like there is no way with XPath to substitute entities into the string to make the statement work. In other words, if you need to execute:
myNode.valueOf("/root/child[value='this will 'certainly "break" badly']");
Since the search string contains both quotes and an apostrophe and there is no way to escape either of them- it is game over isn't it?
Secondly, while researching this, I noticed that my instance documents that I write from my app with XMLWriter contain chars that I thought were being escaped but aren't. After reading about it, it sounds like dom4j provides no mechanism (not even a static encode method) for encoding strings with the correct entities for problematic chars, namely < > " and ' . Is this true? Oddly, my instance docs aren't sent to external systems, they are just re-parsed by dom4j, and dom4j doesn't seem to care if I have
<someElement>this < doesn't "break" at all</someElement>. But still for good practice I think I should wrap all these in CDATA or escape them myself, going forward- wouldn't you think?
Thanks Brian
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user