Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Removing whitespace from deleted items in XML::LibXML

by tobyink (Canon)
on Dec 08, 2011 at 23:25 UTC ( [id://942519]=note: print w/replies, xml ) Need Help??


in reply to Removing whitespace from deleted items in XML::LibXML

As others have said, a blank line is not being inserted. Your data is:

ELEMENT LINEFEED ELEMENT LINEFEED ELEMENT

and you're removing the middle element, leaving just:

ELEMENT LINEFEED LINEFEED ELEMENT

The two linefeeds in a row give you an empty line.

If whitespace is not considered meaningful in your XML format, you could simply choose to ignore the issue. But if getting the whitespace right is important to you, then you could take a look at my XML prettyprinting module, XML::LibXML::PrettyPrint.

  • Comment on Re: Removing whitespace from deleted items in XML::LibXML

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://942519]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found