[jdom-interest] Element.getAttributeValue() escapes backslashes

benjamin van der veen bvanderveen at gmail.com
Mon Aug 21 13:36:04 PDT 2006


Hello,

I'm using JDOM to parse an element whose attributes contain backslashes.

It is essentially of this form:

xml document:
---
<my-document>
<my-element anAttribute="some text \ some text"/>
</my-document>
---


When I use JDOM to retrieve the value of 'anAttribute," the output is:

some text \\ some text

JDOM is doubling-up on the backslashes. I can't find this behaviour
documented or observed anywhere on Google or this list.

I have to admit that my code is way more complex than this example,
and in fact this example works fine for me (backslashes are not
escaped). I'm just wondering if anyone has seen this problem before or
could give me a clue as to what might be happening before I start
tearing apart several hundred lines of code...

Thanks,
benjamin van der veen


More information about the jdom-interest mailing list