mirror of
https://github.com/darlinghq/darling-libxml2.git
synced 2025-01-27 05:23:51 +00:00
Adding a configure option to remove tree manipulation code which is not
* configure.in entities.c tree.c valid.c xmllint.c include/libxml/tree.h include/libxml/xmlversion.h.in: Adding a configure option to remove tree manipulation code which is not strictly needed by the parser. Daniel
This commit is contained in:
parent
89f7f27a9b
commit
652327a727
@ -1,3 +1,10 @@
|
||||
Mon Sep 29 19:58:26 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* configure.in entities.c tree.c valid.c xmllint.c
|
||||
include/libxml/tree.h include/libxml/xmlversion.h.in:
|
||||
Adding a configure option to remove tree manipulation
|
||||
code which is not strictly needed by the parser.
|
||||
|
||||
Mon Sep 29 15:23:41 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* nanoftp.c nanohttp.c: last finishing touch to the BeOS
|
||||
|
18
configure.in
18
configure.in
@ -528,7 +528,7 @@ if test "$with_history" = "yes" ; then
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(output,
|
||||
[ --with-output add the serialization support (on)])
|
||||
[ --with-output add the serialization support (on)])
|
||||
if test "$with_minimum" = "yes" -a "$with_output" = ""
|
||||
then
|
||||
with_output=no
|
||||
@ -541,6 +541,20 @@ else
|
||||
fi
|
||||
AC_SUBST(WITH_OUTPUT)
|
||||
|
||||
AC_ARG_WITH(tree,
|
||||
[ --with-tree add the DOM like tree manipulation APIs (on)])
|
||||
if test "$with_minimum" = "yes" -a "$with_tree" = ""
|
||||
then
|
||||
with_tree=no
|
||||
fi
|
||||
if test "$with_tree" = "no" ; then
|
||||
echo Disabling DOM like tree manipulation APIs
|
||||
WITH_TREE=0
|
||||
else
|
||||
WITH_TREE=1
|
||||
fi
|
||||
AC_SUBST(WITH_TREE)
|
||||
|
||||
AC_ARG_WITH(ftp,
|
||||
[ --with-ftp add the FTP support (on)])
|
||||
if test "$with_minimum" = "yes" -a "$with_ftp" = ""
|
||||
@ -596,7 +610,7 @@ AC_SUBST(HTML_OBJ)
|
||||
AC_SUBST(TEST_HTML)
|
||||
|
||||
AC_ARG_WITH(legacy,
|
||||
[ --with-legacy add deprecated APIs for compatibility (on)])
|
||||
[ --with-legacy add deprecated APIs for compatibility (on)])
|
||||
if test "$with_minimum" = "yes" -a "$with_legacy" = ""
|
||||
then
|
||||
with_legacy=no
|
||||
|
@ -704,6 +704,7 @@ xmlFreeEntitiesTable(xmlEntitiesTablePtr table) {
|
||||
xmlHashFree(table, (xmlHashDeallocator) xmlFreeEntityWrapper);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyEntity:
|
||||
* @ent: An entity
|
||||
@ -753,6 +754,7 @@ xmlEntitiesTablePtr
|
||||
xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
|
||||
return(xmlHashCopy(table, (xmlHashCopier) xmlCopyEntity));
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/**
|
||||
|
@ -677,11 +677,13 @@ XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
xmlCopyPropList (xmlNodePtr target,
|
||||
xmlAttrPtr cur);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlDtdPtr XMLCALL
|
||||
xmlCopyDtd (xmlDtdPtr dtd);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlCopyDoc (xmlDocPtr doc,
|
||||
int recursive);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/*
|
||||
* Creating new nodes.
|
||||
@ -756,16 +758,20 @@ XMLPUBFUN xmlNodePtr XMLCALL
|
||||
int recursive);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlCopyNodeList (const xmlNodePtr node);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlNewDocFragment (xmlDocPtr doc);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/*
|
||||
* Navigating.
|
||||
*/
|
||||
XMLPUBFUN long XMLCALL
|
||||
xmlGetLineNo (xmlNodePtr node);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlGetNodePath (xmlNodePtr node);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlDocGetRootElement (xmlDocPtr doc);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
@ -775,6 +781,7 @@ XMLPUBFUN int XMLCALL
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsBlankNode (xmlNodePtr node);
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/*
|
||||
* Changing the structure.
|
||||
*/
|
||||
@ -784,21 +791,24 @@ XMLPUBFUN xmlNodePtr XMLCALL
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeSetName (xmlNodePtr cur,
|
||||
const xmlChar *name);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlAddChild (xmlNodePtr parent,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlAddChildList (xmlNodePtr parent,
|
||||
xmlNodePtr cur);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlReplaceNode (xmlNodePtr old,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlAddSibling (xmlNodePtr cur,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlAddPrevSibling (xmlNodePtr cur,
|
||||
xmlNodePtr elem);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlAddSibling (xmlNodePtr cur,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlAddNextSibling (xmlNodePtr cur,
|
||||
xmlNodePtr elem);
|
||||
@ -821,7 +831,6 @@ XMLPUBFUN void XMLCALL
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSetListDoc (xmlNodePtr list,
|
||||
xmlDocPtr doc);
|
||||
|
||||
/*
|
||||
* Namespaces.
|
||||
*/
|
||||
@ -833,9 +842,12 @@ XMLPUBFUN xmlNsPtr XMLCALL
|
||||
xmlSearchNsByHref (xmlDocPtr doc,
|
||||
xmlNodePtr node,
|
||||
const xmlChar *href);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlNsPtr * XMLCALL
|
||||
xmlGetNsList (xmlDocPtr doc,
|
||||
xmlNodePtr node);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSetNs (xmlNodePtr node,
|
||||
xmlNsPtr ns);
|
||||
@ -847,16 +859,18 @@ XMLPUBFUN xmlNsPtr XMLCALL
|
||||
/*
|
||||
* Changing the content.
|
||||
*/
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
xmlSetProp (xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlGetProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlGetNoNsProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlGetProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
xmlHasProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
@ -864,11 +878,13 @@ XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
xmlHasNsProp (xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
const xmlChar *nameSpace);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
xmlSetNsProp (xmlNodePtr node,
|
||||
xmlNsPtr ns,
|
||||
const xmlChar *name,
|
||||
const xmlChar *value);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlGetNsProp (xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
@ -884,17 +900,21 @@ XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNodeListGetString (xmlDocPtr doc,
|
||||
xmlNodePtr list,
|
||||
int inLine);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNodeListGetRawString (xmlDocPtr doc,
|
||||
xmlNodePtr list,
|
||||
int inLine);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeSetContent (xmlNodePtr cur,
|
||||
const xmlChar *content);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeSetContentLen (xmlNodePtr cur,
|
||||
const xmlChar *content,
|
||||
int len);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeAddContent (xmlNodePtr cur,
|
||||
const xmlChar *content);
|
||||
@ -906,17 +926,20 @@ XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNodeGetContent (xmlNodePtr cur);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNodeGetLang (xmlNodePtr cur);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNodeGetSpacePreserve (xmlNodePtr cur);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeSetLang (xmlNodePtr cur,
|
||||
const xmlChar *lang);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNodeGetSpacePreserve (xmlNodePtr cur);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeSetSpacePreserve (xmlNodePtr cur,
|
||||
int val);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNodeGetBase (xmlDocPtr doc,
|
||||
xmlNodePtr cur);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNodeSetBase (xmlNodePtr cur,
|
||||
const xmlChar *uri);
|
||||
@ -933,6 +956,7 @@ XMLPUBFUN int XMLCALL
|
||||
xmlUnsetNsProp (xmlNodePtr node,
|
||||
xmlNsPtr ns,
|
||||
const xmlChar *name);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/*
|
||||
* Internal, don't use.
|
||||
|
@ -83,6 +83,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_TREE_ENABLED:
|
||||
*
|
||||
* Whether the DOM like tree manipulation API support is configured in
|
||||
*/
|
||||
#if @WITH_TREE@
|
||||
#define LIBXML_TREE_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_OUTPUT_ENABLED:
|
||||
*
|
||||
|
61
tree.c
61
tree.c
@ -82,6 +82,7 @@ static int xmlCheckDTD = 1;
|
||||
************************************************************************/
|
||||
#include <libxml/hash.h>
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlGetEntityFromDtd:
|
||||
* @dtd: A pointer to the DTD to search
|
||||
@ -124,6 +125,7 @@ xmlGetParameterEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -273,6 +275,7 @@ xmlSplitQName3(const xmlChar *name, int *len) {
|
||||
return(&name[l+1]);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/************************************************************************
|
||||
* *
|
||||
* Check Name, NCName and QName strings *
|
||||
@ -582,6 +585,7 @@ try_complex:
|
||||
return(1);
|
||||
return(0);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -1542,6 +1546,8 @@ xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine)
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNodeListGetRawString:
|
||||
* @doc: the document
|
||||
@ -1623,7 +1629,9 @@ xmlNodeListGetRawString(xmlDocPtr doc, xmlNodePtr list, int inLine)
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNewProp:
|
||||
* @node: the holding node
|
||||
@ -1703,6 +1711,7 @@ xmlNewProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value) {
|
||||
xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
|
||||
return(cur);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNewNsProp:
|
||||
@ -1965,6 +1974,7 @@ xmlFreeProp(xmlAttrPtr cur) {
|
||||
xmlFree(cur);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlRemoveProp:
|
||||
* @cur: an attribute
|
||||
@ -2013,6 +2023,7 @@ xmlRemoveProp(xmlAttrPtr cur) {
|
||||
#endif
|
||||
return(-1);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNewPI:
|
||||
@ -2204,7 +2215,7 @@ xmlNewDocNodeEatName(xmlDocPtr doc, xmlNsPtr ns,
|
||||
return(cur);
|
||||
}
|
||||
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNewDocRawNode:
|
||||
* @doc: the document
|
||||
@ -2262,6 +2273,7 @@ xmlNewDocFragment(xmlDocPtr doc) {
|
||||
xmlRegisterNodeDefaultValue(cur);
|
||||
return(cur);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNewText:
|
||||
@ -2296,6 +2308,7 @@ xmlNewText(const xmlChar *content) {
|
||||
return(cur);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNewTextChild:
|
||||
* @parent: the parent node
|
||||
@ -2357,6 +2370,7 @@ xmlNewTextChild(xmlNodePtr parent, xmlNsPtr ns,
|
||||
|
||||
return(cur);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNewCharRef:
|
||||
@ -2657,7 +2671,7 @@ xmlSetListDoc(xmlNodePtr list, xmlDocPtr doc) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNewChild:
|
||||
* @parent: the parent node
|
||||
@ -2735,6 +2749,7 @@ xmlNewChild(xmlNodePtr parent, xmlNsPtr ns,
|
||||
|
||||
return(cur);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlAddNextSibling:
|
||||
@ -2814,6 +2829,7 @@ xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) {
|
||||
return(elem);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlAddPrevSibling:
|
||||
* @cur: the child node
|
||||
@ -2900,6 +2916,7 @@ xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem) {
|
||||
}
|
||||
return(elem);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlAddSibling:
|
||||
@ -3363,6 +3380,7 @@ xmlUnlinkNode(xmlNodePtr cur) {
|
||||
cur->next = cur->prev = NULL;
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlReplaceNode:
|
||||
* @old: the old node
|
||||
@ -3428,6 +3446,7 @@ xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) {
|
||||
old->parent = NULL;
|
||||
return(old);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -3517,15 +3536,7 @@ xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) {
|
||||
|
||||
if ((cur->ns != NULL) && (target != NULL)) {
|
||||
xmlNsPtr ns;
|
||||
/*
|
||||
* if (target->doc)
|
||||
* ns = xmlSearchNs(target->doc, target, cur->ns->prefix);
|
||||
* else if (cur->doc) / * target may not yet have a doc : KPI * /
|
||||
* ns = xmlSearchNs(cur->doc, target, cur->ns->prefix);
|
||||
* else
|
||||
* ns = NULL;
|
||||
* ret->ns = ns;
|
||||
*/
|
||||
|
||||
ns = xmlSearchNs(target->doc, target, cur->ns->prefix);
|
||||
if (ns == NULL) {
|
||||
/*
|
||||
@ -3672,7 +3683,9 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
case XML_DOCB_DOCUMENT_NODE:
|
||||
#endif
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, recursive));
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
case XML_DOCUMENT_TYPE_NODE:
|
||||
case XML_NOTATION_NODE:
|
||||
case XML_DTD_NODE:
|
||||
@ -3793,6 +3806,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
xmlNodePtr p = NULL,q;
|
||||
|
||||
while (node != NULL) {
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
if (node->type == XML_DTD_NODE ) {
|
||||
if (doc == NULL) {
|
||||
node = node->next;
|
||||
@ -3809,6 +3823,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
|
||||
xmlAddChild(parent, q);
|
||||
}
|
||||
} else
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
q = xmlStaticCopyNode(node, doc, parent, 1);
|
||||
if (ret == NULL) {
|
||||
q->prev = NULL;
|
||||
@ -3872,6 +3887,7 @@ xmlNodePtr xmlCopyNodeList(const xmlNodePtr node) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyDtd:
|
||||
* @dtd: the dtd
|
||||
@ -4007,6 +4023,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -4044,6 +4061,7 @@ xmlGetLineNo(xmlNodePtr node)
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlGetNodePath:
|
||||
* @node: a node
|
||||
@ -4250,6 +4268,7 @@ xmlGetNodePath(xmlNodePtr node)
|
||||
xmlFree(buf);
|
||||
return (buffer);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlDocGetRootElement:
|
||||
@ -4274,6 +4293,7 @@ xmlDocGetRootElement(xmlDocPtr doc) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlDocSetRootElement:
|
||||
* @doc: the document
|
||||
@ -4358,6 +4378,7 @@ xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) {
|
||||
return;
|
||||
xmlSetNsProp(cur, ns, BAD_CAST "lang", lang);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNodeGetLang:
|
||||
@ -4383,6 +4404,7 @@ xmlNodeGetLang(xmlNodePtr cur) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNodeSetSpacePreserve:
|
||||
* @cur: the node being changed
|
||||
@ -4435,6 +4457,7 @@ xmlNodeSetSpacePreserve(xmlNodePtr cur, int val) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNodeGetSpacePreserve:
|
||||
@ -4468,6 +4491,7 @@ xmlNodeGetSpacePreserve(xmlNodePtr cur) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNodeSetName:
|
||||
* @cur: the node being changed
|
||||
@ -4566,6 +4590,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
|
||||
return;
|
||||
xmlSetNsProp(cur, ns, BAD_CAST "base", uri);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNodeGetBase:
|
||||
@ -4845,6 +4870,7 @@ xmlNodeGetContent(xmlNodePtr cur)
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNodeSetContent:
|
||||
* @cur: the node being modified
|
||||
@ -4912,6 +4938,7 @@ xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlNodeSetContentLen:
|
||||
* @cur: the node being modified
|
||||
@ -4976,6 +5003,7 @@ xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNodeAddContentLen:
|
||||
@ -5087,6 +5115,7 @@ xmlTextMerge(xmlNodePtr first, xmlNodePtr second) {
|
||||
return(first);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlGetNsList:
|
||||
* @doc: the document
|
||||
@ -5150,6 +5179,7 @@ xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node)
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlSearchNs:
|
||||
@ -5288,7 +5318,6 @@ xmlNsInScope(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node,
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlSearchNsByHref:
|
||||
* @doc: the document
|
||||
@ -5444,6 +5473,7 @@ xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) {
|
||||
return(def);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlReconciliateNs:
|
||||
* @doc: the document
|
||||
@ -5641,6 +5671,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) {
|
||||
xmlFree(newNs);
|
||||
return(ret);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlHasProp:
|
||||
@ -5710,7 +5741,9 @@ xmlHasProp(xmlNodePtr node, const xmlChar *name) {
|
||||
xmlAttrPtr
|
||||
xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
|
||||
xmlAttrPtr prop;
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
xmlDocPtr doc;
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
if (node == NULL)
|
||||
return(NULL);
|
||||
@ -5732,6 +5765,7 @@ xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
|
||||
}
|
||||
if (!xmlCheckDTD) return(NULL);
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/*
|
||||
* Check if there is a default declaration in the internal
|
||||
* or external subsets
|
||||
@ -5774,6 +5808,7 @@ xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
|
||||
return((xmlAttrPtr) attrDecl);
|
||||
}
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@ -5964,6 +5999,7 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlSetProp:
|
||||
* @node: the node
|
||||
@ -6145,6 +6181,7 @@ xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) {
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlNodeIsText:
|
||||
|
10
valid.c
10
valid.c
@ -1266,6 +1266,7 @@ xmlFreeElementTable(xmlElementTablePtr table) {
|
||||
xmlHashFree(table, (xmlHashDeallocator) xmlFreeElement);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyElement:
|
||||
* @elem: An element
|
||||
@ -1314,6 +1315,7 @@ xmlCopyElementTable(xmlElementTablePtr table) {
|
||||
return((xmlElementTablePtr) xmlHashCopy(table,
|
||||
(xmlHashCopier) xmlCopyElement));
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/**
|
||||
@ -1430,6 +1432,7 @@ xmlFreeEnumeration(xmlEnumerationPtr cur) {
|
||||
xmlFree(cur);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyEnumeration:
|
||||
* @cur: the tree to copy.
|
||||
@ -1451,6 +1454,7 @@ xmlCopyEnumeration(xmlEnumerationPtr cur) {
|
||||
|
||||
return(ret);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/**
|
||||
@ -1818,6 +1822,7 @@ xmlFreeAttributeTable(xmlAttributeTablePtr table) {
|
||||
xmlHashFree(table, (xmlHashDeallocator) xmlFreeAttribute);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyAttribute:
|
||||
* @attr: An attribute
|
||||
@ -1865,6 +1870,7 @@ xmlCopyAttributeTable(xmlAttributeTablePtr table) {
|
||||
return((xmlAttributeTablePtr) xmlHashCopy(table,
|
||||
(xmlHashCopier) xmlCopyAttribute));
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/**
|
||||
@ -2087,6 +2093,7 @@ xmlFreeNotationTable(xmlNotationTablePtr table) {
|
||||
xmlHashFree(table, (xmlHashDeallocator) xmlFreeNotation);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyNotation:
|
||||
* @nota: A notation
|
||||
@ -2133,6 +2140,7 @@ xmlCopyNotationTable(xmlNotationTablePtr table) {
|
||||
return((xmlNotationTablePtr) xmlHashCopy(table,
|
||||
(xmlHashCopier) xmlCopyNotation));
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/**
|
||||
@ -3530,7 +3538,7 @@ xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
|
||||
* trailing space (#x20) characters, and by replacing sequences of space
|
||||
* (#x20) characters by single space (#x20) character.
|
||||
*
|
||||
* returns a new normalized string if normalization is needed, NULL otherwise
|
||||
* Returns a new normalized string if normalization is needed, NULL otherwise
|
||||
* the caller must free the returned value.
|
||||
*/
|
||||
|
||||
|
18
xmllint.c
18
xmllint.c
@ -99,7 +99,9 @@ static int shell = 0;
|
||||
static int debugent = 0;
|
||||
#endif
|
||||
static int debug = 0;
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
static int copy = 0;
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
static int recovery = 0;
|
||||
static int noent = 0;
|
||||
static int noblanks = 0;
|
||||
@ -733,12 +735,16 @@ static void streamFile(char *filename) {
|
||||
* *
|
||||
************************************************************************/
|
||||
static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
xmlDocPtr doc = NULL, tmp;
|
||||
xmlDocPtr doc = NULL;
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
xmlDocPtr tmp;
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
if ((timing) && (!repeat))
|
||||
startTimer();
|
||||
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
if (filename == NULL) {
|
||||
if (generate) {
|
||||
xmlNodePtr n;
|
||||
@ -749,6 +755,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
xmlDocSetRootElement(doc, n);
|
||||
}
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
else if ((html) && (push)) {
|
||||
FILE *f;
|
||||
@ -950,6 +957,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
xmlShell(doc, filename, xmlShellReadline, stdout);
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/*
|
||||
* test intermediate copy if needed.
|
||||
*/
|
||||
@ -958,6 +966,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
doc = xmlCopyDoc(doc, 1);
|
||||
xmlFreeDoc(tmp);
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_VALID_ENABLED
|
||||
if ((insert) && (!html)) {
|
||||
@ -1295,7 +1304,9 @@ static void usage(const char *name) {
|
||||
#else
|
||||
printf("\t--debug : dump the nodes content when using --stream\n");
|
||||
#endif
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
printf("\t--copy : used to test the internal copy implementation\n");
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
printf("\t--recover : output what was parsable on broken XML documents\n");
|
||||
printf("\t--noent : substitute entity references by their value\n");
|
||||
printf("\t--noout : don't output the result tree\n");
|
||||
@ -1397,9 +1408,12 @@ main(int argc, char **argv) {
|
||||
noout = 1;
|
||||
} else
|
||||
#endif
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
|
||||
copy++;
|
||||
else if ((!strcmp(argv[i], "-recover")) ||
|
||||
else
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
if ((!strcmp(argv[i], "-recover")) ||
|
||||
(!strcmp(argv[i], "--recover"))) {
|
||||
recovery++;
|
||||
options |= XML_PARSE_RECOVER;
|
||||
|
Loading…
x
Reference in New Issue
Block a user