• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to preserve space when parsing XML with Xalan

 
Joe Simone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have XML that looks like

and I would like to preserve the new-line characters. But when I parse, the text all wraps together and the newlines are lost. What can I do?

Here is the parsing code:


Many thanks for any insight.
Joe
 
Joe Simone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops, the newlines did not show on the post. Each line of the query tag ends with (and pound x d semicolon).

So the XML does have newlines in it.
 
Paul Clapham
Sheriff
Posts: 21152
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, 
 is a carriage-return character. The new-line character is 
. Check out section 2.11 of the XML Recommendation to see what is happening.
 
Joe Simone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.

I added the following code to the createDocumentFromString method


and now I only have 
 where the 
 used to be but the results
are the same. Xalan is losing the fact that newlines are specified. How can I get Xalan to respect the 
 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic