• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to preserve space when parsing XML with Xalan

 
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.
 
Marshal
Posts: 24594
55
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
Boost this thread!