Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Carriage Return and Space problem in JDOM

 
lalitha prasad
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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,
LALITH
 
Joe Urbanek
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to XML forum...
 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the String class:

replaceAll() - Search for something and replace it
trim() - Trim whitespace
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.?
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic