I am having a tough time inserting ascii values in to xml text content
i search for a regular space and try insert a non breaking space in my xml whic is basically �
Infact I want to insert the ascii value of a non breaking space or for that matter ascii value of any character, I am using dom level 2.
in the code the actual replace ment string is the ascii code, somehow when I click preview, it actually shows the space instead showing the what I have in my actual code, so i had to separate in the ascii and ; in my code snippet that follows
String text = nl.item(i).getNodeValue();
System.out.println(text);
String newText = text.replaceAll("\\s", "� followed by a ;");
nl.item(i).setNodeValue(newText)
it actually inserts
 
in the xml code for the xml document and literally "  followed by ;" appears in my document when viewed from a browser, all I am trying to do is replace a given character with an ascii value using dom. All i tried to do was replace a regular space with a non breaking space.
  won't work either, infact i tried ascii values for other characters too, i end up having the ascii value in the tag when i view the finished document in a browser.
Please help
Edited by: jaks4u on Mar 22, 2008 2:23 PM