• 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

blank lines after calling removeChild(Node)

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I use node.removeChild(Node) to modify XML and then write it to disk using javax.xml.transform.Transformer, I end up with blank lines where the nodes were deleted. Is there any way to keep the blank lines from bring printed?

For example, the XML may look like this:



If I use the apache classes XMLSerializer and OutputFormat, the blank lines aren't printed. But I'd like to find a way to use the JDK classes (javax.xml.transform.Transformer, etc.)

I'm writing the XML as follows:



Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic