Re: [xml] xmlNewTextChild without parent parameter



Hi!
    Be aware using the last libxml2 version. I've tried the example
below linking against 2.6.7 and, as espected, xmlNewText() has escaped
built-in entities.
    Within xmlNewTextChild()'s guts it uses xmlNewText(). :)


(This is more directed to the original requestor:)

But isn't this escaping happening at output time, and not in the xmlNewText*() calls?

Yep! Both does call xmlStrdup() at content. But, anyway.... when outputing tree, entities should be escaped in both ways.
        Another way is calling xmlEncodeEntitiesReentrant() before
xmlNewText().

--

[]'s
Lucas Brasilino
brasilino recife pe gov br
http://www.recife.pe.gov.br
Emprel -        Empresa Municipal de Informatica (pt_BR)
                Municipal Computing Enterprise (en_US)
Recife - Pernambuco - Brasil
Fone: +55-81-34167078




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