I have an XML where the contents in the elements have carriage return characters which I want to ignore while parsing. I'm parsing the XML using SAX and the carriage return characters are obtained as is whenIi take that as a string in java.
I do not have a XSD/DTD to validate the XML but I still want to remove/ignore these characters. Any pointers will be helpful.
So, to sum it up and remove all the loosely-related background information: you have a String in Java and you want to remove the carriage-return characters from it? (No, there's no XML option for removing carriage-return characters via the parser.)
I will move this to the Java in General (Intermediate) forum. If you realize you already know the answer to my summed-up version of your question then you can go over there and post that.
Satish Kandagadla
Greenhorn
Joined: Jul 03, 2006
Posts: 27
posted
0
Originally posted by Paul Clapham: So, to sum it up and remove all the loosely-related background information: you have a String in Java and you want to remove the carriage-return characters from it? (No, there's no XML option for removing carriage-return characters via the parser.)
I will move this to the Java in General (Intermediate) forum. If you realize you already know the answer to my summed-up version of your question then you can go over there and post that.
If it is in java I could replace the carriage return character with an empty space using the replace method of the String class. I wanted to check if there is any parser option to do that but as per your mail we do not.