mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
added checking for names values and dictionnaries generates a tons of
* debugXML.c include/libxml/xmlerror.h: added checking for names values and dictionnaries generates a tons of errors * SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c include/libxml/tree.h: fixing the errors in the regression tests Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Tue Oct 26 18:09:59 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* debugXML.c include/libxml/xmlerror.h: added checking for names
|
||||||
|
values and dictionnaries generates a tons of errors
|
||||||
|
* SAX2.ccatalog.c parser.c relaxng.c tree.c xinclude.c xmlwriter.c
|
||||||
|
include/libxml/tree.h: fixing the errors in the regression tests
|
||||||
|
|
||||||
Mon Oct 25 16:04:22 PDT 2004 William Brack <wbrack@mmm.com.hk>
|
Mon Oct 25 16:04:22 PDT 2004 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
* parser.c: modified the handling of _private for entity
|
* parser.c: modified the handling of _private for entity
|
||||||
|
@ -277,7 +277,7 @@ NStests : xmllint$(EXEEXT)
|
|||||||
log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
|
log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \
|
||||||
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
|
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
|
||||||
diff $(srcdir)/result/namespaces/$$name result.$$name ; \
|
diff $(srcdir)/result/namespaces/$$name result.$$name ; \
|
||||||
diff $(srcdir)/result/namespaces/$$name.err error.$$name` ; \
|
diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \
|
||||||
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
|
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
|
||||||
rm result.$$name error.$$name ; \
|
rm result.$$name error.$$name ; \
|
||||||
fi ; fi ; done)
|
fi ; fi ; done)
|
||||||
|
2
SAX2.c
2
SAX2.c
@ -2364,7 +2364,7 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
|
|||||||
"SAX.xmlSAX2ProcessingInstruction(%s, %s)\n", target, data);
|
"SAX.xmlSAX2ProcessingInstruction(%s, %s)\n", target, data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = xmlNewPI(target, data);
|
ret = xmlNewDocPI(ctxt->myDoc, target, data);
|
||||||
if (ret == NULL) return;
|
if (ret == NULL) return;
|
||||||
parent = ctxt->node;
|
parent = ctxt->node;
|
||||||
|
|
||||||
|
@ -912,6 +912,7 @@ xmlParseCatalogFile(const char *filename) {
|
|||||||
ctxt->validate = 0;
|
ctxt->validate = 0;
|
||||||
ctxt->loadsubset = 0;
|
ctxt->loadsubset = 0;
|
||||||
ctxt->pedantic = 0;
|
ctxt->pedantic = 0;
|
||||||
|
ctxt->dictNames = 1;
|
||||||
|
|
||||||
xmlParseDocument(ctxt);
|
xmlParseDocument(ctxt);
|
||||||
|
|
||||||
|
112
debugXML.c
112
debugXML.c
@ -42,8 +42,10 @@ struct _xmlDebugCtxt {
|
|||||||
int depth; /* current depth */
|
int depth; /* current depth */
|
||||||
xmlDocPtr doc; /* current document */
|
xmlDocPtr doc; /* current document */
|
||||||
xmlNodePtr node; /* current node */
|
xmlNodePtr node; /* current node */
|
||||||
|
xmlDictPtr dict; /* the doc dictionnary */
|
||||||
int check; /* do just checkings */
|
int check; /* do just checkings */
|
||||||
int errors; /* number of errors found */
|
int errors; /* number of errors found */
|
||||||
|
int nodict; /* if the document has no dictionnary */
|
||||||
};
|
};
|
||||||
|
|
||||||
static void xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node);
|
static void xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node);
|
||||||
@ -57,6 +59,9 @@ xmlCtxtDumpInitCtxt(xmlDebugCtxtPtr ctxt)
|
|||||||
ctxt->check = 0;
|
ctxt->check = 0;
|
||||||
ctxt->errors = 0;
|
ctxt->errors = 0;
|
||||||
ctxt->output = stdout;
|
ctxt->output = stdout;
|
||||||
|
ctxt->doc = NULL;
|
||||||
|
ctxt->node = NULL;
|
||||||
|
ctxt->dict = NULL;
|
||||||
for (i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
ctxt->shift[i] = ' ';
|
ctxt->shift[i] = ' ';
|
||||||
ctxt->shift[100] = 0;
|
ctxt->shift[100] = 0;
|
||||||
@ -222,20 +227,69 @@ xmlCtxtCheckString(xmlDebugCtxtPtr ctxt, const xmlChar * str)
|
|||||||
if (str == NULL) return;
|
if (str == NULL) return;
|
||||||
if (ctxt->check) {
|
if (ctxt->check) {
|
||||||
if (!xmlCheckUTF8(str)) {
|
if (!xmlCheckUTF8(str)) {
|
||||||
xmlDebugErr3(ctxt, XML_CHECK_NOT_DTD,
|
xmlDebugErr3(ctxt, XML_CHECK_NOT_UTF8,
|
||||||
"String is not UTF-8 %s", (const char *) str);
|
"String is not UTF-8 %s", (const char *) str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlCtxtCheckName:
|
||||||
|
* @ctxt: the debug context
|
||||||
|
* @name: the name
|
||||||
|
*
|
||||||
|
* Do debugging on the name, for example the dictionnary status and
|
||||||
|
* conformance to the Name production.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
xmlCtxtCheckName(xmlDebugCtxtPtr ctxt, const xmlChar * name)
|
||||||
|
{
|
||||||
|
if (ctxt->check) {
|
||||||
|
if (name == NULL) {
|
||||||
|
xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (xmlValidateName(name, 0)) {
|
||||||
|
xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME,
|
||||||
|
"Name is not an NCName '%s'", (const char *) name);
|
||||||
|
}
|
||||||
|
if ((ctxt->dict != NULL) &&
|
||||||
|
(!xmlDictOwns(ctxt->dict, name))) {
|
||||||
|
xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT,
|
||||||
|
"Name is not from the document dictionnary '%s'",
|
||||||
|
(const char *) name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) {
|
xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) {
|
||||||
|
xmlDocPtr doc;
|
||||||
|
xmlDictPtr dict;
|
||||||
|
|
||||||
|
doc = node->doc;
|
||||||
|
|
||||||
if (node->parent == NULL)
|
if (node->parent == NULL)
|
||||||
xmlDebugErr(ctxt, XML_CHECK_NO_PARENT,
|
xmlDebugErr(ctxt, XML_CHECK_NO_PARENT,
|
||||||
"Node has no parent\n");
|
"Node has no parent\n");
|
||||||
if (node->doc == NULL)
|
if (node->doc == NULL) {
|
||||||
xmlDebugErr(ctxt, XML_CHECK_NO_DOC,
|
xmlDebugErr(ctxt, XML_CHECK_NO_DOC,
|
||||||
"Node has no doc\n");
|
"Node has no doc\n");
|
||||||
|
dict = NULL;
|
||||||
|
} else {
|
||||||
|
dict = doc->dict;
|
||||||
|
if ((dict == NULL) && (ctxt->nodict == 0)) {
|
||||||
|
xmlDebugErr(ctxt, XML_CHECK_NO_DICT,
|
||||||
|
"Document has no dictionnary\n");
|
||||||
|
ctxt->nodict = 1;
|
||||||
|
}
|
||||||
|
if (ctxt->doc == NULL)
|
||||||
|
ctxt->doc = doc;
|
||||||
|
|
||||||
|
if (ctxt->dict == NULL) {
|
||||||
|
ctxt->dict = dict;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ((node->parent != NULL) && (node->doc != node->parent->doc) &&
|
if ((node->parent != NULL) && (node->doc != node->parent->doc) &&
|
||||||
(!xmlStrEqual(node->name, BAD_CAST "pseudoroot")))
|
(!xmlStrEqual(node->name, BAD_CAST "pseudoroot")))
|
||||||
xmlDebugErr(ctxt, XML_CHECK_WRONG_DOC,
|
xmlDebugErr(ctxt, XML_CHECK_WRONG_DOC,
|
||||||
@ -292,6 +346,60 @@ xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) {
|
|||||||
if (node->content != NULL)
|
if (node->content != NULL)
|
||||||
xmlCtxtCheckString(ctxt, (const xmlChar *) node->content);
|
xmlCtxtCheckString(ctxt, (const xmlChar *) node->content);
|
||||||
}
|
}
|
||||||
|
switch (node->type) {
|
||||||
|
case XML_ELEMENT_NODE:
|
||||||
|
case XML_ATTRIBUTE_NODE:
|
||||||
|
xmlCtxtCheckName(ctxt, node->name);
|
||||||
|
break;
|
||||||
|
case XML_TEXT_NODE:
|
||||||
|
if ((node->name == xmlStringText) ||
|
||||||
|
(node->name == xmlStringTextNoenc))
|
||||||
|
break;
|
||||||
|
/* some case of entity substitution can lead to this */
|
||||||
|
if ((ctxt->dict != NULL) &&
|
||||||
|
(node->name == xmlDictLookup(ctxt->dict, "nbktext", 7)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
xmlDebugErr3(ctxt, XML_CHECK_WRONG_NAME,
|
||||||
|
"Text node has wrong name '%s'",
|
||||||
|
(const char *) node->name);
|
||||||
|
break;
|
||||||
|
case XML_COMMENT_NODE:
|
||||||
|
if (node->name == xmlStringComment)
|
||||||
|
break;
|
||||||
|
xmlDebugErr3(ctxt, XML_CHECK_WRONG_NAME,
|
||||||
|
"Comment node has wrong name '%s'",
|
||||||
|
(const char *) node->name);
|
||||||
|
break;
|
||||||
|
case XML_PI_NODE:
|
||||||
|
xmlCtxtCheckName(ctxt, node->name);
|
||||||
|
break;
|
||||||
|
case XML_CDATA_SECTION_NODE:
|
||||||
|
if (node->name == NULL)
|
||||||
|
break;
|
||||||
|
xmlDebugErr3(ctxt, XML_CHECK_NAME_NOT_NULL,
|
||||||
|
"CData section has non NULL name '%s'",
|
||||||
|
(const char *) node->name);
|
||||||
|
break;
|
||||||
|
case XML_ENTITY_REF_NODE:
|
||||||
|
case XML_ENTITY_NODE:
|
||||||
|
case XML_DOCUMENT_TYPE_NODE:
|
||||||
|
case XML_DOCUMENT_FRAG_NODE:
|
||||||
|
case XML_NOTATION_NODE:
|
||||||
|
case XML_DTD_NODE:
|
||||||
|
case XML_ELEMENT_DECL:
|
||||||
|
case XML_ATTRIBUTE_DECL:
|
||||||
|
case XML_ENTITY_DECL:
|
||||||
|
case XML_NAMESPACE_DECL:
|
||||||
|
case XML_XINCLUDE_START:
|
||||||
|
case XML_XINCLUDE_END:
|
||||||
|
#ifdef LIBXML_DOCB_ENABLED
|
||||||
|
case XML_DOCB_DOCUMENT_NODE:
|
||||||
|
#endif
|
||||||
|
case XML_DOCUMENT_NODE:
|
||||||
|
case XML_HTML_DOCUMENT_NODE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -15,7 +15,7 @@ install-data-local:
|
|||||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
||||||
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
|
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
|
||||||
|
|
||||||
EXTRA_DIST=examples.xsl index.py test1.xml examples.xml test2.xml writer.xml test3.xml tst.xml reader1.res reader3.res tree1.res tree2.res io1.res io2.res xpath1.res xpath2.res
|
EXTRA_DIST=examples.xsl index.py test1.xml examples.xml test2.xml writer.xml test3.xml tst.xml reader1.res reader3.res tree1.res tree2.res io1.res io2.res xpath1.res xpath2.res reader4.res
|
||||||
|
|
||||||
noinst_PROGRAMS=xpath1 parse1 parse2 tree1 tree2 testWriter reader1 reader2 reader3 io1 parse3 parse4 io2 xpath2 reader4
|
noinst_PROGRAMS=xpath1 parse1 parse2 tree1 tree2 testWriter reader1 reader2 reader3 io1 parse3 parse4 io2 xpath2 reader4
|
||||||
|
|
||||||
|
@ -723,6 +723,10 @@ XMLPUBFUN xmlNodePtr XMLCALL
|
|||||||
const xmlChar *content);
|
const xmlChar *content);
|
||||||
XMLPUBFUN xmlNodePtr XMLCALL
|
XMLPUBFUN xmlNodePtr XMLCALL
|
||||||
xmlNewText (const xmlChar *content);
|
xmlNewText (const xmlChar *content);
|
||||||
|
XMLPUBFUN xmlNodePtr XMLCALL
|
||||||
|
xmlNewDocPI (xmlDocPtr doc,
|
||||||
|
const xmlChar *name,
|
||||||
|
const xmlChar *content);
|
||||||
XMLPUBFUN xmlNodePtr XMLCALL
|
XMLPUBFUN xmlNodePtr XMLCALL
|
||||||
xmlNewPI (const xmlChar *name,
|
xmlNewPI (const xmlChar *name,
|
||||||
const xmlChar *content);
|
const xmlChar *content);
|
||||||
@ -755,6 +759,9 @@ XMLPUBFUN xmlNodePtr XMLCALL
|
|||||||
xmlDocCopyNode (const xmlNodePtr node,
|
xmlDocCopyNode (const xmlNodePtr node,
|
||||||
xmlDocPtr doc,
|
xmlDocPtr doc,
|
||||||
int recursive);
|
int recursive);
|
||||||
|
XMLPUBFUN xmlNodePtr XMLCALL
|
||||||
|
xmlDocCopyNodeList (xmlDocPtr doc,
|
||||||
|
const xmlNodePtr node);
|
||||||
XMLPUBFUN xmlNodePtr XMLCALL
|
XMLPUBFUN xmlNodePtr XMLCALL
|
||||||
xmlCopyNodeList (const xmlNodePtr node);
|
xmlCopyNodeList (const xmlNodePtr node);
|
||||||
#ifdef LIBXML_TREE_ENABLED
|
#ifdef LIBXML_TREE_ENABLED
|
||||||
|
@ -777,7 +777,12 @@ typedef enum {
|
|||||||
XML_CHECK_WRONG_PARENT,/* 5029 */
|
XML_CHECK_WRONG_PARENT,/* 5029 */
|
||||||
XML_CHECK_NS_SCOPE, /* 5030 */
|
XML_CHECK_NS_SCOPE, /* 5030 */
|
||||||
XML_CHECK_NS_ANCESTOR, /* 5031 */
|
XML_CHECK_NS_ANCESTOR, /* 5031 */
|
||||||
XML_CHECK_NOT_UTF8 /* 5032 */
|
XML_CHECK_NOT_UTF8, /* 5032 */
|
||||||
|
XML_CHECK_NO_DICT, /* 5033 */
|
||||||
|
XML_CHECK_NOT_NCNAME, /* 5034 */
|
||||||
|
XML_CHECK_OUTSIDE_DICT, /* 5035 */
|
||||||
|
XML_CHECK_WRONG_NAME, /* 5036 */
|
||||||
|
XML_CHECK_NAME_NOT_NULL /* 5037 */
|
||||||
#if 0
|
#if 0
|
||||||
XML_CHECK_, /* 5033 */
|
XML_CHECK_, /* 5033 */
|
||||||
XML_CHECK_X /* 503 */
|
XML_CHECK_X /* 503 */
|
||||||
|
24
parser.c
24
parser.c
@ -5643,7 +5643,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
|||||||
|
|
||||||
cur = ent->children;
|
cur = ent->children;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
nw = xmlCopyNode(cur, 1);
|
nw = xmlDocCopyNode(cur, ctxt->myDoc, 1);
|
||||||
if (nw != NULL) {
|
if (nw != NULL) {
|
||||||
if (nw->_private == NULL)
|
if (nw->_private == NULL)
|
||||||
nw->_private = cur->_private;
|
nw->_private = cur->_private;
|
||||||
@ -5687,7 +5687,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
|||||||
next = cur->next;
|
next = cur->next;
|
||||||
cur->next = NULL;
|
cur->next = NULL;
|
||||||
cur->parent = NULL;
|
cur->parent = NULL;
|
||||||
nw = xmlCopyNode(cur, 1);
|
nw = xmlDocCopyNode(cur, ctxt->myDoc, 1);
|
||||||
if (nw != NULL) {
|
if (nw != NULL) {
|
||||||
if (nw->_private == NULL)
|
if (nw->_private == NULL)
|
||||||
nw->_private = cur->_private;
|
nw->_private = cur->_private;
|
||||||
@ -9937,6 +9937,7 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
|
|||||||
xmlFreeParserInputBuffer(buf);
|
xmlFreeParserInputBuffer(buf);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
ctxt->dictNames = 1;
|
||||||
ctxt->pushTab = (void **) xmlMalloc(ctxt->nameMax * 3 * sizeof(xmlChar *));
|
ctxt->pushTab = (void **) xmlMalloc(ctxt->nameMax * 3 * sizeof(xmlChar *));
|
||||||
if (ctxt->pushTab == NULL) {
|
if (ctxt->pushTab == NULL) {
|
||||||
xmlErrMemory(ctxt, NULL);
|
xmlErrMemory(ctxt, NULL);
|
||||||
@ -10385,6 +10386,10 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
|
|||||||
xmlFreeParserCtxt(ctxt);
|
xmlFreeParserCtxt(ctxt);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
if (ctx->myDoc->dict) {
|
||||||
|
newDoc->dict = ctx->myDoc->dict;
|
||||||
|
xmlDictReference(newDoc->dict);
|
||||||
|
}
|
||||||
if (ctx->myDoc != NULL) {
|
if (ctx->myDoc != NULL) {
|
||||||
newDoc->intSubset = ctx->myDoc->intSubset;
|
newDoc->intSubset = ctx->myDoc->intSubset;
|
||||||
newDoc->extSubset = ctx->myDoc->extSubset;
|
newDoc->extSubset = ctx->myDoc->extSubset;
|
||||||
@ -10596,7 +10601,12 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
|
|||||||
if (doc != NULL) {
|
if (doc != NULL) {
|
||||||
newDoc->intSubset = doc->intSubset;
|
newDoc->intSubset = doc->intSubset;
|
||||||
newDoc->extSubset = doc->extSubset;
|
newDoc->extSubset = doc->extSubset;
|
||||||
|
newDoc->dict = doc->dict;
|
||||||
|
} else if (oldctxt != NULL) {
|
||||||
|
newDoc->dict = oldctxt->dict;
|
||||||
}
|
}
|
||||||
|
xmlDictReference(newDoc->dict);
|
||||||
|
|
||||||
if (doc->URL != NULL) {
|
if (doc->URL != NULL) {
|
||||||
newDoc->URL = xmlStrdup(doc->URL);
|
newDoc->URL = xmlStrdup(doc->URL);
|
||||||
}
|
}
|
||||||
@ -10827,6 +10837,8 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
|
|||||||
xmlFreeParserCtxt(ctxt);
|
xmlFreeParserCtxt(ctxt);
|
||||||
return(XML_ERR_INTERNAL_ERROR);
|
return(XML_ERR_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
|
newDoc->dict = ctxt->dict;
|
||||||
|
xmlDictReference(newDoc->dict);
|
||||||
ctxt->myDoc = newDoc;
|
ctxt->myDoc = newDoc;
|
||||||
} else {
|
} else {
|
||||||
ctxt->myDoc = oldctxt->myDoc;
|
ctxt->myDoc = oldctxt->myDoc;
|
||||||
@ -10838,8 +10850,9 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
|
|||||||
ctxt->sax = oldsax;
|
ctxt->sax = oldsax;
|
||||||
ctxt->dict = NULL;
|
ctxt->dict = NULL;
|
||||||
xmlFreeParserCtxt(ctxt);
|
xmlFreeParserCtxt(ctxt);
|
||||||
if (newDoc != NULL)
|
if (newDoc != NULL) {
|
||||||
xmlFreeDoc(newDoc);
|
xmlFreeDoc(newDoc);
|
||||||
|
}
|
||||||
return(XML_ERR_INTERNAL_ERROR);
|
return(XML_ERR_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
ctxt->myDoc->children = NULL;
|
ctxt->myDoc->children = NULL;
|
||||||
@ -10913,8 +10926,9 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
|
|||||||
ctxt->attsDefault = NULL;
|
ctxt->attsDefault = NULL;
|
||||||
ctxt->attsSpecial = NULL;
|
ctxt->attsSpecial = NULL;
|
||||||
xmlFreeParserCtxt(ctxt);
|
xmlFreeParserCtxt(ctxt);
|
||||||
if (newDoc != NULL)
|
if (newDoc != NULL) {
|
||||||
xmlFreeDoc(newDoc);
|
xmlFreeDoc(newDoc);
|
||||||
|
}
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
@ -11179,6 +11193,8 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
|
|||||||
xmlFreeParserCtxt(ctxt);
|
xmlFreeParserCtxt(ctxt);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
newDoc->dict = ctxt->dict;
|
||||||
|
xmlDictReference(newDoc->dict);
|
||||||
if (doc != NULL) {
|
if (doc != NULL) {
|
||||||
newDoc->intSubset = doc->intSubset;
|
newDoc->intSubset = doc->intSubset;
|
||||||
newDoc->extSubset = doc->extSubset;
|
newDoc->extSubset = doc->extSubset;
|
||||||
|
@ -647,6 +647,56 @@ Class xmlDoc(xmlNode)
|
|||||||
|
|
||||||
# functions from module xpointer
|
# functions from module xpointer
|
||||||
xpointerNewContext()
|
xpointerNewContext()
|
||||||
|
Class xpathContext()
|
||||||
|
# accessors
|
||||||
|
contextDoc()
|
||||||
|
contextNode()
|
||||||
|
contextPosition()
|
||||||
|
contextSize()
|
||||||
|
function()
|
||||||
|
functionURI()
|
||||||
|
setContextDoc()
|
||||||
|
setContextNode()
|
||||||
|
|
||||||
|
# functions from module python
|
||||||
|
registerXPathFunction()
|
||||||
|
|
||||||
|
# functions from module xpath
|
||||||
|
xpathEval()
|
||||||
|
xpathEvalExpression()
|
||||||
|
xpathFreeContext()
|
||||||
|
|
||||||
|
# functions from module xpathInternals
|
||||||
|
xpathNewParserContext()
|
||||||
|
xpathNsLookup()
|
||||||
|
xpathRegisterAllFunctions()
|
||||||
|
xpathRegisterNs()
|
||||||
|
xpathRegisteredFuncsCleanup()
|
||||||
|
xpathRegisteredNsCleanup()
|
||||||
|
xpathRegisteredVariablesCleanup()
|
||||||
|
xpathVariableLookup()
|
||||||
|
xpathVariableLookupNS()
|
||||||
|
|
||||||
|
# functions from module xpointer
|
||||||
|
xpointerEval()
|
||||||
|
|
||||||
|
|
||||||
|
Class xmlAttribute(xmlNode)
|
||||||
|
Class catalog()
|
||||||
|
|
||||||
|
# functions from module catalog
|
||||||
|
add()
|
||||||
|
catalogIsEmpty()
|
||||||
|
convertSGMLCatalog()
|
||||||
|
dump()
|
||||||
|
remove()
|
||||||
|
resolve()
|
||||||
|
resolvePublic()
|
||||||
|
resolveSystem()
|
||||||
|
resolveURI()
|
||||||
|
|
||||||
|
|
||||||
|
Class xmlElement(xmlNode)
|
||||||
|
|
||||||
|
|
||||||
Class xmlAttr(xmlNode)
|
Class xmlAttr(xmlNode)
|
||||||
@ -665,12 +715,100 @@ Class xmlAttr(xmlNode)
|
|||||||
# functions from module valid
|
# functions from module valid
|
||||||
removeID()
|
removeID()
|
||||||
removeRef()
|
removeRef()
|
||||||
|
|
||||||
|
|
||||||
|
Class xmlTextReader(xmlTextReaderCore)
|
||||||
|
|
||||||
|
# functions from module xmlreader
|
||||||
|
AttributeCount()
|
||||||
|
BaseUri()
|
||||||
|
Close()
|
||||||
|
CurrentDoc()
|
||||||
|
CurrentNode()
|
||||||
|
Depth()
|
||||||
|
Expand()
|
||||||
|
GetAttribute()
|
||||||
|
GetAttributeNo()
|
||||||
|
GetAttributeNs()
|
||||||
|
GetParserProp()
|
||||||
|
GetRemainder()
|
||||||
|
HasAttributes()
|
||||||
|
HasValue()
|
||||||
|
IsDefault()
|
||||||
|
IsEmptyElement()
|
||||||
|
IsValid()
|
||||||
|
LocalName()
|
||||||
|
LookupNamespace()
|
||||||
|
MoveToAttribute()
|
||||||
|
MoveToAttributeNo()
|
||||||
|
MoveToAttributeNs()
|
||||||
|
MoveToElement()
|
||||||
|
MoveToFirstAttribute()
|
||||||
|
MoveToNextAttribute()
|
||||||
|
Name()
|
||||||
|
NamespaceUri()
|
||||||
|
NewDoc()
|
||||||
|
NewFd()
|
||||||
|
NewFile()
|
||||||
|
NewMemory()
|
||||||
|
NewWalker()
|
||||||
|
Next()
|
||||||
|
NextSibling()
|
||||||
|
NodeType()
|
||||||
|
Normalization()
|
||||||
|
Prefix()
|
||||||
|
Preserve()
|
||||||
|
QuoteChar()
|
||||||
|
Read()
|
||||||
|
ReadAttributeValue()
|
||||||
|
ReadInnerXml()
|
||||||
|
ReadOuterXml()
|
||||||
|
ReadState()
|
||||||
|
ReadString()
|
||||||
|
RelaxNGSetSchema()
|
||||||
|
RelaxNGValidate()
|
||||||
|
SetParserProp()
|
||||||
|
String()
|
||||||
|
Value()
|
||||||
|
XmlLang()
|
||||||
Class xmlReg()
|
Class xmlReg()
|
||||||
|
|
||||||
# functions from module xmlregexp
|
# functions from module xmlregexp
|
||||||
regexpExec()
|
regexpExec()
|
||||||
regexpIsDeterminist()
|
regexpIsDeterminist()
|
||||||
regexpPrint()
|
regexpPrint()
|
||||||
|
|
||||||
|
|
||||||
|
Class xmlEntity(xmlNode)
|
||||||
|
|
||||||
|
# functions from module parserInternals
|
||||||
|
handleEntity()
|
||||||
|
Class relaxNgSchema()
|
||||||
|
|
||||||
|
# functions from module relaxng
|
||||||
|
relaxNGDump()
|
||||||
|
relaxNGDumpTree()
|
||||||
|
relaxNGNewValidCtxt()
|
||||||
|
|
||||||
|
# functions from module xmlreader
|
||||||
|
RelaxNGSetSchema()
|
||||||
|
Class Schema()
|
||||||
|
|
||||||
|
# functions from module xmlschemas
|
||||||
|
schemaDump()
|
||||||
|
schemaNewValidCtxt()
|
||||||
|
Class Error()
|
||||||
|
# accessors
|
||||||
|
code()
|
||||||
|
domain()
|
||||||
|
file()
|
||||||
|
level()
|
||||||
|
line()
|
||||||
|
message()
|
||||||
|
|
||||||
|
# functions from module xmlerror
|
||||||
|
copyError()
|
||||||
|
resetError()
|
||||||
Class relaxNgValidCtxt()
|
Class relaxNgValidCtxt()
|
||||||
|
|
||||||
# functions from module relaxng
|
# functions from module relaxng
|
||||||
@ -679,6 +817,73 @@ Class relaxNgValidCtxt()
|
|||||||
relaxNGValidatePopElement()
|
relaxNGValidatePopElement()
|
||||||
relaxNGValidatePushCData()
|
relaxNGValidatePushCData()
|
||||||
relaxNGValidatePushElement()
|
relaxNGValidatePushElement()
|
||||||
|
Class xpathParserContext()
|
||||||
|
# accessors
|
||||||
|
context()
|
||||||
|
|
||||||
|
# functions from module xpathInternals
|
||||||
|
xpathAddValues()
|
||||||
|
xpathBooleanFunction()
|
||||||
|
xpathCeilingFunction()
|
||||||
|
xpathCompareValues()
|
||||||
|
xpathConcatFunction()
|
||||||
|
xpathContainsFunction()
|
||||||
|
xpathCountFunction()
|
||||||
|
xpathDivValues()
|
||||||
|
xpathEqualValues()
|
||||||
|
xpathErr()
|
||||||
|
xpathEvalExpr()
|
||||||
|
xpathFalseFunction()
|
||||||
|
xpathFloorFunction()
|
||||||
|
xpathFreeParserContext()
|
||||||
|
xpathIdFunction()
|
||||||
|
xpathLangFunction()
|
||||||
|
xpathLastFunction()
|
||||||
|
xpathLocalNameFunction()
|
||||||
|
xpathModValues()
|
||||||
|
xpathMultValues()
|
||||||
|
xpathNamespaceURIFunction()
|
||||||
|
xpathNextAncestor()
|
||||||
|
xpathNextAncestorOrSelf()
|
||||||
|
xpathNextAttribute()
|
||||||
|
xpathNextChild()
|
||||||
|
xpathNextDescendant()
|
||||||
|
xpathNextDescendantOrSelf()
|
||||||
|
xpathNextFollowing()
|
||||||
|
xpathNextFollowingSibling()
|
||||||
|
xpathNextNamespace()
|
||||||
|
xpathNextParent()
|
||||||
|
xpathNextPreceding()
|
||||||
|
xpathNextPrecedingSibling()
|
||||||
|
xpathNextSelf()
|
||||||
|
xpathNormalizeFunction()
|
||||||
|
xpathNotEqualValues()
|
||||||
|
xpathNotFunction()
|
||||||
|
xpathNumberFunction()
|
||||||
|
xpathParseNCName()
|
||||||
|
xpathParseName()
|
||||||
|
xpathPopBoolean()
|
||||||
|
xpathPopNumber()
|
||||||
|
xpathPopString()
|
||||||
|
xpathPositionFunction()
|
||||||
|
xpathRoot()
|
||||||
|
xpathRoundFunction()
|
||||||
|
xpathStartsWithFunction()
|
||||||
|
xpathStringFunction()
|
||||||
|
xpathStringLengthFunction()
|
||||||
|
xpathSubValues()
|
||||||
|
xpathSubstringAfterFunction()
|
||||||
|
xpathSubstringBeforeFunction()
|
||||||
|
xpathSubstringFunction()
|
||||||
|
xpathSumFunction()
|
||||||
|
xpathTranslateFunction()
|
||||||
|
xpathTrueFunction()
|
||||||
|
xpathValueFlipSign()
|
||||||
|
xpatherror()
|
||||||
|
|
||||||
|
# functions from module xpointer
|
||||||
|
xpointerEvalRangePredicate()
|
||||||
|
xpointerRangeToFunction()
|
||||||
|
|
||||||
|
|
||||||
Class parserCtxt(parserCtxtCore)
|
Class parserCtxt(parserCtxtCore)
|
||||||
@ -786,94 +991,6 @@ Class xmlDtd(xmlNode)
|
|||||||
dtdElementDesc()
|
dtdElementDesc()
|
||||||
dtdQAttrDesc()
|
dtdQAttrDesc()
|
||||||
dtdQElementDesc()
|
dtdQElementDesc()
|
||||||
Class relaxNgParserCtxt()
|
|
||||||
|
|
||||||
# functions from module relaxng
|
|
||||||
relaxNGParse()
|
|
||||||
relaxParserSetFlag()
|
|
||||||
Class xpathParserContext()
|
|
||||||
# accessors
|
|
||||||
context()
|
|
||||||
|
|
||||||
# functions from module xpathInternals
|
|
||||||
xpathAddValues()
|
|
||||||
xpathBooleanFunction()
|
|
||||||
xpathCeilingFunction()
|
|
||||||
xpathCompareValues()
|
|
||||||
xpathConcatFunction()
|
|
||||||
xpathContainsFunction()
|
|
||||||
xpathCountFunction()
|
|
||||||
xpathDivValues()
|
|
||||||
xpathEqualValues()
|
|
||||||
xpathErr()
|
|
||||||
xpathEvalExpr()
|
|
||||||
xpathFalseFunction()
|
|
||||||
xpathFloorFunction()
|
|
||||||
xpathFreeParserContext()
|
|
||||||
xpathIdFunction()
|
|
||||||
xpathLangFunction()
|
|
||||||
xpathLastFunction()
|
|
||||||
xpathLocalNameFunction()
|
|
||||||
xpathModValues()
|
|
||||||
xpathMultValues()
|
|
||||||
xpathNamespaceURIFunction()
|
|
||||||
xpathNextAncestor()
|
|
||||||
xpathNextAncestorOrSelf()
|
|
||||||
xpathNextAttribute()
|
|
||||||
xpathNextChild()
|
|
||||||
xpathNextDescendant()
|
|
||||||
xpathNextDescendantOrSelf()
|
|
||||||
xpathNextFollowing()
|
|
||||||
xpathNextFollowingSibling()
|
|
||||||
xpathNextNamespace()
|
|
||||||
xpathNextParent()
|
|
||||||
xpathNextPreceding()
|
|
||||||
xpathNextPrecedingSibling()
|
|
||||||
xpathNextSelf()
|
|
||||||
xpathNormalizeFunction()
|
|
||||||
xpathNotEqualValues()
|
|
||||||
xpathNotFunction()
|
|
||||||
xpathNumberFunction()
|
|
||||||
xpathParseNCName()
|
|
||||||
xpathParseName()
|
|
||||||
xpathPopBoolean()
|
|
||||||
xpathPopNumber()
|
|
||||||
xpathPopString()
|
|
||||||
xpathPositionFunction()
|
|
||||||
xpathRoot()
|
|
||||||
xpathRoundFunction()
|
|
||||||
xpathStartsWithFunction()
|
|
||||||
xpathStringFunction()
|
|
||||||
xpathStringLengthFunction()
|
|
||||||
xpathSubValues()
|
|
||||||
xpathSubstringAfterFunction()
|
|
||||||
xpathSubstringBeforeFunction()
|
|
||||||
xpathSubstringFunction()
|
|
||||||
xpathSumFunction()
|
|
||||||
xpathTranslateFunction()
|
|
||||||
xpathTrueFunction()
|
|
||||||
xpathValueFlipSign()
|
|
||||||
xpatherror()
|
|
||||||
|
|
||||||
# functions from module xpointer
|
|
||||||
xpointerEvalRangePredicate()
|
|
||||||
xpointerRangeToFunction()
|
|
||||||
Class SchemaParserCtxt()
|
|
||||||
|
|
||||||
# functions from module xmlschemas
|
|
||||||
schemaParse()
|
|
||||||
Class catalog()
|
|
||||||
|
|
||||||
# functions from module catalog
|
|
||||||
add()
|
|
||||||
catalogIsEmpty()
|
|
||||||
convertSGMLCatalog()
|
|
||||||
dump()
|
|
||||||
remove()
|
|
||||||
resolve()
|
|
||||||
resolvePublic()
|
|
||||||
resolveSystem()
|
|
||||||
resolveURI()
|
|
||||||
|
|
||||||
|
|
||||||
Class xmlNs(xmlNode)
|
Class xmlNs(xmlNode)
|
||||||
@ -897,6 +1014,51 @@ Class xmlNs(xmlNode)
|
|||||||
|
|
||||||
# functions from module xpathInternals
|
# functions from module xpathInternals
|
||||||
xpathNodeSetFreeNs()
|
xpathNodeSetFreeNs()
|
||||||
|
|
||||||
|
|
||||||
|
Class inputBuffer(ioReadWrapper)
|
||||||
|
|
||||||
|
# functions from module xmlIO
|
||||||
|
grow()
|
||||||
|
push()
|
||||||
|
read()
|
||||||
|
|
||||||
|
# functions from module xmlreader
|
||||||
|
newTextReader()
|
||||||
|
Class relaxNgParserCtxt()
|
||||||
|
|
||||||
|
# functions from module relaxng
|
||||||
|
relaxNGParse()
|
||||||
|
relaxParserSetFlag()
|
||||||
|
|
||||||
|
|
||||||
|
Class outputBuffer(ioWriteWrapper)
|
||||||
|
|
||||||
|
# functions from module HTMLtree
|
||||||
|
htmlDocContentDumpFormatOutput()
|
||||||
|
htmlDocContentDumpOutput()
|
||||||
|
htmlNodeDumpFormatOutput()
|
||||||
|
htmlNodeDumpOutput()
|
||||||
|
|
||||||
|
# functions from module tree
|
||||||
|
nodeDumpOutput()
|
||||||
|
saveFileTo()
|
||||||
|
saveFormatFileTo()
|
||||||
|
|
||||||
|
# functions from module xmlIO
|
||||||
|
write()
|
||||||
|
writeString()
|
||||||
|
Class SchemaParserCtxt()
|
||||||
|
|
||||||
|
# functions from module xmlschemas
|
||||||
|
schemaParse()
|
||||||
|
Class SchemaValidCtxt()
|
||||||
|
|
||||||
|
# functions from module xmlschemas
|
||||||
|
schemaSetValidOptions()
|
||||||
|
schemaValidCtxtGetOptions()
|
||||||
|
schemaValidateDoc()
|
||||||
|
schemaValidateOneElement()
|
||||||
Class xmlTextReaderLocator()
|
Class xmlTextReaderLocator()
|
||||||
|
|
||||||
# functions from module xmlreader
|
# functions from module xmlreader
|
||||||
@ -927,165 +1089,3 @@ Class URI()
|
|||||||
parseURIReference()
|
parseURIReference()
|
||||||
printURI()
|
printURI()
|
||||||
saveUri()
|
saveUri()
|
||||||
|
|
||||||
|
|
||||||
Class xmlAttribute(xmlNode)
|
|
||||||
Class xpathContext()
|
|
||||||
# accessors
|
|
||||||
contextDoc()
|
|
||||||
contextNode()
|
|
||||||
contextPosition()
|
|
||||||
contextSize()
|
|
||||||
function()
|
|
||||||
functionURI()
|
|
||||||
setContextDoc()
|
|
||||||
setContextNode()
|
|
||||||
|
|
||||||
# functions from module python
|
|
||||||
registerXPathFunction()
|
|
||||||
|
|
||||||
# functions from module xpath
|
|
||||||
xpathEval()
|
|
||||||
xpathEvalExpression()
|
|
||||||
xpathFreeContext()
|
|
||||||
|
|
||||||
# functions from module xpathInternals
|
|
||||||
xpathNewParserContext()
|
|
||||||
xpathNsLookup()
|
|
||||||
xpathRegisterAllFunctions()
|
|
||||||
xpathRegisterNs()
|
|
||||||
xpathRegisteredFuncsCleanup()
|
|
||||||
xpathRegisteredNsCleanup()
|
|
||||||
xpathRegisteredVariablesCleanup()
|
|
||||||
xpathVariableLookup()
|
|
||||||
xpathVariableLookupNS()
|
|
||||||
|
|
||||||
# functions from module xpointer
|
|
||||||
xpointerEval()
|
|
||||||
|
|
||||||
|
|
||||||
Class xmlElement(xmlNode)
|
|
||||||
|
|
||||||
|
|
||||||
Class xmlTextReader(xmlTextReaderCore)
|
|
||||||
|
|
||||||
# functions from module xmlreader
|
|
||||||
AttributeCount()
|
|
||||||
BaseUri()
|
|
||||||
Close()
|
|
||||||
CurrentDoc()
|
|
||||||
CurrentNode()
|
|
||||||
Depth()
|
|
||||||
Expand()
|
|
||||||
GetAttribute()
|
|
||||||
GetAttributeNo()
|
|
||||||
GetAttributeNs()
|
|
||||||
GetParserProp()
|
|
||||||
GetRemainder()
|
|
||||||
HasAttributes()
|
|
||||||
HasValue()
|
|
||||||
IsDefault()
|
|
||||||
IsEmptyElement()
|
|
||||||
IsValid()
|
|
||||||
LocalName()
|
|
||||||
LookupNamespace()
|
|
||||||
MoveToAttribute()
|
|
||||||
MoveToAttributeNo()
|
|
||||||
MoveToAttributeNs()
|
|
||||||
MoveToElement()
|
|
||||||
MoveToFirstAttribute()
|
|
||||||
MoveToNextAttribute()
|
|
||||||
Name()
|
|
||||||
NamespaceUri()
|
|
||||||
NewDoc()
|
|
||||||
NewFd()
|
|
||||||
NewFile()
|
|
||||||
NewMemory()
|
|
||||||
NewWalker()
|
|
||||||
Next()
|
|
||||||
NextSibling()
|
|
||||||
NodeType()
|
|
||||||
Normalization()
|
|
||||||
Prefix()
|
|
||||||
Preserve()
|
|
||||||
QuoteChar()
|
|
||||||
Read()
|
|
||||||
ReadAttributeValue()
|
|
||||||
ReadInnerXml()
|
|
||||||
ReadOuterXml()
|
|
||||||
ReadState()
|
|
||||||
ReadString()
|
|
||||||
RelaxNGSetSchema()
|
|
||||||
RelaxNGValidate()
|
|
||||||
SetParserProp()
|
|
||||||
String()
|
|
||||||
Value()
|
|
||||||
XmlLang()
|
|
||||||
|
|
||||||
|
|
||||||
Class xmlEntity(xmlNode)
|
|
||||||
|
|
||||||
# functions from module parserInternals
|
|
||||||
handleEntity()
|
|
||||||
Class Schema()
|
|
||||||
|
|
||||||
# functions from module xmlschemas
|
|
||||||
schemaDump()
|
|
||||||
schemaNewValidCtxt()
|
|
||||||
Class Error()
|
|
||||||
# accessors
|
|
||||||
code()
|
|
||||||
domain()
|
|
||||||
file()
|
|
||||||
level()
|
|
||||||
line()
|
|
||||||
message()
|
|
||||||
|
|
||||||
# functions from module xmlerror
|
|
||||||
copyError()
|
|
||||||
resetError()
|
|
||||||
Class relaxNgSchema()
|
|
||||||
|
|
||||||
# functions from module relaxng
|
|
||||||
relaxNGDump()
|
|
||||||
relaxNGDumpTree()
|
|
||||||
relaxNGNewValidCtxt()
|
|
||||||
|
|
||||||
# functions from module xmlreader
|
|
||||||
RelaxNGSetSchema()
|
|
||||||
|
|
||||||
|
|
||||||
Class inputBuffer(ioReadWrapper)
|
|
||||||
|
|
||||||
# functions from module xmlIO
|
|
||||||
grow()
|
|
||||||
push()
|
|
||||||
read()
|
|
||||||
|
|
||||||
# functions from module xmlreader
|
|
||||||
newTextReader()
|
|
||||||
Class SchemaValidCtxt()
|
|
||||||
|
|
||||||
# functions from module xmlschemas
|
|
||||||
schemaSetValidOptions()
|
|
||||||
schemaValidCtxtGetOptions()
|
|
||||||
schemaValidateDoc()
|
|
||||||
schemaValidateOneElement()
|
|
||||||
|
|
||||||
|
|
||||||
Class outputBuffer(ioWriteWrapper)
|
|
||||||
|
|
||||||
# functions from module HTMLtree
|
|
||||||
htmlDocContentDumpFormatOutput()
|
|
||||||
htmlDocContentDumpOutput()
|
|
||||||
htmlNodeDumpFormatOutput()
|
|
||||||
htmlNodeDumpOutput()
|
|
||||||
|
|
||||||
# functions from module tree
|
|
||||||
nodeDumpOutput()
|
|
||||||
saveFileTo()
|
|
||||||
saveFormatFileTo()
|
|
||||||
|
|
||||||
# functions from module xmlIO
|
|
||||||
write()
|
|
||||||
writeString()
|
|
||||||
|
@ -7024,7 +7024,8 @@ xmlRelaxNGCleanupTree(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr root)
|
|||||||
} else {
|
} else {
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
|
|
||||||
node = xmlNewNode(cur->ns, BAD_CAST "name");
|
node = xmlNewDocNode(cur->doc, cur->ns,
|
||||||
|
BAD_CAST "name", NULL);
|
||||||
if (node != NULL) {
|
if (node != NULL) {
|
||||||
xmlAddPrevSibling(cur->children, node);
|
xmlAddPrevSibling(cur->children, node);
|
||||||
text = xmlNewText(name);
|
text = xmlNewText(name);
|
||||||
|
71
tree.c
71
tree.c
@ -329,7 +329,7 @@ xmlSplitQName3(const xmlChar *name, int *len) {
|
|||||||
|
|
||||||
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
|
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
|
||||||
|
|
||||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
||||||
/**
|
/**
|
||||||
* xmlValidateNCName:
|
* xmlValidateNCName:
|
||||||
* @value: the value to check
|
* @value: the value to check
|
||||||
@ -1749,7 +1749,10 @@ xmlNewProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value) {
|
|||||||
doc = node->doc;
|
doc = node->doc;
|
||||||
cur->doc = doc;
|
cur->doc = doc;
|
||||||
}
|
}
|
||||||
cur->name = xmlStrdup(name);
|
if ((doc != NULL) && (doc->dict != NULL))
|
||||||
|
cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
|
||||||
|
else
|
||||||
|
cur->name = xmlStrdup(name);
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
xmlChar *buffer;
|
xmlChar *buffer;
|
||||||
xmlNodePtr tmp;
|
xmlNodePtr tmp;
|
||||||
@ -1830,7 +1833,10 @@ xmlNewNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
|
|||||||
cur->doc = doc;
|
cur->doc = doc;
|
||||||
}
|
}
|
||||||
cur->ns = ns;
|
cur->ns = ns;
|
||||||
cur->name = xmlStrdup(name);
|
if ((doc != NULL) && (doc->dict != NULL))
|
||||||
|
cur->name = xmlDictLookup(doc->dict, name, -1);
|
||||||
|
else
|
||||||
|
cur->name = xmlStrdup(name);
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
xmlChar *buffer;
|
xmlChar *buffer;
|
||||||
xmlNodePtr tmp;
|
xmlNodePtr tmp;
|
||||||
@ -1979,7 +1985,10 @@ xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value) {
|
|||||||
memset(cur, 0, sizeof(xmlAttr));
|
memset(cur, 0, sizeof(xmlAttr));
|
||||||
cur->type = XML_ATTRIBUTE_NODE;
|
cur->type = XML_ATTRIBUTE_NODE;
|
||||||
|
|
||||||
cur->name = xmlStrdup(name);
|
if ((doc != NULL) && (doc->dict != NULL))
|
||||||
|
cur->name = xmlDictLookup(doc->dict, name, -1);
|
||||||
|
else
|
||||||
|
cur->name = xmlStrdup(name);
|
||||||
cur->doc = doc;
|
cur->doc = doc;
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
xmlNodePtr tmp;
|
xmlNodePtr tmp;
|
||||||
@ -2098,7 +2107,8 @@ xmlRemoveProp(xmlAttrPtr cur) {
|
|||||||
#endif /* LIBXML_TREE_ENABLED */
|
#endif /* LIBXML_TREE_ENABLED */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlNewPI:
|
* xmlNewDocPI:
|
||||||
|
* @doc: the target document
|
||||||
* @name: the processing instruction name
|
* @name: the processing instruction name
|
||||||
* @content: the PI content
|
* @content: the PI content
|
||||||
*
|
*
|
||||||
@ -2106,7 +2116,7 @@ xmlRemoveProp(xmlAttrPtr cur) {
|
|||||||
* Returns a pointer to the new node object.
|
* Returns a pointer to the new node object.
|
||||||
*/
|
*/
|
||||||
xmlNodePtr
|
xmlNodePtr
|
||||||
xmlNewPI(const xmlChar *name, const xmlChar *content) {
|
xmlNewDocPI(xmlDocPtr doc, const xmlChar *name, const xmlChar *content) {
|
||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
|
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
@ -2128,7 +2138,10 @@ xmlNewPI(const xmlChar *name, const xmlChar *content) {
|
|||||||
memset(cur, 0, sizeof(xmlNode));
|
memset(cur, 0, sizeof(xmlNode));
|
||||||
cur->type = XML_PI_NODE;
|
cur->type = XML_PI_NODE;
|
||||||
|
|
||||||
cur->name = xmlStrdup(name);
|
if ((doc != NULL) && (doc->dict != NULL))
|
||||||
|
cur->name = xmlDictLookup(doc->dict, name, -1);
|
||||||
|
else
|
||||||
|
cur->name = xmlStrdup(name);
|
||||||
if (content != NULL) {
|
if (content != NULL) {
|
||||||
cur->content = xmlStrdup(content);
|
cur->content = xmlStrdup(content);
|
||||||
}
|
}
|
||||||
@ -2138,6 +2151,21 @@ xmlNewPI(const xmlChar *name, const xmlChar *content) {
|
|||||||
return(cur);
|
return(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlNewPI:
|
||||||
|
* @name: the processing instruction name
|
||||||
|
* @content: the PI content
|
||||||
|
*
|
||||||
|
* Creation of a processing instruction element.
|
||||||
|
* Use xmlDocNewPI preferably to get string interning
|
||||||
|
*
|
||||||
|
* Returns a pointer to the new node object.
|
||||||
|
*/
|
||||||
|
xmlNodePtr
|
||||||
|
xmlNewPI(const xmlChar *name, const xmlChar *content) {
|
||||||
|
return(xmlNewDocPI(NULL, name, content));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlNewNode:
|
* xmlNewNode:
|
||||||
* @ns: namespace if any
|
* @ns: namespace if any
|
||||||
@ -2242,7 +2270,11 @@ xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns,
|
|||||||
const xmlChar *name, const xmlChar *content) {
|
const xmlChar *name, const xmlChar *content) {
|
||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
|
|
||||||
cur = xmlNewNode(ns, name);
|
if (doc->dict != NULL)
|
||||||
|
cur = xmlNewNodeEatName(ns, (xmlChar *)
|
||||||
|
xmlDictLookup(doc->dict, name, -1));
|
||||||
|
else
|
||||||
|
cur = xmlNewNode(ns, name);
|
||||||
if (cur != NULL) {
|
if (cur != NULL) {
|
||||||
cur->doc = doc;
|
cur->doc = doc;
|
||||||
if (content != NULL) {
|
if (content != NULL) {
|
||||||
@ -3804,8 +3836,12 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
|
|||||||
ret->name = xmlStringTextNoenc;
|
ret->name = xmlStringTextNoenc;
|
||||||
else if (node->name == xmlStringComment)
|
else if (node->name == xmlStringComment)
|
||||||
ret->name = xmlStringComment;
|
ret->name = xmlStringComment;
|
||||||
else if (node->name != NULL)
|
else if (node->name != NULL) {
|
||||||
ret->name = xmlStrdup(node->name);
|
if ((doc != NULL) && (doc->dict != NULL))
|
||||||
|
ret->name = xmlDictLookup(doc->dict, node->name, -1);
|
||||||
|
else
|
||||||
|
ret->name = xmlStrdup(node->name);
|
||||||
|
}
|
||||||
if ((node->type != XML_ELEMENT_NODE) &&
|
if ((node->type != XML_ELEMENT_NODE) &&
|
||||||
(node->content != NULL) &&
|
(node->content != NULL) &&
|
||||||
(node->type != XML_ENTITY_REF_NODE) &&
|
(node->type != XML_ENTITY_REF_NODE) &&
|
||||||
@ -3968,11 +4004,26 @@ xmlDocCopyNode(const xmlNodePtr node, xmlDocPtr doc, int extended) {
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlDocCopyNodeList:
|
||||||
|
* @doc: the target document
|
||||||
|
* @node: the first node in the list.
|
||||||
|
*
|
||||||
|
* Do a recursive copy of the node list.
|
||||||
|
*
|
||||||
|
* Returns: a new #xmlNodePtr, or NULL in case of error.
|
||||||
|
*/
|
||||||
|
xmlNodePtr xmlDocCopyNodeList(xmlDocPtr doc, const xmlNodePtr node) {
|
||||||
|
xmlNodePtr ret = xmlStaticCopyNodeList(node, doc, NULL);
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlCopyNodeList:
|
* xmlCopyNodeList:
|
||||||
* @node: the first node in the list.
|
* @node: the first node in the list.
|
||||||
*
|
*
|
||||||
* Do a recursive copy of the node list.
|
* Do a recursive copy of the node list.
|
||||||
|
* Use xmlDocCopyNodeList() if possible to ensure string interning.
|
||||||
*
|
*
|
||||||
* Returns: a new #xmlNodePtr, or NULL in case of error.
|
* Returns: a new #xmlNodePtr, or NULL in case of error.
|
||||||
*/
|
*/
|
||||||
|
@ -1872,7 +1872,8 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) {
|
|||||||
ret = 0; /* xmlXIncludeDoProcess can return +ve number */
|
ret = 0; /* xmlXIncludeDoProcess can return +ve number */
|
||||||
xmlXIncludeFreeContext(newctxt);
|
xmlXIncludeFreeContext(newctxt);
|
||||||
|
|
||||||
ctxt->incTab[nr]->inc = xmlCopyNodeList(fallback->children);
|
ctxt->incTab[nr]->inc = xmlDocCopyNodeList(ctxt->doc,
|
||||||
|
fallback->children);
|
||||||
} else {
|
} else {
|
||||||
ctxt->incTab[nr]->inc = NULL;
|
ctxt->incTab[nr]->inc = NULL;
|
||||||
ctxt->incTab[nr]->emptyFb = 1; /* flag empty callback */
|
ctxt->incTab[nr]->emptyFb = 1; /* flag empty callback */
|
||||||
@ -2134,7 +2135,7 @@ xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) {
|
|||||||
* XInclude end one
|
* XInclude end one
|
||||||
*/
|
*/
|
||||||
cur->type = XML_XINCLUDE_START;
|
cur->type = XML_XINCLUDE_START;
|
||||||
end = xmlNewNode(cur->ns, cur->name);
|
end = xmlNewDocNode(cur->doc, cur->ns, cur->name, NULL);
|
||||||
if (end == NULL) {
|
if (end == NULL) {
|
||||||
xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
|
xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
|
||||||
XML_XINCLUDE_BUILD_FAILED,
|
XML_XINCLUDE_BUILD_FAILED,
|
||||||
|
10
xmlwriter.c
10
xmlwriter.c
@ -304,6 +304,11 @@ xmlNewTextWriterDoc(xmlDocPtr * doc, int compression)
|
|||||||
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
|
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* For some reason this seems to completely break if node names
|
||||||
|
* are interned.
|
||||||
|
*/
|
||||||
|
ctxt->dictNames = 0;
|
||||||
|
|
||||||
ctxt->myDoc = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION);
|
ctxt->myDoc = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION);
|
||||||
if (ctxt->myDoc == NULL) {
|
if (ctxt->myDoc == NULL) {
|
||||||
@ -364,6 +369,11 @@ xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, int compression)
|
|||||||
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
|
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* For some reason this seems to completely break if node names
|
||||||
|
* are interned.
|
||||||
|
*/
|
||||||
|
ctxt->dictNames = 0;
|
||||||
|
|
||||||
ret = xmlNewTextWriterPushParser(ctxt, compression);
|
ret = xmlNewTextWriterPushParser(ctxt, compression);
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
|
Reference in New Issue
Block a user