[xml] Input parameters of xmlEncodeSpecialChars


A simple question. The documentation says this about the function xmlEncodeSpecialChars:

xmlChar *       xmlEncodeSpecialChars   (xmlDocPtr doc, 
                                         const xmlChar * input)

Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result 
must be deallocated.
doc:    the document containing the string
input:  A string to convert to XML.
Returns:        A newly allocated string with the substitution done.

Looking at the code (2.6.24), the first parameter (xmlDocPtr doc) is not used and is declared as follows 

Is it safe to pass a NULL as the xmlDocPtr? I mean, looking at the code, there´s no problem, but as the 
documentation does not say anything about passing a NULL, could this behavior change in the next versions?



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