• 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

blank lines after calling removeChild(Node)

Posts: 9
  • Mark post as helpful
  • send pies
  • 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:

If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic