my dog learned polymorphism
The moose likes XML and Related Technologies and the fly likes Carriage Return and Space problem in JDOM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Carriage Return and Space problem in JDOM " Watch "Carriage Return and Space problem in JDOM " New topic

Carriage Return and Space problem in JDOM

lalitha prasad

Joined: Aug 28, 2004
Posts: 16

I have one big Form in JSP with Big <TextArea> element. User is trying to insert more paragraph.

But I need to compare the data between the request parameter value and XML content value for this element.

Please help how to handle carriage return and space problems in JDOM.

Thanks in Advance,
Joe Urbanek

Joined: Jan 31, 2005
Posts: 15
Can you be you be more specific an detail what you are trying to do. If you are trying to filter the textarea text, regular expressions would be the way to go.
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
Moving to XML forum...

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
In the String class:

replaceAll() - Search for something and replace it
trim() - Trim whitespace
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I'm with Joe on the use of regex expressions to modify text for XML - but it does get realllllly complicated. The first big question is - are you holding the text in a CDATA section or a plain element content? Second big question - is that text going to contain any characters special to XML - HTML tags, & etc.?
I agree. Here's the link:
subject: Carriage Return and Space problem in JDOM
It's not a secret anymore!