/*
* xinclude.c : Code to implement XInclude processing
*
* World Wide Web Consortium W3C Last Call Working Draft 10 November 2003
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#define IN_LIBXML
#include "libxml.h"
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/xpointer.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlerror.h>
#include <libxml/encoding.h>
#ifdef LIBXML_XINCLUDE_ENABLED
#include <libxml/xinclude.h>
/* #define DEBUG_XINCLUDE */
#ifdef DEBUG_XINCLUDE
#ifdef LIBXML_DEBUG_ENABLED
#include <libxml/debugXML.h>
#endif
#endif
/************************************************************************
* *
* XInclude context handling *
* *
************************************************************************/
/*
* An XInclude context
*/
struct _xmlXIncludeRef {
};
struct _xmlXIncludeCtxt {
};
static int
/************************************************************************
* *
* XInclude error handler *
* *
************************************************************************/
/**
* xmlXIncludeErrMemory:
* @extra: extra information
*
* Handle an out of memory condition
*/
static void
const char *extra)
{
"Memory allocation failed : %s\n", extra);
}
/**
* xmlXIncludeErr:
* @ctxt: the XInclude context
* @node: the context node
* @msg: the error message
* @extra: extra information
*
* Handle an XInclude error
*/
static void
{
}
#if 0
/**
* xmlXIncludeWarn:
* @ctxt: the XInclude context
* @node: the context node
* @msg: the error message
* @extra: extra information
*
* Emit an XInclude warning.
*/
static void
{
}
#endif
/**
* xmlXIncludeGetProp:
* @ctxt: the XInclude context
* @cur: the node
* @name: the attribute name
*
* Get an XInclude attribute
*
* Returns the value (to be freed) or NULL if not found
*/
static xmlChar *
return(ret);
return(ret);
}
return(ret);
}
/**
* xmlXIncludeFreeRef:
* @ref: the XInclude reference
*
* Free an XInclude reference
*/
static void
return;
#ifdef DEBUG_XINCLUDE
#endif
#ifdef DEBUG_XINCLUDE
#endif
}
}
/**
* xmlXIncludeNewRef:
* @ctxt: the XInclude context
* @URI: the resource URI
*
* Creates a new reference within an XInclude context
*
* Returns the new set
*/
static xmlXIncludeRefPtr
xmlNodePtr ref) {
#ifdef DEBUG_XINCLUDE
#endif
return(NULL);
}
else
return(NULL);
}
}
return(NULL);
}
}
return(ret);
}
/**
* xmlXIncludeNewContext:
* @doc: an XML Document
*
* Creates a new XInclude context
*
* Returns the new set
*/
#ifdef DEBUG_XINCLUDE
#endif
return(NULL);
"creating XInclude context");
return(NULL);
}
return(ret);
}
/**
* xmlXIncludeURLPush:
* @ctxt: the parser context
* @value: the url
*
* Pushes a new url on top of the url stack
*
* Returns -1 in case of error, the index in the stack otherwise
*/
static int
{
"detected a recursion in %s\n", value);
return(-1);
}
return (-1);
}
}
return (-1);
}
}
}
/**
* xmlXIncludeURLPop:
* @ctxt: the parser context
*
* Pops the top URL from the URL stack
*/
static void
{
return;
else
}
/**
* xmlXIncludeFreeContext:
* @ctxt: the XInclude context
*
* Free an XInclude context
*/
void
int i;
#ifdef DEBUG_XINCLUDE
#endif
return;
}
}
}
}
}
/**
* xmlXIncludeParseFile:
* @ctxt: the XInclude context
* @URL: the URL or file path
*
* parse a document for XInclude
*/
static xmlDocPtr
pctxt = xmlNewParserCtxt();
return(NULL);
}
/*
* pass in the application data to the parser context.
*/
/*
* try to ensure that new documents included are actually
* built with the same dictionary as the including document.
*/
}
if (inputStream == NULL) {
return(NULL);
}
if (pctxt->wellFormed) {
}
else {
}
return(ret);
}
/**
* xmlXIncludeAddNode:
* @ctxt: the XInclude context
* @cur: the new node
*
* Add a new node to process to an XInclude context
*/
static int
int local = 0;
return(-1);
return(-1);
#ifdef DEBUG_XINCLUDE
#endif
/*
* read the attributes
*/
return(-1);
local = 1;
}
if (href[0] == '#')
local = 1;
xml = 1;
xml = 0;
else {
"invalid value %s for 'parse'\n", parse);
return(-1);
}
}
/*
* compute the URI
*/
} else {
}
/*
* Some escaping may be needed
*/
}
"failed build URL\n", NULL);
return(-1);
}
/*
* Check the URL and remove any fragment identifier
*/
"invalid value URI %s\n", URI);
return(-1);
}
} else {
}
} else {
"Invalid fragment identifier in URI %s use the xpointer attribute\n",
URI);
return(-1);
}
}
"invalid value URI %s\n", URI);
return(-1);
}
/*
* Check the URL against the stack for recursions
*/
"detected a recursion in %s\n", URL);
return(-1);
}
}
}
return(-1);
}
return(0);
}
/**
* xmlXIncludeRecurseDoc:
* @ctxt: the XInclude context
* @doc: the new document
* @url: the associated URL
*
* The XInclude recursive nature is handled at this point.
*/
static void
int i;
/*
* Avoid recursion in already substitued resources
for (i = 0;i < ctxt->urlNr;i++) {
if (xmlStrEqual(doc->URL, ctxt->urlTab[i]))
return;
}
*/
#ifdef DEBUG_XINCLUDE
#endif
/*
* Handle recursion here.
*/
/*
* Copy the private user data
*/
/*
* Copy the existing document set
*/
return;
}
/*
* copy the urlTab
*/
/*
* Inherit the existing base
*/
/*
* Inherit the documents already in use by other includes
*/
freeing it */
}
/*
* The new context should also inherit the Parse Flags
* (bug 132597)
*/
}
/* urlTab may have been reallocated */
}
#ifdef DEBUG_XINCLUDE
#endif
}
/**
* xmlXIncludeAddTxt:
* @ctxt: the XInclude context
* @txt: the new text node
* @url: the associated URL
*
* Add a new txtument to the list
*/
static void
#ifdef DEBUG_XINCLUDE
#endif
return;
}
return;
}
}
return;
}
return;
}
}
}
/************************************************************************
* *
* Node copy with specific semantic *
* *
************************************************************************/
/**
* xmlXIncludeCopyNode:
* @ctxt: the XInclude context
* @target: the document target
* @source: the document source
* @elem: the element
*
* Make a copy of the node while preserving the XInclude semantic
* of the Infoset copy
*/
static xmlNodePtr
return(NULL);
return(NULL);
return(result);
}
/**
* xmlXIncludeCopyNodeList:
* @ctxt: the XInclude context
* @target: the document target
* @source: the document source
* @elem: the element list
*
* Make a copy of the node list while preserving the XInclude semantic
* of the Infoset copy
*/
static xmlNodePtr
return(NULL);
} else {
}
}
}
return(result);
}
/**
* xmlXIncludeGetNthChild:
* @cur: the node
* @no: the child number
*
* Returns the @n'th element child of @cur or NULL
*/
static xmlNodePtr
int i;
return(cur);
return(cur);
i++;
if (i == no)
break;
}
}
return(cur);
}
/**
* xmlXIncludeCopyRange:
* @ctxt: the XInclude context
* @target: the document target
* @source: the document source
* @obj: the XPointer result from the evaluation.
*
* Build a node list tree copy of the XPointer result.
*
* Returns an xmlNodePtr list or NULL.
* The caller has to free the node tree.
*/
static xmlNodePtr
/* pointers to generated nodes */
/* pointers to traversal nodes */
return(NULL);
return(NULL);
return(NULL);
/*
* level is depth of the current node under consideration
* list is the pointer to the root of the output tree
* listParent is a pointer to the parent of output tree (within
the included file) in case we need to add another level
* last is a pointer to the last node added to the output tree
* lastLevel is the depth of last (relative to the root)
*/
/*
* Check if our output tree needs a parent
*/
if (level < 0) {
while (level < 0) {
/* copy must include namespaces and properties */
level++;
}
lastLevel = 0;
}
/*
* Check whether we need to change our insertion point
*/
lastLevel --;
}
int len;
} else {
index1 = 0;
} else {
}
}
/* single sub text node selection */
return(tmp);
/* prune and return full set */
else
return(list);
} else { /* ending node not a text node */
endFlag = 1;
/* last node - need to take care of properties + namespaces */
} else {
else {
}
}
if (index2 > 1) {
index2 = 0;
}
index1 = 0;
} else {
}
level++; /* increment level to show change */
/*
* Now gather the remaining nodes from cur to end
*/
continue; /* while */
}
} else {
if (index1 > 1) {
index1 = 0;
}
}
} else { /* Not text node */
/*
* start of the range - need to take care of
* properties and namespaces
*/
index1 = 0;
/*
* Now gather the remaining nodes from cur to end
*/
continue; /* while */
}
}
} else {
case XML_DTD_NODE:
case XML_ELEMENT_DECL:
case XML_ATTRIBUTE_DECL:
case XML_ENTITY_NODE:
/* Do not copy DTD informations */
break;
case XML_ENTITY_DECL:
/* handle crossing entities -> stack needed */
break;
case XML_XINCLUDE_START:
case XML_XINCLUDE_END:
/* don't consider it part of the tree content */
break;
case XML_ATTRIBUTE_NODE:
/* Humm, should not happen ! */
break;
default:
/*
* Middle of the range - need to take care of
* properties and namespaces
*/
break;
}
else {
}
}
}
/*
* Skip to next node in document order
*/
break;
}
return(list);
}
/**
* xmlXIncludeBuildNodeList:
* @ctxt: the XInclude context
* @target: the document target
* @source: the document source
* @obj: the XPointer result from the evaluation.
*
* Build a node list tree copy of the XPointer result.
* This will drop Attributes and Namespace declarations.
*
* Returns an xmlNodePtr list or NULL.
* the caller has to free the node tree.
*/
static xmlNodePtr
int i;
return(NULL);
case XPATH_NODESET: {
return(NULL);
continue;
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_ELEMENT_NODE:
case XML_ENTITY_REF_NODE:
case XML_ENTITY_NODE:
case XML_PI_NODE:
case XML_COMMENT_NODE:
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:
#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
#endif
case XML_XINCLUDE_END:
break;
case XML_XINCLUDE_START: {
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_ELEMENT_NODE:
case XML_ENTITY_REF_NODE:
case XML_ENTITY_NODE:
case XML_PI_NODE:
case XML_COMMENT_NODE:
} else {
}
continue;
default:
break;
}
break;
}
continue;
}
case XML_ATTRIBUTE_NODE:
case XML_NAMESPACE_DECL:
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:
continue; /* for */
}
else {
}
}
break;
}
case XPATH_LOCATIONSET: {
return(NULL);
else
}
}
break;
}
#ifdef LIBXML_XPTR_ENABLED
case XPATH_RANGE:
#endif
case XPATH_POINT:
/* points are ignored in XInclude */
break;
default:
break;
}
return(list);
}
/************************************************************************
* *
* XInclude I/O handling *
* *
************************************************************************/
struct _xmlXIncludeMergeData {
};
/**
* xmlXIncludeMergeOneEntity:
* @ent: the entity
* @doc: the including doc
* @nr: the entity name
*
* Inplements the merge of one entity
*/
static void
return;
return;
return;
break;
}
} else {
goto error;
goto error;
goto error;
goto error;
} else {
goto error;
}
}
}
return;
return;
break;
}
"mismatch in redefinition of entity %s\n",
}
/**
* xmlXIncludeMergeEntities:
* @ctxt: an XInclude context
* @doc: the including doc
* @from: the included doc
*
* Inplements the entity merge
*
* Returns 0 if merge succeeded, -1 if some processing failed
*/
static int
return(-1);
return(0);
return(-1);
return(-1);
}
}
/*
* don't duplicate existing stuff when external subsets are the same
*/
}
}
return(0);
}
/**
* xmlXIncludeLoadDoc:
* @ctxt: the XInclude context
* @url: the associated URL
* @nr: the xinclude node number
*
* Load the document, and store the result in the XInclude context
*
* Returns 0 in case of success, -1 in case of failure
*/
static int
int i = 0;
#ifdef LIBXML_XPTR_ENABLED
int saveFlags;
#endif
#ifdef DEBUG_XINCLUDE
#endif
/*
* Check the URL and remove any fragment identifier
*/
"invalid value URI %s\n", url);
return(-1);
}
}
}
"invalid value URI %s\n", url);
else
"invalid value URI %s\n", url);
return(-1);
}
/*
* Handling of references to the local document are done
* directly through ctxt->doc.
*/
goto loaded;
}
/*
* Prevent reloading twice the document.
*/
#ifdef DEBUG_XINCLUDE
#endif
goto loaded;
}
}
/*
* Load it.
*/
#ifdef DEBUG_XINCLUDE
#endif
#ifdef LIBXML_XPTR_ENABLED
/*
* If this is an XPointer evaluation, we want to assure that
* all entities have been resolved prior to processing the
* referenced document
*/
}
#endif
#ifdef LIBXML_XPTR_ENABLED
#endif
return(-1);
}
/*
* It's possible that the requested URL has been mapped to a
* completely different location (e.g. through a catalog entry).
* To check for this, we compare the URL with that of the doc
* and change it if they disagree (bug 146988).
*/
}
#ifdef DEBUG_XINCLUDE
#endif
break;
}
}
/*
* Make sure we have all entities fixed up
*/
/*
* We don't need the DTD anymore, free up space
if (doc->intSubset != NULL) {
xmlUnlinkNode((xmlNodePtr) doc->intSubset);
xmlFreeNode((xmlNodePtr) doc->intSubset);
doc->intSubset = NULL;
}
if (doc->extSubset != NULL) {
xmlUnlinkNode((xmlNodePtr) doc->extSubset);
xmlFreeNode((xmlNodePtr) doc->extSubset);
doc->extSubset = NULL;
}
*/
/*
* Add the top children list as the replacement copy.
*/
{
/* Hopefully a DTD declaration won't be copied from
* the same document */
} else {
}
}
#ifdef LIBXML_XPTR_ENABLED
else {
/*
* Computes the XPointer expression and make a copy used
* as the replacement copy.
*/
NULL);
} else {
}
"could not create XPointer context\n", NULL);
return(-1);
}
"XPointer evaluation failed: #%s\n",
fragment);
return(-1);
}
case XPATH_UNDEFINED:
case XPATH_BOOLEAN:
case XPATH_NUMBER:
case XPATH_STRING:
case XPATH_POINT:
case XPATH_USERS:
case XPATH_XSLT_TREE:
"XPointer is not a range: #%s\n",
fragment);
return(-1);
case XPATH_NODESET:
return(-1);
}
case XPATH_RANGE:
case XPATH_LOCATIONSET:
break;
}
continue;
case XML_ELEMENT_NODE:
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_ENTITY_REF_NODE:
case XML_ENTITY_NODE:
case XML_PI_NODE:
case XML_COMMENT_NODE:
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:
#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
#endif
continue;
case XML_ATTRIBUTE_NODE:
"XPointer selects an attribute: #%s\n",
fragment);
continue;
case XML_NAMESPACE_DECL:
"XPointer selects a namespace: #%s\n",
fragment);
continue;
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_XINCLUDE_START:
case XML_XINCLUDE_END:
"XPointer selects unexpected nodes: #%s\n",
fragment);
continue; /* for */
}
}
}
} else {
}
}
#endif
/*
* Do the xml:base fixup if needed
*/
/*
* The base is only adjusted if "necessary", i.e. if the xinclude node
* has a base specified, or the URL is relative
*/
/*
* No xml:base on the xinclude node, so we check whether the
* URI base is different than (relative to) the context base
*/
"trying to build relative URI from %s\n", URL);
} else {
/* If the URI doesn't contain a slash, it's not relative */
else
}
}
/* Only work on element nodes */
/* If no current base, set it */
} else {
/*
* If the current base is the same as the
* URL of the document, then reset it to be
* the specified xml:base or the relative URI
*/
} else {
/*
* If the element already has an xml:base
* set, then relativise it if necessary
*/
BAD_CAST "base",
"trying to rebuild base from %s\n",
xmlBase);
} else {
}
}
}
}
}
}
}
}
#ifdef DEBUG_XINCLUDE
#endif
}
return(0);
}
/**
* xmlXIncludeLoadTxt:
* @ctxt: the XInclude context
* @url: the associated URL
* @nr: the xinclude node number
*
* Load the content, and store the result in the XInclude context
*
* Returns 0 in case of success, -1 in case of failure
*/
static int
int i;
/*
* Check the URL and remove any fragment identifier
*/
"invalid value URI %s\n", url);
return(-1);
}
"fragment identifier forbidden for text: %s\n",
return(-1);
}
"invalid value URI %s\n", url);
return(-1);
}
/*
* Handling of references to the local document are done
* directly through ctxt->doc.
*/
if (URL[0] == 0) {
"text serialization of document not available\n", NULL);
return(-1);
}
/*
* Prevent reloading twice the document.
*/
goto loaded;
}
}
/*
* Try to get the encoding if available
*/
}
/*
* TODO: we should not have to remap to the xmlCharEncoding
* predefined set, a better interface than
* xmlParserInputBufferCreateFilename should allow any
* encoding supported by iconv
*/
if (enc == XML_CHAR_ENCODING_ERROR) {
"encoding %s not supported\n", encoding);
return(-1);
}
}
/*
* Load it.
*/
return(-1);
}
/*
* Scan all chars from the resource and add the to the node
*/
int len;
for (i = 0;i < len;) {
int cur;
int l;
"%s contains invalid char\n", URL);
return(-1);
} else {
}
i += l;
}
}
/*
* Add the element as the replacement copy.
*/
return(0);
}
/**
* xmlXIncludeLoadFallback:
* @ctxt: the XInclude context
* @fallback: the fallback node
* @nr: the xinclude node number
*
* Load the content of the fallback node, and store the result
* in the XInclude context
*
* Returns 0 in case of success, -1 in case of failure
*/
static int
int ret = 0;
return(-1);
/*
* It's possible that the fallback also has 'includes'
* (Bug 129969), so we re-process the fallback just in case
*/
return (-1);
ret = -1;
else if (ret > 0)
ret = 0; /* xmlXIncludeDoProcess can return +ve number */
} else {
}
return(ret);
}
/************************************************************************
* *
* XInclude Processing *
* *
************************************************************************/
/**
* xmlXIncludePreProcessNode:
* @ctxt: an XInclude context
* @node: an XInclude node
*
* Implement the XInclude preprocessing, currently just adding the element
* for further processing.
*
* Returns the result list or NULL in case of error
*/
static xmlNodePtr
return(NULL);
}
/**
* xmlXIncludeLoadNode:
* @ctxt: an XInclude context
* @nr: the node number
*
* Find and load the infoset replacement for the given node.
*
* Returns 0 if substitution succeeded, -1 if some processing failed
*/
static int
int ret;
return(-1);
return(-1);
return(-1);
/*
* read the attributes
*/
return(-1);
}
xml = 1;
xml = 0;
else {
"invalid value %s for 'parse'\n", parse);
return(-1);
}
}
/*
* compute the URI
*/
} else {
}
/*
* Some escaping may be needed
*/
}
return(-1);
}
#ifdef DEBUG_XINCLUDE
#endif
/*
* Save the base for this include (saving the current one)
*/
if (xml) {
/* xmlXIncludeGetFragment(ctxt, cur, URI); */
} else {
}
/*
* Restore the original base before checking for fallback
*/
if (ret < 0) {
/*
* Time to try a fallback if availble
*/
#ifdef DEBUG_XINCLUDE
#endif
if (ret == 0)
break;
}
}
}
if (ret < 0) {
"could not load %s, and no fallback was found\n",
URI);
}
/*
* Cleanup
*/
return(0);
}
/**
* xmlXIncludeIncludeNode:
* @ctxt: an XInclude context
* @nr: the node number
*
* Inplement the infoset replacement for the given node
*
* Returns 0 if substitution succeeded, -1 if some processing failed
*/
static int
return(-1);
return(-1);
return(-1);
/*
* If we stored an XPointer a late computation may be needed
*/
}
/*
* Check against the risk of generating a multi-rooted document
*/
int nb_elem = 0;
nb_elem++;
}
if (nb_elem > 1) {
"XInclude error: would result in multiple root nodes\n",
NULL);
return(-1);
}
}
/*
* Add the list of nodes
*/
}
} else {
/*
* Change the current node as an XInclude start one, and add an
* XInclude end one
*/
"failed to build node\n", NULL);
return(-1);
}
/*
* Add the list of nodes
*/
}
}
return(0);
}
/**
* xmlXIncludeTestNode:
* @ctxt: the XInclude processing context
* @node: an XInclude node
*
* test if the node is an XInclude node
*
* Returns 1 true, 0 otherwise
*/
static int
return(0);
return(0);
return(0);
#if 0 /* wait for the XML Core Working Group to get something stable ! */
"Deprecated XInclude namespace found, use %s",
#endif
}
}
int nb_fallback = 0;
"%s has an 'include' child\n",
return(0);
}
nb_fallback++;
}
}
}
if (nb_fallback > 1) {
"%s has multiple fallback children\n",
return(0);
}
return(1);
}
"%s is not the child of an 'include'\n",
}
}
}
return(0);
}
/**
* xmlXIncludeDoProcess:
* @ctxt: the XInclude processing context
* @doc: an XML document
* @tree: the top of the tree to process
*
* Implement the XInclude substitution on the XML document @doc
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
static int
int ret = 0;
int i, start;
return(-1);
return(-1);
if (ret < 0)
return(-1);
}
/*
* First phase: lookup the elements in the document
*/
/* TODO: need to work on entities -> stack */
} else {
break;
do {
break; /* do */
break; /* do */
}
}
}
/*
* Second Phase : collect the infosets fragments
*/
xmlXIncludeLoadNode(ctxt, i);
ret++;
}
/*
* Third phase: extend the original document infoset.
*
* Originally we bypassed the inclusion if there were any errors
* encountered on any of the XIncludes. A bug was raised (bug
* 132588) requesting that we output the XIncludes without error,
* so the check for inc!=NULL || xptr!=NULL was put in. This may
* give some other problems in the future, but for now it seems to
* work ok.
*
*/
}
return(ret);
}
/**
* xmlXIncludeSetFlags:
* @ctxt: an XInclude processing context
* @flags: a set of xmlParserOption used for parsing XML includes
*
* Set the flags used for further processing of XML resources.
*
* Returns 0 in case of success and -1 in case of error.
*/
int
return(-1);
return(0);
}
/**
* xmlXIncludeProcessFlagsData:
* @doc: an XML document
* @flags: a set of xmlParserOption used for parsing XML includes
* @data: application data that will be passed to the parser context
* in the _private field of the parser context(s)
*
* Implement the XInclude substitution on the XML document @doc
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
int ret = 0;
return(-1);
return(-1);
return(-1);
ret = -1;
return(ret);
}
/**
* xmlXIncludeProcessFlags:
* @doc: an XML document
* @flags: a set of xmlParserOption used for parsing XML includes
*
* Implement the XInclude substitution on the XML document @doc
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
}
/**
* xmlXIncludeProcess:
* @doc: an XML document
*
* Implement the XInclude substitution on the XML document @doc
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
return(xmlXIncludeProcessFlags(doc, 0));
}
/**
* xmlXIncludeProcessTreeFlags:
* @tree: a node in an XML document
* @flags: a set of xmlParserOption used for parsing XML includes
*
* Implement the XInclude substitution for the given subtree
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
int ret = 0;
return(-1);
return(-1);
ret = -1;
return(ret);
}
/**
* xmlXIncludeProcessTree:
* @tree: a node in an XML document
*
* Implement the XInclude substitution for the given subtree
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
return(xmlXIncludeProcessTreeFlags(tree, 0));
}
/**
* xmlXIncludeProcessNode:
* @ctxt: an existing XInclude context
* @node: a node in an XML document
*
* Implement the XInclude substitution for the given subtree reusing
* the informations and data coming from the given context.
*
* Returns 0 if no substitution were done, -1 if some processing failed
* or the number of substitutions done.
*/
int
int ret = 0;
return(-1);
ret = -1;
return(ret);
}
#else /* !LIBXML_XINCLUDE_ENABLED */
#endif
#define bottom_xinclude
#include "elfgcchack.h"