aspose file tools
The moose likes Java in General and the fly likes carriage return characters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "carriage return characters" Watch "carriage return characters" New topic
Author

carriage return characters

Satish Kandagadla
Greenhorn

Joined: Jul 03, 2006
Posts: 27
Hi All,

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.

Thanks,
Satish
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

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
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.

That answers my question. Thanks Paul.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: carriage return characters
 
Similar Threads
Unescaped Ampersand
How to remove carriage return and linefeeds from XML files
Help with XMLConfiguration
Line feed / Carraige return
Counting newline characters in BufferedReader...