Hello,
I'm saving an onbject to a xml file using JDOM but the problem I have is that I would like to save also the leading/trailing characters of an attribute. My code is
String myString = " Hello ";
Element myElement = new Element("param").setAttribute("name", "myExample").setText();
this will be saved into the xml as
..
<param name="myExample">Hello</param>
..
but I would like to preserve the spaces:
..
<param name="myExample"> Hello </param>
..
am I supposed to escape them by hand before setting the text to the Element with e.g :
String myString = " Hello ";
myString = myString.replaceAll(" ", "#x20");
?
Thanks,
regards,
Tex