=?iso-8859-1?Q?Re:_Re:_[xml]_ampersand_conversion?=




I thought that, but I just did a small test and the libxml2 is doing
totally different things in some cases. Look at this:

test-sample "<>\"'&"

xmlNodeSetContent
<test>&lt;&gt;"'</test>

totally drops the ampersand - valid XML

xmlNewNode
<<>"'&/>

did nothing - invalid XML

xmlNewProp (name)
<test <>"'&="test"/>

did nothing - invalid XML

xmlNewProp (value)
<test test="&lt;&gt;&quot;'&amp;"/>

encoded everything properly, that could cause problems - valid XML

IMO the last case is what should happen in all the four cases, because
it avoids all the problems, has all the data and is valid XML.
I haven't tested all the other things I never use like xmlNewNs etc.,
but maybe the behavior differs even more.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]