• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to preserve space when parsing XML with Xalan

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 
 ?
 
reply
    Bookmark Topic Watch Topic
  • New Topic