[libxml-devel] Strange node being created from white space

Charlie Savage cfis at savagexi.com
Sun Feb 1 23:40:26 EST 2009


> I am experiencing some problems when constructing a document piece by 
> piece. I have boiled downed the problem to the following code:
> 
> require 'rubygems'
> require 'xml/libxml'
> 
> # Envelope XML
> xml_string = %{<?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
>    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> </soapenv:Envelope>}
> 
> # Create Document
> parser = XML::Parser.string(xml_string, :options => 
> XML::Parser::Options::NOBLANKS)

What happens if you first call XML.default_keep_blanks = false?  Should 
do the same thing as the parser option, but worth a quick double check.

And also, take a look at this message from the libxml creator.  He 
strongly discourages the use of NOBLANKS.

http://mail.gnome.org/archives/xml/2007-November/msg00022.html

Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://rubyforge.org/pipermail/libxml-devel/attachments/20090201/3c63c46c/attachment.bin>


More information about the libxml-devel mailing list