[xmlsec] Whitespace problem while encrypting
Stefan Schulze Frielinghaus
stefan at seekline.net
Wed Mar 26 23:35:19 PST 2008
On Wed, 2008-03-26 at 16:08 -0700, Aleksey Sanin wrote:
> > Both files have the same meaning in XML language ...
>
> WRONG. Whitespaces *are* important in XML. Read the spec.
>
> Aleksey
But not for the content of an element! If I write an XML file like:
<Root>
<Node>blub</Node>
</Root>
or
<Root><Node>blub</Node></Root>
The content of "Node" has to be the same. Doesn't matter for which XML
file. What XMLsec does is just adding whitespace for indenting to the
contents element which is _not_ OK.
If you run my example application to demonstrate this problem you will
realize that when you change "xmlIndentTreeOutput = 1;" to
"xmlIndentTreeOutput = 0;" the indention does change and especially the
content of "Node" does too (it will change from " \ncontentOfNOde\n
" to "\ncontentOfNode\n").
Libxml2 does it right. Just check it.
More information about the xmlsec
mailing list