• 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

Dom4j new lines

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

Is it possible to add a new line after each attribute of a node with dom4j, just to get the attributes one under another in my xml source?

Regards,
Cristian.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Cristian. It seems that Dom4j does not handle new lines after every attribute. But it does handle formatted output.


refer org.dom4j.io.OutputFormat
for the more detailed information about formatting possibilities the Dom4j provide.
To reach the thing You need, it might be helpful to reload some methods in
org.dom4j.io.XMLWriter

Or the other way to solve the problem - is to output the XML content into string buffer and then add some format refinements using regular expressions.
[ February 28, 2008: Message edited by: Pavel Cherkashin ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic