Re: [xml] xmlEncodeEntitiesReentrant with no "doc" parameter

Sorry, I misinterpreted the purpose of this function.  What I need is  a function to decode entitities.  Is there such a function?





From: Tony Baldarelli [mailto:tbaldarelli wmsvision com]
Sent: Monday, April 12, 2010 12:33 PM
To: 'xml gnome org'
Subject: xmlEncodeEntitiesReentrant with no "doc" parameter


Is it legal, from an API perspective, to pass “NULL” to xmlEncodeEntitiesReentrant?  Looking at the code, passing NULL as the “doc” parameter will not cause adverse affect.  What I want to confirm is that, long term, the doc parameter is optional.  Thanks.
Here is the documentation in question:

Function: xmlEncodeEntitiesReentrant

xmlChar *      xmlEncodeEntitiesReentrant     (xmlDocPtr doc, 

                                               const xmlChar * input)


Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated.


the document containing the string


A string to convert to XML.


A newly allocated string with the substitution done.

The code for version 2.6.26 always checks for NULL, and avoids doing some things ( but not all things ) if it is NULL.  This is perfect, and what I want.  I just want to make sure it is by design.



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