diff --git a/ChangeLog b/ChangeLog index 6012d154..53cc190a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Jul 3 18:17:58 CEST 2005 Daniel Veillard + + * parserInternals.c: fix bug raised by zamez on IRC + * testapi.c: regenerated, seems to pop-up leaks in new tree functions + * tree.c: added comments missing. + * doc/*: regenerated + Sun Jul 3 18:06:55 CEST 2005 Daniel Veillard * testapi.c runsuite.c runtest.c: fixing #307823 and a couple of diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html index 952a0d87..90372af9 100644 --- a/doc/APIchunk18.html +++ b/doc/APIchunk18.html @@ -265,6 +265,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlModuleSymbol
xmlOutputMatchCallback
xmlStructuredErrorFunc
+
moment
xmlDOMWrapReconcileNamespaces
+xmlDOMWrapRemoveNode
month
ftpListCallback
more
XML_MAX_NAMELEN
xmlLoadExternalEntity
diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index e05bdbec..427ca165 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -73,6 +73,8 @@ A:link, A:visited, A:active { text-decoration: underline } ignorableWhitespaceSAXFunc
resolveEntity
resolveEntitySAXFunc
+xmlDOMWrapReconcileNamespaces
+xmlDOMWrapRemoveNode
xmlDocDumpFormatMemoryEnc
xmlDocDumpMemoryEnc
xmlKeepBlanksDefault
diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html index 8e57e468..ea27f238 100644 --- a/doc/APIchunk20.html +++ b/doc/APIchunk20.html @@ -243,6 +243,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlURIUnescapeString
options
htmlCtxtUseOptions
xmlCtxtUseOptions
+xmlDOMWrapRemoveNode
xmlModuleOpen
xmlSaveToFd
xmlSaveToFilename
diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html index ca21a869..e902b291 100644 --- a/doc/APIchunk25.html +++ b/doc/APIchunk25.html @@ -138,6 +138,8 @@ A:link, A:visited, A:active { text-decoration: underline } _xmlSAXHandlerV1
_xmlSchema
_xmlXPathContext
+xmlDOMWrapReconcileNamespaces
+xmlDOMWrapRemoveNode
xmlSchemaValidateFile
xmlShellBase
xmlShellCat
diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html index eb5efae3..48ab9792 100644 --- a/doc/APIchunk26.html +++ b/doc/APIchunk26.html @@ -251,6 +251,8 @@ A:link, A:visited, A:active { text-decoration: underline }
would
_xmlError
htmlAutoCloseTag
xmlTextReaderGetRemainder
+
wrapper
xmlDOMWrapReconcileNamespaces
+xmlDOMWrapRemoveNode
wraps
xmlTextReaderByteConsumed
write
xmlFileRead
xmlFindCharEncodingHandler
diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html index 7c13d80e..b7f90553 100644 --- a/doc/html/libxml-tree.html +++ b/doc/html/libxml-tree.html @@ -681,9 +681,9 @@ A:link, A:visited, A:active { text-decoration: underline }

Allocates and initializes a new DOM-wrapper context.

Returns:the xmlDOMWrapCtxtPtr or NULL in case of an internal errror.

Function: xmlDOMWrapReconcileNamespaces

int	xmlDOMWrapReconcileNamespaces	(xmlDOMWrapCtxtPtr ctxt, 
xmlNodePtr elem,
int options)

Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state.

-
ctxt:
elem:the element-node
options:option flags
Returns:0 if succeeded, -1 otherwise and on API/internal errors.

Function: xmlDOMWrapRemoveNode

int	xmlDOMWrapRemoveNode		(xmlDOMWrapCtxtPtr ctxt, 
xmlDocPtr doc,
xmlNodePtr node,
int options)
+
ctxt:DOM wrapper context, unused at the moment
elem:the element-node
options:option flags
Returns:0 if succeeded, -1 otherwise and on API/internal errors.

Function: xmlDOMWrapRemoveNode

int	xmlDOMWrapRemoveNode		(xmlDOMWrapCtxtPtr ctxt, 
xmlDocPtr doc,
xmlNodePtr node,
int options)

Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. WARNING: This function is in a experimental state.

-
ctxt:
doc:the doc
node:the node to be removed.
options:
Returns:0 on success, 1 if the node is not supported, -1 on API and internal errors.

Function: xmlDocCopyNode

xmlNodePtr	xmlDocCopyNode		(const xmlNodePtr node, 
xmlDocPtr doc,
int extended)
+
ctxt:a DOM wrapper context
doc:the doc
node:the node to be removed.
options:set of options, unused at the moment
Returns:0 on success, 1 if the node is not supported, -1 on API and internal errors.

Function: xmlDocCopyNode

xmlNodePtr	xmlDocCopyNode		(const xmlNodePtr node, 
xmlDocPtr doc,
int extended)

Do a copy of the node to a given document.

node:the node
doc:the document
extended:if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)
Returns:a new #xmlNodePtr, or NULL in case of error.

Function: xmlDocCopyNodeList

xmlNodePtr	xmlDocCopyNodeList	(xmlDocPtr doc, 
const xmlNodePtr node)

Do a recursive copy of the node list.

diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index ccd30508..2314b943 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -8742,17 +8742,17 @@ actually an xmlCharEncoding'/> Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. WARNING: This function is in a experimental state. - + Unlinks the given node from its owner. This will substitute ns-references to node->nsDef for ns-references to doc->oldNs, thus ensuring the removed branch to be autark wrt ns-references. WARNING: This function is in a experimental state. - + - + defined(LIBXML_DEBUG_ENABLED) diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index 4b4d4f2b..2bb941a7 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -14327,6 +14327,8 @@ + + @@ -23829,6 +23831,10 @@ + + + + @@ -24597,6 +24603,7 @@ + @@ -28212,6 +28219,8 @@ + + @@ -28695,6 +28704,10 @@ + + + + diff --git a/parserInternals.c b/parserInternals.c index 0e01deb4..b5e302e1 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -1267,9 +1267,11 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, int xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler) { + int ret = 0; + if (handler != NULL) { if (ctxt->input != NULL) { - xmlSwitchInputEncoding(ctxt, ctxt->input, handler); + ret = xmlSwitchInputEncoding(ctxt, ctxt->input, handler); } else { xmlErrInternal(ctxt, "xmlSwitchToEncoding : no input\n", NULL); @@ -1281,7 +1283,7 @@ xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler) ctxt->charset = XML_CHAR_ENCODING_UTF8; } else return(-1); - return(0); + return(ret); } /************************************************************************ diff --git a/testapi.c b/testapi.c index 90a20f0a..adc80bbf 100644 --- a/testapi.c +++ b/testapi.c @@ -18977,7 +18977,7 @@ test_xmlDOMWrapReconcileNamespaces(void) { int mem_base; int ret_val; - xmlDOMWrapCtxtPtr ctxt; /* */ + xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */ int n_ctxt; xmlNodePtr elem; /* the element-node */ int n_elem; @@ -19023,13 +19023,13 @@ test_xmlDOMWrapRemoveNode(void) { int mem_base; int ret_val; - xmlDOMWrapCtxtPtr ctxt; /* */ + xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */ int n_ctxt; xmlDocPtr doc; /* the doc */ int n_doc; xmlNodePtr node; /* the node to be removed. */ int n_node; - int options; /* */ + int options; /* set of options, unused at the moment */ int n_options; for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { diff --git a/tree.c b/tree.c index 2ea8e7be..a5869a1e 100644 --- a/tree.c +++ b/tree.c @@ -7499,9 +7499,10 @@ xmlDOMWrapNSNormAddNsMapItem2(xmlNsPtr **list, int *size, int *number, /* * xmlDOMWrapRemoveNode: -* +* @ctxt: a DOM wrapper context * @doc: the doc * @node: the node to be removed. +* @options: set of options, unused at the moment * * Unlinks the given node from its owner. * This will substitute ns-references to node->nsDef for @@ -7953,6 +7954,7 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, /* * xmlDOMWrapReconcileNamespaces: +* @ctxt: DOM wrapper context, unused at the moment * @elem: the element-node * @options: option flags *