mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-08 21:42:07 +03:00
Refactored xsltValueOf(). Changed to use xmlXPathCastToString() directly,
* libxslt/attributes.c libxslt/documents.c libxslt/functions.c libxslt/keys.c libxslt/namespaces.c libxslt/pattern.c libxslt/preproc.c libxslt/templates.c libxslt/templates.h libxslt/transform.c libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c libxslt/xsltutils.h libexslt/common.c libexslt/dynamic.c libexslt/functions.c libexslt/strings.c: Refactored xsltValueOf(). Changed to use xmlXPathCastToString() directly, rather than creating an intermediate object with xmlXPathConvertString(). This now does not add a text-node to the result if the string is empty (this has impact on serialization, since an empty text-node is serialized as <foo></foo>, and now it will be serialized as <foo/>). Refactored other functions in transform.c: Mostly code cleanup/restructuring. Minimized number of function variables for instruction which eat up function stack memory when recursing templates (xsltIf(), xsltChoose(), xsltApplyTemplates(), xsltCallTemplate()). Changed XSLT tests to use xmlXPathCompiledEvalToBoolean(). Implemented redefinition checks at compilation-time and eliminating them at transformation time in the refactored code paths. Introduced the field @currentTemplateRule on xsltTransformContext to reflect the "Current Template Rule" as defined by the spec. NOTE that ctxt->currentTemplateRule and ctxt->templ is not the same; the former is the "Current Template Rule" as defined by the XSLT spec, the latter is simply the template struct being currently processed by Libxslt. Added XML_COMMENT_NODE and XML_CDATA_SECTION_NODE to the macro IS_XSLT_REAL_NODE. Misc code cleanup/restructuring and everything else I already forgot. Refactored lifetime of temporary result tree fragments. Substituted all calls to the now deprecated xsltRegisterTmpRVT() for the new xsltRegisterLocalRVT(). Fragments of xsl:variable and xsl:param are freed when the variable/pram is freed. Fragments created when evaluating a "select" of xsl:varible and xsl:param are also bound to the lifetime of the var/param. EXSLT's func:function now uses the following functions to let take care the transformation's garbage collector of returned tree fragments: xsltExtensionInstructionResultRegister(), xsltExtensionInstructionResultFinalize() Fixes: #339222 - xsl:param at invalid position inside an xsl:template is not catched #346015 - Non-declared caller-parameters are accepted #160400 - Compiles invalid XSLT; unbound variable accepted #308441 - namespaced parameters become unregistered #307103 - problem with proximity position in predicates of match patterns #328218 - problem with exsl:node-set() when converting strings to node sets #318088 - infinite recursion detection #321505 - Multiple contiguous CDATA in output #334493 - "--param" option does not have root context #114377 - weird func:result/xsl:variable/exsl:node-set interaction #150309 - Regression caused by fix for 142768
This commit is contained in:
61
ChangeLog
61
ChangeLog
@@ -1,3 +1,64 @@
|
|||||||
|
Fri Jul 14 17:55:42 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
||||||
|
|
||||||
|
* libxslt/attributes.c libxslt/documents.c
|
||||||
|
libxslt/functions.c libxslt/keys.c libxslt/namespaces.c
|
||||||
|
libxslt/pattern.c libxslt/preproc.c libxslt/templates.c
|
||||||
|
libxslt/templates.h libxslt/transform.c libxslt/variables.c
|
||||||
|
libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c
|
||||||
|
libxslt/xsltutils.h libexslt/common.c libexslt/dynamic.c
|
||||||
|
libexslt/functions.c libexslt/strings.c:
|
||||||
|
Refactored xsltValueOf(). Changed to use xmlXPathCastToString()
|
||||||
|
directly, rather than creating an intermediate object with
|
||||||
|
xmlXPathConvertString(). This now does not add a text-node to
|
||||||
|
the result if the string is empty (this has impact on
|
||||||
|
serialization, since an empty text-node is serialized as
|
||||||
|
<foo></foo>, and now it will be serialized as <foo/>).
|
||||||
|
Refactored other functions in transform.c:
|
||||||
|
Mostly code cleanup/restructuring. Minimized number of
|
||||||
|
function variables for instruction which eat up function stack
|
||||||
|
memory when recursing templates (xsltIf(), xsltChoose(),
|
||||||
|
xsltApplyTemplates(), xsltCallTemplate()).
|
||||||
|
Changed XSLT tests to use xmlXPathCompiledEvalToBoolean().
|
||||||
|
Implemented redefinition checks at compilation-time and
|
||||||
|
eliminating them at transformation time in the refactored code
|
||||||
|
paths.
|
||||||
|
Introduced the field @currentTemplateRule on xsltTransformContext to
|
||||||
|
reflect the "Current Template Rule" as defined by the spec.
|
||||||
|
NOTE that ctxt->currentTemplateRule and ctxt->templ is not the
|
||||||
|
same; the former is the "Current Template Rule" as defined by the
|
||||||
|
XSLT spec, the latter is simply the template struct being
|
||||||
|
currently processed by Libxslt.
|
||||||
|
Added XML_COMMENT_NODE and XML_CDATA_SECTION_NODE to the macro
|
||||||
|
IS_XSLT_REAL_NODE.
|
||||||
|
Misc code cleanup/restructuring and everything else I already forgot.
|
||||||
|
Refactored lifetime of temporary result tree fragments.
|
||||||
|
Substituted all calls to the now deprecated xsltRegisterTmpRVT()
|
||||||
|
for the new xsltRegisterLocalRVT().
|
||||||
|
Fragments of xsl:variable and xsl:param are freed when the
|
||||||
|
variable/pram is freed.
|
||||||
|
Fragments created when evaluating a "select" of xsl:varible and
|
||||||
|
xsl:param are also bound to the lifetime of the var/param.
|
||||||
|
EXSLT's func:function now uses the following functions to let take
|
||||||
|
care the transformation's garbage collector of returned tree
|
||||||
|
fragments:
|
||||||
|
xsltExtensionInstructionResultRegister(),
|
||||||
|
xsltExtensionInstructionResultFinalize()
|
||||||
|
Fixes:
|
||||||
|
#339222 - xsl:param at invalid position inside an xsl:template is
|
||||||
|
not catched
|
||||||
|
#346015 - Non-declared caller-parameters are accepted
|
||||||
|
#160400 - Compiles invalid XSLT; unbound variable accepted
|
||||||
|
#308441 - namespaced parameters become unregistered
|
||||||
|
#307103 - problem with proximity position in predicates of match
|
||||||
|
patterns
|
||||||
|
#328218 - problem with exsl:node-set() when converting strings
|
||||||
|
to node sets
|
||||||
|
#318088 - infinite recursion detection
|
||||||
|
#321505 - Multiple contiguous CDATA in output
|
||||||
|
#334493 - "--param" option does not have root context
|
||||||
|
#114377 - weird func:result/xsl:variable/exsl:node-set interaction
|
||||||
|
#150309 - Regression caused by fix for 142768
|
||||||
|
|
||||||
Wed Jun 21 15:13:27 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
Wed Jun 21 15:13:27 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
||||||
|
|
||||||
* tests/docs/bug-54.xml tests/general/bug-54.out
|
* tests/docs/bug-54.xml tests/general/bug-54.out
|
||||||
|
@@ -1,116 +1,131 @@
|
|||||||
#define IN_LIBEXSLT
|
#define IN_LIBEXSLT
|
||||||
#include "libexslt/libexslt.h"
|
#include "libexslt/libexslt.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
|
#if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
|
||||||
#include <win32config.h>
|
#include <win32config.h>
|
||||||
#else
|
#else
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#include <libxml/xpathInternals.h>
|
#include <libxml/xpathInternals.h>
|
||||||
|
|
||||||
#include <libxslt/xsltconfig.h>
|
#include <libxslt/xsltconfig.h>
|
||||||
#include <libxslt/xsltutils.h>
|
#include <libxslt/xsltutils.h>
|
||||||
#include <libxslt/xsltInternals.h>
|
#include <libxslt/xsltInternals.h>
|
||||||
#include <libxslt/extensions.h>
|
#include <libxslt/extensions.h>
|
||||||
#include <libxslt/transform.h>
|
#include <libxslt/transform.h>
|
||||||
#include <libxslt/extra.h>
|
#include <libxslt/extra.h>
|
||||||
#include <libxslt/preproc.h>
|
#include <libxslt/preproc.h>
|
||||||
|
|
||||||
#include "exslt.h"
|
#include "exslt.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
exsltNodeSetFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
exsltNodeSetFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||||
xmlChar *strval;
|
if (nargs != 1) {
|
||||||
xmlNodePtr retNode;
|
xmlXPathSetArityError(ctxt);
|
||||||
xmlXPathObjectPtr ret;
|
return;
|
||||||
|
}
|
||||||
if (nargs != 1) {
|
if (xmlXPathStackIsNodeSet (ctxt)) {
|
||||||
xmlXPathSetArityError(ctxt);
|
xsltFunctionNodeSet (ctxt, nargs);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
|
xmlDocPtr fragment;
|
||||||
if (xmlXPathStackIsNodeSet (ctxt)) {
|
xsltTransformContextPtr tctxt = xsltXPathGetTransformContext(ctxt);
|
||||||
xsltFunctionNodeSet (ctxt, nargs);
|
xmlNodePtr txt;
|
||||||
return;
|
xmlChar *strval;
|
||||||
}
|
xmlXPathObjectPtr obj;
|
||||||
|
/*
|
||||||
strval = xmlXPathPopString (ctxt);
|
* SPEC EXSLT:
|
||||||
retNode = xmlNewDocText (NULL, strval);
|
* "You can also use this function to turn a string into a text
|
||||||
ret = xmlXPathNewValueTree (retNode);
|
* node, which is helpful if you want to pass a string to a
|
||||||
if (ret == NULL) {
|
* function that only accepts a node-set."
|
||||||
xsltGenericError(xsltGenericErrorContext,
|
*/
|
||||||
"exsltNodeSetFunction: ret == NULL\n");
|
fragment = xsltCreateRVT(tctxt);
|
||||||
} else {
|
if (fragment == NULL) {
|
||||||
ret->type = XPATH_NODESET;
|
xsltTransformError(tctxt, NULL, tctxt->inst,
|
||||||
}
|
"exsltNodeSetFunction: Failed to create a tree fragment.\n");
|
||||||
|
tctxt->state = XSLT_STATE_STOPPED;
|
||||||
if (strval != NULL)
|
return;
|
||||||
xmlFree (strval);
|
}
|
||||||
|
xsltRegisterLocalRVT(tctxt, fragment);
|
||||||
valuePush (ctxt, ret);
|
|
||||||
}
|
strval = xmlXPathPopString (ctxt);
|
||||||
|
|
||||||
static void
|
txt = xmlNewDocText (fragment, strval);
|
||||||
exsltObjectTypeFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
xmlAddChild((xmlNodePtr) fragment, txt);
|
||||||
xmlXPathObjectPtr obj, ret;
|
obj = xmlXPathNewNodeSet(txt);
|
||||||
|
if (obj == NULL) {
|
||||||
if (nargs != 1) {
|
xsltTransformError(tctxt, NULL, tctxt->inst,
|
||||||
xmlXPathSetArityError(ctxt);
|
"exsltNodeSetFunction: Failed to create a node set object.\n");
|
||||||
return;
|
tctxt->state = XSLT_STATE_STOPPED;
|
||||||
}
|
}
|
||||||
|
if (strval != NULL)
|
||||||
obj = valuePop(ctxt);
|
xmlFree (strval);
|
||||||
|
|
||||||
switch (obj->type) {
|
valuePush (ctxt, obj);
|
||||||
case XPATH_STRING:
|
}
|
||||||
ret = xmlXPathNewCString("string");
|
}
|
||||||
break;
|
|
||||||
case XPATH_NUMBER:
|
static void
|
||||||
ret = xmlXPathNewCString("number");
|
exsltObjectTypeFunction (xmlXPathParserContextPtr ctxt, int nargs) {
|
||||||
break;
|
xmlXPathObjectPtr obj, ret;
|
||||||
case XPATH_BOOLEAN:
|
|
||||||
ret = xmlXPathNewCString("boolean");
|
if (nargs != 1) {
|
||||||
break;
|
xmlXPathSetArityError(ctxt);
|
||||||
case XPATH_NODESET:
|
return;
|
||||||
ret = xmlXPathNewCString("node-set");
|
}
|
||||||
break;
|
|
||||||
case XPATH_XSLT_TREE:
|
obj = valuePop(ctxt);
|
||||||
ret = xmlXPathNewCString("RTF");
|
|
||||||
break;
|
switch (obj->type) {
|
||||||
case XPATH_USERS:
|
case XPATH_STRING:
|
||||||
ret = xmlXPathNewCString("external");
|
ret = xmlXPathNewCString("string");
|
||||||
break;
|
break;
|
||||||
default:
|
case XPATH_NUMBER:
|
||||||
xsltGenericError(xsltGenericErrorContext,
|
ret = xmlXPathNewCString("number");
|
||||||
"object-type() invalid arg\n");
|
break;
|
||||||
ctxt->error = XPATH_INVALID_TYPE;
|
case XPATH_BOOLEAN:
|
||||||
xmlXPathFreeObject(obj);
|
ret = xmlXPathNewCString("boolean");
|
||||||
return;
|
break;
|
||||||
}
|
case XPATH_NODESET:
|
||||||
xmlXPathFreeObject(obj);
|
ret = xmlXPathNewCString("node-set");
|
||||||
valuePush(ctxt, ret);
|
break;
|
||||||
}
|
case XPATH_XSLT_TREE:
|
||||||
|
ret = xmlXPathNewCString("RTF");
|
||||||
|
break;
|
||||||
/**
|
case XPATH_USERS:
|
||||||
* exsltCommonRegister:
|
ret = xmlXPathNewCString("external");
|
||||||
*
|
break;
|
||||||
* Registers the EXSLT - Common module
|
default:
|
||||||
*/
|
xsltGenericError(xsltGenericErrorContext,
|
||||||
|
"object-type() invalid arg\n");
|
||||||
void
|
ctxt->error = XPATH_INVALID_TYPE;
|
||||||
exsltCommonRegister (void) {
|
xmlXPathFreeObject(obj);
|
||||||
xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
|
return;
|
||||||
EXSLT_COMMON_NAMESPACE,
|
}
|
||||||
exsltNodeSetFunction);
|
xmlXPathFreeObject(obj);
|
||||||
xsltRegisterExtModuleFunction((const xmlChar *) "object-type",
|
valuePush(ctxt, ret);
|
||||||
EXSLT_COMMON_NAMESPACE,
|
}
|
||||||
exsltObjectTypeFunction);
|
|
||||||
xsltRegisterExtModuleElement((const xmlChar *) "document",
|
|
||||||
EXSLT_COMMON_NAMESPACE,
|
/**
|
||||||
(xsltPreComputeFunction) xsltDocumentComp,
|
* exsltCommonRegister:
|
||||||
(xsltTransformFunction) xsltDocumentElem);
|
*
|
||||||
}
|
* Registers the EXSLT - Common module
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
exsltCommonRegister (void) {
|
||||||
|
xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
|
||||||
|
EXSLT_COMMON_NAMESPACE,
|
||||||
|
exsltNodeSetFunction);
|
||||||
|
xsltRegisterExtModuleFunction((const xmlChar *) "object-type",
|
||||||
|
EXSLT_COMMON_NAMESPACE,
|
||||||
|
exsltObjectTypeFunction);
|
||||||
|
xsltRegisterExtModuleElement((const xmlChar *) "document",
|
||||||
|
EXSLT_COMMON_NAMESPACE,
|
||||||
|
(xsltPreComputeFunction) xsltDocumentComp,
|
||||||
|
(xsltTransformFunction) xsltDocumentElem);
|
||||||
|
}
|
||||||
|
@@ -1,274 +1,274 @@
|
|||||||
/*
|
/*
|
||||||
* dynamic.c: Implementation of the EXSLT -- Dynamic module
|
* dynamic.c: Implementation of the EXSLT -- Dynamic module
|
||||||
*
|
*
|
||||||
* References:
|
* References:
|
||||||
* http://www.exslt.org/dyn/dyn.html
|
* http://www.exslt.org/dyn/dyn.html
|
||||||
*
|
*
|
||||||
* See Copyright for the status of this software.
|
* See Copyright for the status of this software.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Mark Vakoc <mark_vakoc@jdedwards.com>
|
* Mark Vakoc <mark_vakoc@jdedwards.com>
|
||||||
* Thomas Broyer <tbroyer@ltgt.net>
|
* Thomas Broyer <tbroyer@ltgt.net>
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
* elements:
|
* elements:
|
||||||
* functions:
|
* functions:
|
||||||
* min
|
* min
|
||||||
* max
|
* max
|
||||||
* sum
|
* sum
|
||||||
* map
|
* map
|
||||||
* closure
|
* closure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IN_LIBEXSLT
|
#define IN_LIBEXSLT
|
||||||
#include "libexslt/libexslt.h"
|
#include "libexslt/libexslt.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
|
#if defined(WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
|
||||||
#include <win32config.h>
|
#include <win32config.h>
|
||||||
#else
|
#else
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#include <libxml/xpathInternals.h>
|
#include <libxml/xpathInternals.h>
|
||||||
|
|
||||||
#include <libxslt/xsltconfig.h>
|
#include <libxslt/xsltconfig.h>
|
||||||
#include <libxslt/xsltutils.h>
|
#include <libxslt/xsltutils.h>
|
||||||
#include <libxslt/xsltInternals.h>
|
#include <libxslt/xsltInternals.h>
|
||||||
#include <libxslt/extensions.h>
|
#include <libxslt/extensions.h>
|
||||||
|
|
||||||
#include "exslt.h"
|
#include "exslt.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exsltDynEvaluateFunction:
|
* exsltDynEvaluateFunction:
|
||||||
* @ctxt: an XPath parser context
|
* @ctxt: an XPath parser context
|
||||||
* @nargs: the number of arguments
|
* @nargs: the number of arguments
|
||||||
*
|
*
|
||||||
* Evaluates the string as an XPath expression and returns the result
|
* Evaluates the string as an XPath expression and returns the result
|
||||||
* value, which may be a boolean, number, string, node set, result tree
|
* value, which may be a boolean, number, string, node set, result tree
|
||||||
* fragment or external object.
|
* fragment or external object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
exsltDynEvaluateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
exsltDynEvaluateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||||
xmlChar *str = NULL;
|
xmlChar *str = NULL;
|
||||||
xmlXPathObjectPtr ret = NULL;
|
xmlXPathObjectPtr ret = NULL;
|
||||||
|
|
||||||
if (ctxt == NULL)
|
if (ctxt == NULL)
|
||||||
return;
|
return;
|
||||||
if (nargs != 1) {
|
if (nargs != 1) {
|
||||||
xsltPrintErrorContext(xsltXPathGetTransformContext(ctxt), NULL, NULL);
|
xsltPrintErrorContext(xsltXPathGetTransformContext(ctxt), NULL, NULL);
|
||||||
xsltGenericError(xsltGenericErrorContext,
|
xsltGenericError(xsltGenericErrorContext,
|
||||||
"dyn:evalute() : invalid number of args %d\n", nargs);
|
"dyn:evalute() : invalid number of args %d\n", nargs);
|
||||||
ctxt->error = XPATH_INVALID_ARITY;
|
ctxt->error = XPATH_INVALID_ARITY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
str = xmlXPathPopString(ctxt);
|
str = xmlXPathPopString(ctxt);
|
||||||
/* return an empty node-set if an empty string is passed in */
|
/* return an empty node-set if an empty string is passed in */
|
||||||
if (!str||!xmlStrlen(str)) {
|
if (!str||!xmlStrlen(str)) {
|
||||||
if (str) xmlFree(str);
|
if (str) xmlFree(str);
|
||||||
valuePush(ctxt,xmlXPathNewNodeSet(NULL));
|
valuePush(ctxt,xmlXPathNewNodeSet(NULL));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ret = xmlXPathEval(str,ctxt->context);
|
ret = xmlXPathEval(str,ctxt->context);
|
||||||
if (ret)
|
if (ret)
|
||||||
valuePush(ctxt,ret);
|
valuePush(ctxt,ret);
|
||||||
else {
|
else {
|
||||||
xsltGenericError(xsltGenericErrorContext,
|
xsltGenericError(xsltGenericErrorContext,
|
||||||
"dyn:evaluate() : unable to evaluate expression '%s'\n",str);
|
"dyn:evaluate() : unable to evaluate expression '%s'\n",str);
|
||||||
valuePush(ctxt,xmlXPathNewNodeSet(NULL));
|
valuePush(ctxt,xmlXPathNewNodeSet(NULL));
|
||||||
}
|
}
|
||||||
xmlFree(str);
|
xmlFree(str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exsltDynMapFunction:
|
* exsltDynMapFunction:
|
||||||
* @ctxt: an XPath parser context
|
* @ctxt: an XPath parser context
|
||||||
* @nargs: the number of arguments
|
* @nargs: the number of arguments
|
||||||
*
|
*
|
||||||
* Evaluates the string as an XPath expression and returns the result
|
* Evaluates the string as an XPath expression and returns the result
|
||||||
* value, which may be a boolean, number, string, node set, result tree
|
* value, which may be a boolean, number, string, node set, result tree
|
||||||
* fragment or external object.
|
* fragment or external object.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||||
{
|
{
|
||||||
xmlChar *str = NULL;
|
xmlChar *str = NULL;
|
||||||
xmlNodeSetPtr nodeset = NULL;
|
xmlNodeSetPtr nodeset = NULL;
|
||||||
xmlXPathCompExprPtr comp = NULL;
|
xmlXPathCompExprPtr comp = NULL;
|
||||||
xmlXPathObjectPtr ret = NULL;
|
xmlXPathObjectPtr ret = NULL;
|
||||||
xmlDocPtr oldDoc, container;
|
xmlDocPtr oldDoc, container;
|
||||||
xmlNodePtr oldNode;
|
xmlNodePtr oldNode;
|
||||||
int oldContextSize;
|
int oldContextSize;
|
||||||
int oldProximityPosition;
|
int oldProximityPosition;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
|
||||||
if (nargs != 2) {
|
if (nargs != 2) {
|
||||||
xmlXPathSetArityError(ctxt);
|
xmlXPathSetArityError(ctxt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
str = xmlXPathPopString(ctxt);
|
str = xmlXPathPopString(ctxt);
|
||||||
if (xmlXPathCheckError(ctxt)) {
|
if (xmlXPathCheckError(ctxt)) {
|
||||||
xmlXPathSetTypeError(ctxt);
|
xmlXPathSetTypeError(ctxt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeset = xmlXPathPopNodeSet(ctxt);
|
nodeset = xmlXPathPopNodeSet(ctxt);
|
||||||
if (xmlXPathCheckError(ctxt)) {
|
if (xmlXPathCheckError(ctxt)) {
|
||||||
xmlXPathSetTypeError(ctxt);
|
xmlXPathSetTypeError(ctxt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (str == NULL || !xmlStrlen(str) || !(comp = xmlXPathCompile(str))) {
|
if (str == NULL || !xmlStrlen(str) || !(comp = xmlXPathCompile(str))) {
|
||||||
if (nodeset != NULL)
|
if (nodeset != NULL)
|
||||||
xmlXPathFreeNodeSet(nodeset);
|
xmlXPathFreeNodeSet(nodeset);
|
||||||
if (str != NULL)
|
if (str != NULL)
|
||||||
xmlFree(str);
|
xmlFree(str);
|
||||||
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = xmlXPathNewNodeSet(NULL);
|
ret = xmlXPathNewNodeSet(NULL);
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
xsltGenericError(xsltGenericErrorContext,
|
xsltGenericError(xsltGenericErrorContext,
|
||||||
"exsltDynMapFunctoin: ret == NULL\n");
|
"exsltDynMapFunctoin: ret == NULL\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
oldDoc = ctxt->context->doc;
|
oldDoc = ctxt->context->doc;
|
||||||
oldNode = ctxt->context->node;
|
oldNode = ctxt->context->node;
|
||||||
oldContextSize = ctxt->context->contextSize;
|
oldContextSize = ctxt->context->contextSize;
|
||||||
oldProximityPosition = ctxt->context->proximityPosition;
|
oldProximityPosition = ctxt->context->proximityPosition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* since we really don't know we're going to be adding node(s)
|
* since we really don't know we're going to be adding node(s)
|
||||||
* down the road we create the RVT regardless
|
* down the road we create the RVT regardless
|
||||||
*/
|
*/
|
||||||
container = xsltCreateRVT(xsltXPathGetTransformContext(ctxt));
|
container = xsltCreateRVT(xsltXPathGetTransformContext(ctxt));
|
||||||
if (container != NULL)
|
if (container != NULL)
|
||||||
xsltRegisterTmpRVT(xsltXPathGetTransformContext(ctxt), container);
|
xsltRegisterLocalRVT(xsltXPathGetTransformContext(ctxt), container);
|
||||||
|
|
||||||
if (nodeset && nodeset->nodeNr > 0) {
|
if (nodeset && nodeset->nodeNr > 0) {
|
||||||
xmlXPathNodeSetSort(nodeset);
|
xmlXPathNodeSetSort(nodeset);
|
||||||
ctxt->context->contextSize = nodeset->nodeNr;
|
ctxt->context->contextSize = nodeset->nodeNr;
|
||||||
ctxt->context->proximityPosition = 0;
|
ctxt->context->proximityPosition = 0;
|
||||||
for (i = 0; i < nodeset->nodeNr; i++) {
|
for (i = 0; i < nodeset->nodeNr; i++) {
|
||||||
xmlXPathObjectPtr subResult = NULL;
|
xmlXPathObjectPtr subResult = NULL;
|
||||||
|
|
||||||
ctxt->context->proximityPosition++;
|
ctxt->context->proximityPosition++;
|
||||||
ctxt->context->node = nodeset->nodeTab[i];
|
ctxt->context->node = nodeset->nodeTab[i];
|
||||||
ctxt->context->doc = nodeset->nodeTab[i]->doc;
|
ctxt->context->doc = nodeset->nodeTab[i]->doc;
|
||||||
|
|
||||||
subResult = xmlXPathCompiledEval(comp, ctxt->context);
|
subResult = xmlXPathCompiledEval(comp, ctxt->context);
|
||||||
if (subResult != NULL) {
|
if (subResult != NULL) {
|
||||||
switch (subResult->type) {
|
switch (subResult->type) {
|
||||||
case XPATH_NODESET:
|
case XPATH_NODESET:
|
||||||
if (subResult->nodesetval != NULL)
|
if (subResult->nodesetval != NULL)
|
||||||
for (j = 0; j < subResult->nodesetval->nodeNr;
|
for (j = 0; j < subResult->nodesetval->nodeNr;
|
||||||
j++)
|
j++)
|
||||||
xmlXPathNodeSetAdd(ret->nodesetval,
|
xmlXPathNodeSetAdd(ret->nodesetval,
|
||||||
subResult->nodesetval->
|
subResult->nodesetval->
|
||||||
nodeTab[j]);
|
nodeTab[j]);
|
||||||
break;
|
break;
|
||||||
case XPATH_BOOLEAN:
|
case XPATH_BOOLEAN:
|
||||||
if (container != NULL) {
|
if (container != NULL) {
|
||||||
xmlNodePtr cur =
|
xmlNodePtr cur =
|
||||||
xmlNewChild((xmlNodePtr) container, NULL,
|
xmlNewChild((xmlNodePtr) container, NULL,
|
||||||
BAD_CAST "boolean",
|
BAD_CAST "boolean",
|
||||||
BAD_CAST (subResult->
|
BAD_CAST (subResult->
|
||||||
boolval ? "true" : ""));
|
boolval ? "true" : ""));
|
||||||
if (cur != NULL) {
|
if (cur != NULL) {
|
||||||
cur->ns =
|
cur->ns =
|
||||||
xmlNewNs(cur,
|
xmlNewNs(cur,
|
||||||
BAD_CAST
|
BAD_CAST
|
||||||
"http://exslt.org/common",
|
"http://exslt.org/common",
|
||||||
BAD_CAST "exsl");
|
BAD_CAST "exsl");
|
||||||
xmlXPathNodeSetAddUnique(ret->nodesetval,
|
xmlXPathNodeSetAddUnique(ret->nodesetval,
|
||||||
cur);
|
cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XPATH_NUMBER:
|
case XPATH_NUMBER:
|
||||||
if (container != NULL) {
|
if (container != NULL) {
|
||||||
xmlChar *val =
|
xmlChar *val =
|
||||||
xmlXPathCastNumberToString(subResult->
|
xmlXPathCastNumberToString(subResult->
|
||||||
floatval);
|
floatval);
|
||||||
xmlNodePtr cur =
|
xmlNodePtr cur =
|
||||||
xmlNewChild((xmlNodePtr) container, NULL,
|
xmlNewChild((xmlNodePtr) container, NULL,
|
||||||
BAD_CAST "number", val);
|
BAD_CAST "number", val);
|
||||||
if (val != NULL)
|
if (val != NULL)
|
||||||
xmlFree(val);
|
xmlFree(val);
|
||||||
|
|
||||||
if (cur != NULL) {
|
if (cur != NULL) {
|
||||||
cur->ns =
|
cur->ns =
|
||||||
xmlNewNs(cur,
|
xmlNewNs(cur,
|
||||||
BAD_CAST
|
BAD_CAST
|
||||||
"http://exslt.org/common",
|
"http://exslt.org/common",
|
||||||
BAD_CAST "exsl");
|
BAD_CAST "exsl");
|
||||||
xmlXPathNodeSetAddUnique(ret->nodesetval,
|
xmlXPathNodeSetAddUnique(ret->nodesetval,
|
||||||
cur);
|
cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XPATH_STRING:
|
case XPATH_STRING:
|
||||||
if (container != NULL) {
|
if (container != NULL) {
|
||||||
xmlNodePtr cur =
|
xmlNodePtr cur =
|
||||||
xmlNewChild((xmlNodePtr) container, NULL,
|
xmlNewChild((xmlNodePtr) container, NULL,
|
||||||
BAD_CAST "string",
|
BAD_CAST "string",
|
||||||
subResult->stringval);
|
subResult->stringval);
|
||||||
if (cur != NULL) {
|
if (cur != NULL) {
|
||||||
cur->ns =
|
cur->ns =
|
||||||
xmlNewNs(cur,
|
xmlNewNs(cur,
|
||||||
BAD_CAST
|
BAD_CAST
|
||||||
"http://exslt.org/common",
|
"http://exslt.org/common",
|
||||||
BAD_CAST "exsl");
|
BAD_CAST "exsl");
|
||||||
xmlXPathNodeSetAddUnique(ret->nodesetval,
|
xmlXPathNodeSetAddUnique(ret->nodesetval,
|
||||||
cur);
|
cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
xmlXPathFreeObject(subResult);
|
xmlXPathFreeObject(subResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctxt->context->doc = oldDoc;
|
ctxt->context->doc = oldDoc;
|
||||||
ctxt->context->node = oldNode;
|
ctxt->context->node = oldNode;
|
||||||
ctxt->context->contextSize = oldContextSize;
|
ctxt->context->contextSize = oldContextSize;
|
||||||
ctxt->context->proximityPosition = oldProximityPosition;
|
ctxt->context->proximityPosition = oldProximityPosition;
|
||||||
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
/* restore the xpath context */
|
/* restore the xpath context */
|
||||||
if (comp != NULL)
|
if (comp != NULL)
|
||||||
xmlXPathFreeCompExpr(comp);
|
xmlXPathFreeCompExpr(comp);
|
||||||
if (nodeset != NULL)
|
if (nodeset != NULL)
|
||||||
xmlXPathFreeNodeSet(nodeset);
|
xmlXPathFreeNodeSet(nodeset);
|
||||||
if (str != NULL)
|
if (str != NULL)
|
||||||
xmlFree(str);
|
xmlFree(str);
|
||||||
valuePush(ctxt, ret);
|
valuePush(ctxt, ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exsltDynRegister:
|
* exsltDynRegister:
|
||||||
*
|
*
|
||||||
* Registers the EXSLT - Dynamic module
|
* Registers the EXSLT - Dynamic module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
exsltDynRegister (void) {
|
exsltDynRegister (void) {
|
||||||
xsltRegisterExtModuleFunction ((const xmlChar *) "evaluate",
|
xsltRegisterExtModuleFunction ((const xmlChar *) "evaluate",
|
||||||
EXSLT_DYNAMIC_NAMESPACE,
|
EXSLT_DYNAMIC_NAMESPACE,
|
||||||
exsltDynEvaluateFunction);
|
exsltDynEvaluateFunction);
|
||||||
xsltRegisterExtModuleFunction ((const xmlChar *) "map",
|
xsltRegisterExtModuleFunction ((const xmlChar *) "map",
|
||||||
EXSLT_DYNAMIC_NAMESPACE,
|
EXSLT_DYNAMIC_NAMESPACE,
|
||||||
exsltDynMapFunction);
|
exsltDynMapFunction);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
1409
libexslt/functions.c
1409
libexslt/functions.c
File diff suppressed because it is too large
Load Diff
1051
libexslt/strings.c
1051
libexslt/strings.c
File diff suppressed because it is too large
Load Diff
2262
libxslt/attributes.c
2262
libxslt/attributes.c
File diff suppressed because it is too large
Load Diff
@@ -1,437 +1,439 @@
|
|||||||
/*
|
/*
|
||||||
* documents.c: Implementation of the documents handling
|
* documents.c: Implementation of the documents handling
|
||||||
*
|
*
|
||||||
* See Copyright for the status of this software.
|
* See Copyright for the status of this software.
|
||||||
*
|
*
|
||||||
* daniel@veillard.com
|
* daniel@veillard.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IN_LIBXSLT
|
#define IN_LIBXSLT
|
||||||
#include "libxslt.h"
|
#include "libxslt.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <libxml/hash.h>
|
#include <libxml/hash.h>
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
#include <libxml/parserInternals.h>
|
#include <libxml/parserInternals.h>
|
||||||
#include "xslt.h"
|
#include "xslt.h"
|
||||||
#include "xsltInternals.h"
|
#include "xsltInternals.h"
|
||||||
#include "xsltutils.h"
|
#include "xsltutils.h"
|
||||||
#include "documents.h"
|
#include "documents.h"
|
||||||
#include "transform.h"
|
#include "transform.h"
|
||||||
#include "imports.h"
|
#include "imports.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
#include "security.h"
|
#include "security.h"
|
||||||
|
|
||||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||||
#include <libxml/xinclude.h>
|
#include <libxml/xinclude.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WITH_XSLT_DEBUG_DOCUMENTS
|
#define WITH_XSLT_DEBUG_DOCUMENTS
|
||||||
|
|
||||||
#ifdef WITH_XSLT_DEBUG
|
#ifdef WITH_XSLT_DEBUG
|
||||||
#define WITH_XSLT_DEBUG_DOCUMENTS
|
#define WITH_XSLT_DEBUG_DOCUMENTS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Hooks for the document loader *
|
* Hooks for the document loader *
|
||||||
* *
|
* *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltDocDefaultLoaderFunc:
|
* xsltDocDefaultLoaderFunc:
|
||||||
* @URI: the URI of the document to load
|
* @URI: the URI of the document to load
|
||||||
* @dict: the dictionnary to use when parsing that document
|
* @dict: the dictionnary to use when parsing that document
|
||||||
* @options: parsing options, a set of xmlParserOption
|
* @options: parsing options, a set of xmlParserOption
|
||||||
* @ctxt: the context, either a stylesheet or a transformation context
|
* @ctxt: the context, either a stylesheet or a transformation context
|
||||||
* @type: the xsltLoadType indicating the kind of loading required
|
* @type: the xsltLoadType indicating the kind of loading required
|
||||||
*
|
*
|
||||||
* Default function to load document not provided by the compilation or
|
* Default function to load document not provided by the compilation or
|
||||||
* transformation API themselve, for example when an xsl:import,
|
* transformation API themselve, for example when an xsl:import,
|
||||||
* xsl:include is found at compilation time or when a document()
|
* xsl:include is found at compilation time or when a document()
|
||||||
* call is made at runtime.
|
* call is made at runtime.
|
||||||
*
|
*
|
||||||
* Returns the pointer to the document (which will be modified and
|
* Returns the pointer to the document (which will be modified and
|
||||||
* freed by the engine later), or NULL in case of error.
|
* freed by the engine later), or NULL in case of error.
|
||||||
*/
|
*/
|
||||||
static xmlDocPtr
|
static xmlDocPtr
|
||||||
xsltDocDefaultLoaderFunc(const xmlChar * URI, xmlDictPtr dict, int options,
|
xsltDocDefaultLoaderFunc(const xmlChar * URI, xmlDictPtr dict, int options,
|
||||||
void *ctxt ATTRIBUTE_UNUSED,
|
void *ctxt ATTRIBUTE_UNUSED,
|
||||||
xsltLoadType type ATTRIBUTE_UNUSED)
|
xsltLoadType type ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
xmlParserCtxtPtr pctxt;
|
xmlParserCtxtPtr pctxt;
|
||||||
xmlParserInputPtr inputStream;
|
xmlParserInputPtr inputStream;
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
|
|
||||||
pctxt = xmlNewParserCtxt();
|
pctxt = xmlNewParserCtxt();
|
||||||
if (pctxt == NULL)
|
if (pctxt == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
if ((dict != NULL) && (pctxt->dict != NULL)) {
|
if ((dict != NULL) && (pctxt->dict != NULL)) {
|
||||||
xmlDictFree(pctxt->dict);
|
xmlDictFree(pctxt->dict);
|
||||||
pctxt->dict = NULL;
|
pctxt->dict = NULL;
|
||||||
}
|
}
|
||||||
if (dict != NULL) {
|
if (dict != NULL) {
|
||||||
pctxt->dict = dict;
|
pctxt->dict = dict;
|
||||||
xmlDictReference(pctxt->dict);
|
xmlDictReference(pctxt->dict);
|
||||||
#ifdef WITH_XSLT_DEBUG
|
#ifdef WITH_XSLT_DEBUG
|
||||||
xsltGenericDebug(xsltGenericDebugContext,
|
xsltGenericDebug(xsltGenericDebugContext,
|
||||||
"Reusing dictionary for document\n");
|
"Reusing dictionary for document\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
xmlCtxtUseOptions(pctxt, options);
|
xmlCtxtUseOptions(pctxt, options);
|
||||||
inputStream = xmlLoadExternalEntity((const char *) URI, NULL, pctxt);
|
inputStream = xmlLoadExternalEntity((const char *) URI, NULL, pctxt);
|
||||||
if (inputStream == NULL) {
|
if (inputStream == NULL) {
|
||||||
xmlFreeParserCtxt(pctxt);
|
xmlFreeParserCtxt(pctxt);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
inputPush(pctxt, inputStream);
|
inputPush(pctxt, inputStream);
|
||||||
if (pctxt->directory == NULL)
|
if (pctxt->directory == NULL)
|
||||||
pctxt->directory = xmlParserGetDirectory((const char *) URI);
|
pctxt->directory = xmlParserGetDirectory((const char *) URI);
|
||||||
|
|
||||||
xmlParseDocument(pctxt);
|
xmlParseDocument(pctxt);
|
||||||
|
|
||||||
if (pctxt->wellFormed) {
|
if (pctxt->wellFormed) {
|
||||||
doc = pctxt->myDoc;
|
doc = pctxt->myDoc;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
doc = NULL;
|
doc = NULL;
|
||||||
xmlFreeDoc(pctxt->myDoc);
|
xmlFreeDoc(pctxt->myDoc);
|
||||||
pctxt->myDoc = NULL;
|
pctxt->myDoc = NULL;
|
||||||
}
|
}
|
||||||
xmlFreeParserCtxt(pctxt);
|
xmlFreeParserCtxt(pctxt);
|
||||||
|
|
||||||
return(doc);
|
return(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xsltDocLoaderFunc xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
|
xsltDocLoaderFunc xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltSetLoaderFunc:
|
* xsltSetLoaderFunc:
|
||||||
* @f: the new function to handle document loading.
|
* @f: the new function to handle document loading.
|
||||||
*
|
*
|
||||||
* Set the new function to load document, if NULL it resets it to the
|
* Set the new function to load document, if NULL it resets it to the
|
||||||
* default function.
|
* default function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
xsltSetLoaderFunc(xsltDocLoaderFunc f) {
|
xsltSetLoaderFunc(xsltDocLoaderFunc f) {
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
|
xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
|
||||||
else
|
else
|
||||||
xsltDocDefaultLoader = f;
|
xsltDocDefaultLoader = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Module interfaces *
|
* Module interfaces *
|
||||||
* *
|
* *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltNewDocument:
|
* xsltNewDocument:
|
||||||
* @ctxt: an XSLT transformation context (or NULL)
|
* @ctxt: an XSLT transformation context (or NULL)
|
||||||
* @doc: a parsed XML document
|
* @doc: a parsed XML document
|
||||||
*
|
*
|
||||||
* Register a new document, apply key computations
|
* Register a new document, apply key computations
|
||||||
*
|
*
|
||||||
* Returns a handler to the document
|
* Returns a handler to the document
|
||||||
*/
|
*/
|
||||||
xsltDocumentPtr
|
xsltDocumentPtr
|
||||||
xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
|
xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
|
||||||
xsltDocumentPtr cur;
|
xsltDocumentPtr cur;
|
||||||
|
|
||||||
cur = (xsltDocumentPtr) xmlMalloc(sizeof(xsltDocument));
|
cur = (xsltDocumentPtr) xmlMalloc(sizeof(xsltDocument));
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
xsltTransformError(ctxt, NULL, (xmlNodePtr) doc,
|
xsltTransformError(ctxt, NULL, (xmlNodePtr) doc,
|
||||||
"xsltNewDocument : malloc failed\n");
|
"xsltNewDocument : malloc failed\n");
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
memset(cur, 0, sizeof(xsltDocument));
|
memset(cur, 0, sizeof(xsltDocument));
|
||||||
cur->doc = doc;
|
cur->doc = doc;
|
||||||
if (ctxt != NULL) {
|
if (ctxt != NULL) {
|
||||||
if (! XSLT_IS_RES_TREE_FRAG(doc)) {
|
if (! XSLT_IS_RES_TREE_FRAG(doc)) {
|
||||||
cur->next = ctxt->docList;
|
cur->next = ctxt->docList;
|
||||||
ctxt->docList = cur;
|
ctxt->docList = cur;
|
||||||
}
|
}
|
||||||
#ifdef XSLT_REFACTORED_KEYCOMP
|
#ifdef XSLT_REFACTORED_KEYCOMP
|
||||||
/*
|
/*
|
||||||
* A key with a specific name for a specific document
|
* A key with a specific name for a specific document
|
||||||
* will only be computed if there's a call to the key()
|
* will only be computed if there's a call to the key()
|
||||||
* function using that specific name for that specific
|
* function using that specific name for that specific
|
||||||
* document. I.e. computation of keys will be done in
|
* document. I.e. computation of keys will be done in
|
||||||
* xsltGetKey() (keys.c) on an on-demand basis.
|
* xsltGetKey() (keys.c) on an on-demand basis.
|
||||||
*/
|
*/
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Old behaviour.
|
* Old behaviour.
|
||||||
*/
|
*/
|
||||||
xsltInitCtxtKeys(ctxt, cur);
|
xsltInitCtxtKeys(ctxt, cur);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return(cur);
|
return(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltNewStyleDocument:
|
* xsltNewStyleDocument:
|
||||||
* @style: an XSLT style sheet
|
* @style: an XSLT style sheet
|
||||||
* @doc: a parsed XML document
|
* @doc: a parsed XML document
|
||||||
*
|
*
|
||||||
* Register a new document, apply key computations
|
* Register a new document, apply key computations
|
||||||
*
|
*
|
||||||
* Returns a handler to the document
|
* Returns a handler to the document
|
||||||
*/
|
*/
|
||||||
xsltDocumentPtr
|
xsltDocumentPtr
|
||||||
xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
|
xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
|
||||||
xsltDocumentPtr cur;
|
xsltDocumentPtr cur;
|
||||||
|
|
||||||
cur = (xsltDocumentPtr) xmlMalloc(sizeof(xsltDocument));
|
cur = (xsltDocumentPtr) xmlMalloc(sizeof(xsltDocument));
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
xsltTransformError(NULL, style, (xmlNodePtr) doc,
|
xsltTransformError(NULL, style, (xmlNodePtr) doc,
|
||||||
"xsltNewStyleDocument : malloc failed\n");
|
"xsltNewStyleDocument : malloc failed\n");
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
memset(cur, 0, sizeof(xsltDocument));
|
memset(cur, 0, sizeof(xsltDocument));
|
||||||
cur->doc = doc;
|
cur->doc = doc;
|
||||||
if (style != NULL) {
|
if (style != NULL) {
|
||||||
cur->next = style->docList;
|
cur->next = style->docList;
|
||||||
style->docList = cur;
|
style->docList = cur;
|
||||||
}
|
}
|
||||||
return(cur);
|
return(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltFreeStyleDocuments:
|
* xsltFreeStyleDocuments:
|
||||||
* @style: an XSLT stylesheet (representing a stylesheet-level)
|
* @style: an XSLT stylesheet (representing a stylesheet-level)
|
||||||
*
|
*
|
||||||
* Frees the node-trees (and xsltDocument structures) of all
|
* Frees the node-trees (and xsltDocument structures) of all
|
||||||
* stylesheet-modules of the stylesheet-level represented by
|
* stylesheet-modules of the stylesheet-level represented by
|
||||||
* the given @style.
|
* the given @style.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xsltFreeStyleDocuments(xsltStylesheetPtr style) {
|
xsltFreeStyleDocuments(xsltStylesheetPtr style) {
|
||||||
xsltDocumentPtr doc, cur;
|
xsltDocumentPtr doc, cur;
|
||||||
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
||||||
xsltNsMapPtr nsMap;
|
xsltNsMapPtr nsMap;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (style == NULL)
|
if (style == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
||||||
if (XSLT_HAS_INTERNAL_NSMAP(style))
|
if (XSLT_HAS_INTERNAL_NSMAP(style))
|
||||||
nsMap = XSLT_GET_INTERNAL_NSMAP(style);
|
nsMap = XSLT_GET_INTERNAL_NSMAP(style);
|
||||||
else
|
else
|
||||||
nsMap = NULL;
|
nsMap = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cur = style->docList;
|
cur = style->docList;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
doc = cur;
|
doc = cur;
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
#ifdef XSLT_REFACTORED_XSLT_NSCOMP
|
||||||
/*
|
/*
|
||||||
* Restore all changed namespace URIs of ns-decls.
|
* Restore all changed namespace URIs of ns-decls.
|
||||||
*/
|
*/
|
||||||
if (nsMap)
|
if (nsMap)
|
||||||
xsltRestoreDocumentNamespaces(nsMap, doc->doc);
|
xsltRestoreDocumentNamespaces(nsMap, doc->doc);
|
||||||
#endif
|
#endif
|
||||||
xsltFreeDocumentKeys(doc);
|
xsltFreeDocumentKeys(doc);
|
||||||
if (!doc->main)
|
if (!doc->main)
|
||||||
xmlFreeDoc(doc->doc);
|
xmlFreeDoc(doc->doc);
|
||||||
xmlFree(doc);
|
xmlFree(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltFreeDocuments:
|
* xsltFreeDocuments:
|
||||||
* @ctxt: an XSLT transformation context
|
* @ctxt: an XSLT transformation context
|
||||||
*
|
*
|
||||||
* Free up all the space used by the loaded documents
|
* Free up all the space used by the loaded documents
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xsltFreeDocuments(xsltTransformContextPtr ctxt) {
|
xsltFreeDocuments(xsltTransformContextPtr ctxt) {
|
||||||
xsltDocumentPtr doc, cur;
|
xsltDocumentPtr doc, cur;
|
||||||
|
|
||||||
cur = ctxt->docList;
|
cur = ctxt->docList;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
doc = cur;
|
doc = cur;
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
xsltFreeDocumentKeys(doc);
|
xsltFreeDocumentKeys(doc);
|
||||||
if (!doc->main)
|
if (!doc->main)
|
||||||
xmlFreeDoc(doc->doc);
|
xmlFreeDoc(doc->doc);
|
||||||
xmlFree(doc);
|
xmlFree(doc);
|
||||||
}
|
}
|
||||||
cur = ctxt->styleList;
|
cur = ctxt->styleList;
|
||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
doc = cur;
|
doc = cur;
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
xsltFreeDocumentKeys(doc);
|
xsltFreeDocumentKeys(doc);
|
||||||
if (!doc->main)
|
if (!doc->main)
|
||||||
xmlFreeDoc(doc->doc);
|
xmlFreeDoc(doc->doc);
|
||||||
xmlFree(doc);
|
xmlFree(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltLoadDocument:
|
* xsltLoadDocument:
|
||||||
* @ctxt: an XSLT transformation context
|
* @ctxt: an XSLT transformation context
|
||||||
* @URI: the computed URI of the document
|
* @URI: the computed URI of the document
|
||||||
*
|
*
|
||||||
* Try to load a document (not a stylesheet)
|
* Try to load a document (not a stylesheet)
|
||||||
* within the XSLT transformation context
|
* within the XSLT transformation context
|
||||||
*
|
*
|
||||||
* Returns the new xsltDocumentPtr or NULL in case of error
|
* Returns the new xsltDocumentPtr or NULL in case of error
|
||||||
*/
|
*/
|
||||||
xsltDocumentPtr
|
xsltDocumentPtr
|
||||||
xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
|
||||||
xsltDocumentPtr ret;
|
xsltDocumentPtr ret;
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
|
|
||||||
if ((ctxt == NULL) || (URI == NULL))
|
if ((ctxt == NULL) || (URI == NULL))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Security framework check
|
* Security framework check
|
||||||
*/
|
*/
|
||||||
if (ctxt->sec != NULL) {
|
if (ctxt->sec != NULL) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = xsltCheckRead(ctxt->sec, ctxt, URI);
|
res = xsltCheckRead(ctxt->sec, ctxt, URI);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
xsltTransformError(ctxt, NULL, NULL,
|
xsltTransformError(ctxt, NULL, NULL,
|
||||||
"xsltLoadDocument: read rights for %s denied\n",
|
"xsltLoadDocument: read rights for %s denied\n",
|
||||||
URI);
|
URI);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Walk the context list to find the document if preparsed
|
* Walk the context list to find the document if preparsed
|
||||||
*/
|
*/
|
||||||
ret = ctxt->docList;
|
ret = ctxt->docList;
|
||||||
while (ret != NULL) {
|
while (ret != NULL) {
|
||||||
if ((ret->doc != NULL) && (ret->doc->URL != NULL) &&
|
if ((ret->doc != NULL) && (ret->doc->URL != NULL) &&
|
||||||
(xmlStrEqual(ret->doc->URL, URI)))
|
(xmlStrEqual(ret->doc->URL, URI)))
|
||||||
return(ret);
|
return(ret);
|
||||||
ret = ret->next;
|
ret = ret->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
doc = xsltDocDefaultLoader(URI, ctxt->dict, ctxt->parserOptions,
|
doc = xsltDocDefaultLoader(URI, ctxt->dict, ctxt->parserOptions,
|
||||||
(void *) ctxt, XSLT_LOAD_DOCUMENT);
|
(void *) ctxt, XSLT_LOAD_DOCUMENT);
|
||||||
|
|
||||||
if (doc == NULL)
|
if (doc == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
if (ctxt->xinclude != 0) {
|
if (ctxt->xinclude != 0) {
|
||||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||||
#if LIBXML_VERSION >= 20603
|
#if LIBXML_VERSION >= 20603
|
||||||
xmlXIncludeProcessFlags(doc, ctxt->parserOptions);
|
xmlXIncludeProcessFlags(doc, ctxt->parserOptions);
|
||||||
#else
|
#else
|
||||||
xmlXIncludeProcess(doc);
|
xmlXIncludeProcess(doc);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
xsltTransformError(ctxt, NULL, NULL,
|
xsltTransformError(ctxt, NULL, NULL,
|
||||||
"xsltLoadDocument(%s) : XInclude processing not compiled in\n",
|
"xsltLoadDocument(%s) : XInclude processing not compiled in\n",
|
||||||
URI);
|
URI);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Apply white-space stripping if asked for
|
* Apply white-space stripping if asked for
|
||||||
*/
|
*/
|
||||||
if (xsltNeedElemSpaceHandling(ctxt))
|
if (xsltNeedElemSpaceHandling(ctxt))
|
||||||
xsltApplyStripSpaces(ctxt, xmlDocGetRootElement(doc));
|
xsltApplyStripSpaces(ctxt, xmlDocGetRootElement(doc));
|
||||||
if (ctxt->debugStatus == XSLT_DEBUG_NONE)
|
if (ctxt->debugStatus == XSLT_DEBUG_NONE)
|
||||||
xmlXPathOrderDocElems(doc);
|
xmlXPathOrderDocElems(doc);
|
||||||
|
|
||||||
ret = xsltNewDocument(ctxt, doc);
|
ret = xsltNewDocument(ctxt, doc);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltLoadStyleDocument:
|
* xsltLoadStyleDocument:
|
||||||
* @style: an XSLT style sheet
|
* @style: an XSLT style sheet
|
||||||
* @URI: the computed URI of the document
|
* @URI: the computed URI of the document
|
||||||
*
|
*
|
||||||
* Try to load a stylesheet document within the XSLT transformation context
|
* Try to load a stylesheet document within the XSLT transformation context
|
||||||
*
|
*
|
||||||
* Returns the new xsltDocumentPtr or NULL in case of error
|
* Returns the new xsltDocumentPtr or NULL in case of error
|
||||||
*/
|
*/
|
||||||
xsltDocumentPtr
|
xsltDocumentPtr
|
||||||
xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) {
|
xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) {
|
||||||
xsltDocumentPtr ret;
|
xsltDocumentPtr ret;
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xsltSecurityPrefsPtr sec;
|
xsltSecurityPrefsPtr sec;
|
||||||
|
|
||||||
if ((style == NULL) || (URI == NULL))
|
if ((style == NULL) || (URI == NULL))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Security framework check
|
* Security framework check
|
||||||
*/
|
*/
|
||||||
sec = xsltGetDefaultSecurityPrefs();
|
sec = xsltGetDefaultSecurityPrefs();
|
||||||
if (sec != NULL) {
|
if (sec != NULL) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = xsltCheckRead(sec, NULL, URI);
|
res = xsltCheckRead(sec, NULL, URI);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
xsltTransformError(NULL, NULL, NULL,
|
xsltTransformError(NULL, NULL, NULL,
|
||||||
"xsltLoadStyleDocument: read rights for %s denied\n",
|
"xsltLoadStyleDocument: read rights for %s denied\n",
|
||||||
URI);
|
URI);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Walk the context list to find the document if preparsed
|
* Walk the context list to find the document if preparsed
|
||||||
*/
|
*/
|
||||||
ret = style->docList;
|
ret = style->docList;
|
||||||
while (ret != NULL) {
|
while (ret != NULL) {
|
||||||
if ((ret->doc != NULL) && (ret->doc->URL != NULL) &&
|
if ((ret->doc != NULL) && (ret->doc->URL != NULL) &&
|
||||||
(xmlStrEqual(ret->doc->URL, URI)))
|
(xmlStrEqual(ret->doc->URL, URI)))
|
||||||
return(ret);
|
return(ret);
|
||||||
ret = ret->next;
|
ret = ret->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
doc = xsltDocDefaultLoader(URI, style->dict, XSLT_PARSE_OPTIONS,
|
doc = xsltDocDefaultLoader(URI, style->dict, XSLT_PARSE_OPTIONS,
|
||||||
(void *) style, XSLT_LOAD_STYLESHEET);
|
(void *) style, XSLT_LOAD_STYLESHEET);
|
||||||
if (doc == NULL)
|
if (doc == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
ret = xsltNewStyleDocument(style, doc);
|
ret = xsltNewStyleDocument(style, doc);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xsltFindDocument:
|
* xsltFindDocument:
|
||||||
* @ctxt: an XSLT transformation context
|
* @ctxt: an XSLT transformation context
|
||||||
* @doc: a parsed XML document
|
* @doc: a parsed XML document
|
||||||
*
|
*
|
||||||
* Try to find a document within the XSLT transformation context
|
* Try to find a document within the XSLT transformation context.
|
||||||
*
|
* This will not find document infos for temporary
|
||||||
* Returns the desired xsltDocumentPtr or NULL in case of error
|
* Result Tree Fragments.
|
||||||
*/
|
*
|
||||||
xsltDocumentPtr
|
* Returns the desired xsltDocumentPtr or NULL in case of error
|
||||||
xsltFindDocument (xsltTransformContextPtr ctxt, xmlDocPtr doc) {
|
*/
|
||||||
xsltDocumentPtr ret;
|
xsltDocumentPtr
|
||||||
|
xsltFindDocument (xsltTransformContextPtr ctxt, xmlDocPtr doc) {
|
||||||
if ((ctxt == NULL) || (doc == NULL))
|
xsltDocumentPtr ret;
|
||||||
return(NULL);
|
|
||||||
|
if ((ctxt == NULL) || (doc == NULL))
|
||||||
/*
|
return(NULL);
|
||||||
* Walk the context list to find the document
|
|
||||||
*/
|
/*
|
||||||
ret = ctxt->docList;
|
* Walk the context list to find the document
|
||||||
while (ret != NULL) {
|
*/
|
||||||
if (ret->doc == doc)
|
ret = ctxt->docList;
|
||||||
return(ret);
|
while (ret != NULL) {
|
||||||
ret = ret->next;
|
if (ret->doc == doc)
|
||||||
}
|
return(ret);
|
||||||
if (doc == ctxt->style->doc)
|
ret = ret->next;
|
||||||
return(ctxt->document);
|
}
|
||||||
return(NULL);
|
if (doc == ctxt->style->doc)
|
||||||
}
|
return(ctxt->document);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
1888
libxslt/functions.c
1888
libxslt/functions.c
File diff suppressed because it is too large
Load Diff
1633
libxslt/keys.c
1633
libxslt/keys.c
File diff suppressed because it is too large
Load Diff
1686
libxslt/namespaces.c
1686
libxslt/namespaces.c
File diff suppressed because it is too large
Load Diff
5169
libxslt/pattern.c
5169
libxslt/pattern.c
File diff suppressed because it is too large
Load Diff
4737
libxslt/preproc.c
4737
libxslt/preproc.c
File diff suppressed because it is too large
Load Diff
1638
libxslt/templates.c
1638
libxslt/templates.c
File diff suppressed because it is too large
Load Diff
@@ -1,77 +1,77 @@
|
|||||||
/*
|
/*
|
||||||
* Summary: interface for the template processing
|
* Summary: interface for the template processing
|
||||||
* Description: This set of routine encapsulates XPath calls
|
* Description: This set of routine encapsulates XPath calls
|
||||||
* and Attribute Value Templates evaluation.
|
* and Attribute Value Templates evaluation.
|
||||||
*
|
*
|
||||||
* Copy: See Copyright for the status of this software.
|
* Copy: See Copyright for the status of this software.
|
||||||
*
|
*
|
||||||
* Author: Daniel Veillard
|
* Author: Daniel Veillard
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __XML_XSLT_TEMPLATES_H__
|
#ifndef __XML_XSLT_TEMPLATES_H__
|
||||||
#define __XML_XSLT_TEMPLATES_H__
|
#define __XML_XSLT_TEMPLATES_H__
|
||||||
|
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#include <libxml/xpathInternals.h>
|
#include <libxml/xpathInternals.h>
|
||||||
#include "xsltexports.h"
|
#include "xsltexports.h"
|
||||||
#include "xsltInternals.h"
|
#include "xsltInternals.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XSLTPUBFUN int XSLTCALL
|
XSLTPUBFUN int XSLTCALL
|
||||||
xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
|
xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
|
||||||
xmlXPathCompExprPtr comp,
|
xmlXPathCompExprPtr comp,
|
||||||
xmlNsPtr *nsList,
|
xmlNsPtr *nsList,
|
||||||
int nsNr);
|
int nsNr);
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
xsltEvalTemplateString (xsltTransformContextPtr ctxt,
|
xsltEvalTemplateString (xsltTransformContextPtr ctxt,
|
||||||
xmlNodePtr node,
|
xmlNodePtr contextNode,
|
||||||
xmlNodePtr parent);
|
xmlNodePtr inst);
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
|
xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
|
||||||
xmlNodePtr node,
|
xmlNodePtr node,
|
||||||
const xmlChar *name,
|
const xmlChar *name,
|
||||||
const xmlChar *ns);
|
const xmlChar *ns);
|
||||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||||
xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
|
xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
|
||||||
xmlNodePtr node,
|
xmlNodePtr node,
|
||||||
const xmlChar *name,
|
const xmlChar *name,
|
||||||
const xmlChar *ns,
|
const xmlChar *ns,
|
||||||
int *found);
|
int *found);
|
||||||
|
|
||||||
/* TODO: this is obviously broken ... the namespaces should be passed too ! */
|
/* TODO: this is obviously broken ... the namespaces should be passed too ! */
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
xsltEvalXPathString (xsltTransformContextPtr ctxt,
|
xsltEvalXPathString (xsltTransformContextPtr ctxt,
|
||||||
xmlXPathCompExprPtr comp);
|
xmlXPathCompExprPtr comp);
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
|
xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
|
||||||
xmlXPathCompExprPtr comp,
|
xmlXPathCompExprPtr comp,
|
||||||
int nsNr,
|
int nsNr,
|
||||||
xmlNsPtr *nsList);
|
xmlNsPtr *nsList);
|
||||||
|
|
||||||
XSLTPUBFUN xmlNodePtr * XSLTCALL
|
XSLTPUBFUN xmlNodePtr * XSLTCALL
|
||||||
xsltTemplateProcess (xsltTransformContextPtr ctxt,
|
xsltTemplateProcess (xsltTransformContextPtr ctxt,
|
||||||
xmlNodePtr node);
|
xmlNodePtr node);
|
||||||
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
||||||
xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
|
xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
|
||||||
xmlNodePtr target,
|
xmlNodePtr target,
|
||||||
xmlAttrPtr cur);
|
xmlAttrPtr cur);
|
||||||
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
XSLTPUBFUN xmlAttrPtr XSLTCALL
|
||||||
xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
|
xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
|
||||||
xmlNodePtr target,
|
xmlNodePtr target,
|
||||||
xmlAttrPtr attr);
|
xmlAttrPtr attr);
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
|
xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
|
||||||
const xmlChar* attr);
|
const xmlChar* attr);
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
|
xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
|
||||||
const xmlChar* str,
|
const xmlChar* str,
|
||||||
xmlNodePtr node);
|
xmlNodePtr node);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __XML_XSLT_TEMPLATES_H__ */
|
#endif /* __XML_XSLT_TEMPLATES_H__ */
|
||||||
|
|
||||||
|
11958
libxslt/transform.c
11958
libxslt/transform.c
File diff suppressed because it is too large
Load Diff
4046
libxslt/variables.c
4046
libxslt/variables.c
File diff suppressed because it is too large
Load Diff
13592
libxslt/xslt.c
13592
libxslt/xslt.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4485
libxslt/xsltutils.c
4485
libxslt/xsltutils.c
File diff suppressed because it is too large
Load Diff
@@ -1,307 +1,309 @@
|
|||||||
/*
|
/*
|
||||||
* Summary: set of utilities for the XSLT engine
|
* Summary: set of utilities for the XSLT engine
|
||||||
* Description: interfaces for the utilities module of the XSLT engine.
|
* Description: interfaces for the utilities module of the XSLT engine.
|
||||||
* things like message handling, profiling, and other
|
* things like message handling, profiling, and other
|
||||||
* generally useful routines.
|
* generally useful routines.
|
||||||
*
|
*
|
||||||
* Copy: See Copyright for the status of this software.
|
* Copy: See Copyright for the status of this software.
|
||||||
*
|
*
|
||||||
* Author: Daniel Veillard
|
* Author: Daniel Veillard
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __XML_XSLTUTILS_H__
|
#ifndef __XML_XSLTUTILS_H__
|
||||||
#define __XML_XSLTUTILS_H__
|
#define __XML_XSLTUTILS_H__
|
||||||
|
|
||||||
#include <libxslt/xsltconfig.h>
|
#include <libxslt/xsltconfig.h>
|
||||||
#ifdef HAVE_STDARG_H
|
#ifdef HAVE_STDARG_H
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#endif
|
#endif
|
||||||
#include <libxml/xpath.h>
|
#include <libxml/xpath.h>
|
||||||
#include <libxml/dict.h>
|
#include <libxml/dict.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include "xsltexports.h"
|
#include "xsltexports.h"
|
||||||
#include "xsltInternals.h"
|
#include "xsltInternals.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XSLT_TODO:
|
* XSLT_TODO:
|
||||||
*
|
*
|
||||||
* Macro to flag unimplemented blocks.
|
* Macro to flag unimplemented blocks.
|
||||||
*/
|
*/
|
||||||
#define XSLT_TODO \
|
#define XSLT_TODO \
|
||||||
xsltGenericError(xsltGenericErrorContext, \
|
xsltGenericError(xsltGenericErrorContext, \
|
||||||
"Unimplemented block at %s:%d\n", \
|
"Unimplemented block at %s:%d\n", \
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XSLT_STRANGE:
|
* XSLT_STRANGE:
|
||||||
*
|
*
|
||||||
* Macro to flag that a problem was detected internally.
|
* Macro to flag that a problem was detected internally.
|
||||||
*/
|
*/
|
||||||
#define XSLT_STRANGE \
|
#define XSLT_STRANGE \
|
||||||
xsltGenericError(xsltGenericErrorContext, \
|
xsltGenericError(xsltGenericErrorContext, \
|
||||||
"Internal error at %s:%d\n", \
|
"Internal error at %s:%d\n", \
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IS_XSLT_ELEM:
|
* IS_XSLT_ELEM:
|
||||||
*
|
*
|
||||||
* Checks that the element pertains to XSLT namespace.
|
* Checks that the element pertains to XSLT namespace.
|
||||||
*/
|
*/
|
||||||
#define IS_XSLT_ELEM(n) \
|
#define IS_XSLT_ELEM(n) \
|
||||||
(((n) != NULL) && ((n)->ns != NULL) && \
|
(((n) != NULL) && ((n)->ns != NULL) && \
|
||||||
(xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
|
(xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IS_XSLT_NAME:
|
* IS_XSLT_NAME:
|
||||||
*
|
*
|
||||||
* Checks the value of an element in XSLT namespace.
|
* Checks the value of an element in XSLT namespace.
|
||||||
*/
|
*/
|
||||||
#define IS_XSLT_NAME(n, val) \
|
#define IS_XSLT_NAME(n, val) \
|
||||||
(xmlStrEqual((n)->name, (const xmlChar *) (val)))
|
(xmlStrEqual((n)->name, (const xmlChar *) (val)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IS_XSLT_REAL_NODE:
|
* IS_XSLT_REAL_NODE:
|
||||||
*
|
*
|
||||||
* Check that a node is a 'real' one: document, element, text or attribute.
|
* Check that a node is a 'real' one: document, element, text or attribute.
|
||||||
*/
|
*/
|
||||||
#define IS_XSLT_REAL_NODE(n) \
|
#define IS_XSLT_REAL_NODE(n) \
|
||||||
(((n) != NULL) && \
|
(((n) != NULL) && \
|
||||||
(((n)->type == XML_ELEMENT_NODE) || \
|
(((n)->type == XML_ELEMENT_NODE) || \
|
||||||
((n)->type == XML_TEXT_NODE) || \
|
((n)->type == XML_TEXT_NODE) || \
|
||||||
((n)->type == XML_ATTRIBUTE_NODE) || \
|
((n)->type == XML_CDATA_SECTION_NODE) || \
|
||||||
((n)->type == XML_DOCUMENT_NODE) || \
|
((n)->type == XML_ATTRIBUTE_NODE) || \
|
||||||
((n)->type == XML_HTML_DOCUMENT_NODE) || \
|
((n)->type == XML_DOCUMENT_NODE) || \
|
||||||
((n)->type == XML_PI_NODE)))
|
((n)->type == XML_HTML_DOCUMENT_NODE) || \
|
||||||
|
((n)->type == XML_COMMENT_NODE) || \
|
||||||
/*
|
((n)->type == XML_PI_NODE)))
|
||||||
* Our own version of namespaced atributes lookup.
|
|
||||||
*/
|
/*
|
||||||
XSLTPUBFUN xmlChar * XSLTCALL
|
* Our own version of namespaced atributes lookup.
|
||||||
xsltGetNsProp (xmlNodePtr node,
|
*/
|
||||||
const xmlChar *name,
|
XSLTPUBFUN xmlChar * XSLTCALL
|
||||||
const xmlChar *nameSpace);
|
xsltGetNsProp (xmlNodePtr node,
|
||||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
const xmlChar *name,
|
||||||
xsltGetCNsProp (xsltStylesheetPtr style,
|
const xmlChar *nameSpace);
|
||||||
xmlNodePtr node,
|
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||||
const xmlChar *name,
|
xsltGetCNsProp (xsltStylesheetPtr style,
|
||||||
const xmlChar *nameSpace);
|
xmlNodePtr node,
|
||||||
XSLTPUBFUN int XSLTCALL
|
const xmlChar *name,
|
||||||
xsltGetUTF8Char (const unsigned char *utf,
|
const xmlChar *nameSpace);
|
||||||
int *len);
|
XSLTPUBFUN int XSLTCALL
|
||||||
|
xsltGetUTF8Char (const unsigned char *utf,
|
||||||
/*
|
int *len);
|
||||||
* XSLT Debug Tracing Tracing Types
|
|
||||||
*/
|
/*
|
||||||
typedef enum {
|
* XSLT Debug Tracing Tracing Types
|
||||||
XSLT_TRACE_ALL = -1,
|
*/
|
||||||
XSLT_TRACE_NONE = 0,
|
typedef enum {
|
||||||
XSLT_TRACE_COPY_TEXT = 1<<0,
|
XSLT_TRACE_ALL = -1,
|
||||||
XSLT_TRACE_PROCESS_NODE = 1<<1,
|
XSLT_TRACE_NONE = 0,
|
||||||
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
|
XSLT_TRACE_COPY_TEXT = 1<<0,
|
||||||
XSLT_TRACE_COPY = 1<<3,
|
XSLT_TRACE_PROCESS_NODE = 1<<1,
|
||||||
XSLT_TRACE_COMMENT = 1<<4,
|
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
|
||||||
XSLT_TRACE_PI = 1<<5,
|
XSLT_TRACE_COPY = 1<<3,
|
||||||
XSLT_TRACE_COPY_OF = 1<<6,
|
XSLT_TRACE_COMMENT = 1<<4,
|
||||||
XSLT_TRACE_VALUE_OF = 1<<7,
|
XSLT_TRACE_PI = 1<<5,
|
||||||
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
|
XSLT_TRACE_COPY_OF = 1<<6,
|
||||||
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
|
XSLT_TRACE_VALUE_OF = 1<<7,
|
||||||
XSLT_TRACE_CHOOSE = 1<<10,
|
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
|
||||||
XSLT_TRACE_IF = 1<<11,
|
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
|
||||||
XSLT_TRACE_FOR_EACH = 1<<12,
|
XSLT_TRACE_CHOOSE = 1<<10,
|
||||||
XSLT_TRACE_STRIP_SPACES = 1<<13,
|
XSLT_TRACE_IF = 1<<11,
|
||||||
XSLT_TRACE_TEMPLATES = 1<<14,
|
XSLT_TRACE_FOR_EACH = 1<<12,
|
||||||
XSLT_TRACE_KEYS = 1<<15,
|
XSLT_TRACE_STRIP_SPACES = 1<<13,
|
||||||
XSLT_TRACE_VARIABLES = 1<<16
|
XSLT_TRACE_TEMPLATES = 1<<14,
|
||||||
} xsltDebugTraceCodes;
|
XSLT_TRACE_KEYS = 1<<15,
|
||||||
|
XSLT_TRACE_VARIABLES = 1<<16
|
||||||
/**
|
} xsltDebugTraceCodes;
|
||||||
* XSLT_TRACE:
|
|
||||||
*
|
/**
|
||||||
* Control the type of xsl debugtrace messages emitted.
|
* XSLT_TRACE:
|
||||||
*/
|
*
|
||||||
#define XSLT_TRACE(ctxt,code,call) \
|
* Control the type of xsl debugtrace messages emitted.
|
||||||
if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
|
*/
|
||||||
call
|
#define XSLT_TRACE(ctxt,code,call) \
|
||||||
|
if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
|
||||||
XSLTPUBFUN void XSLTCALL
|
call
|
||||||
xsltDebugSetDefaultTrace(xsltDebugTraceCodes val);
|
|
||||||
XSLTPUBFUN xsltDebugTraceCodes XSLTCALL
|
XSLTPUBFUN void XSLTCALL
|
||||||
xsltDebugGetDefaultTrace(void);
|
xsltDebugSetDefaultTrace(xsltDebugTraceCodes val);
|
||||||
|
XSLTPUBFUN xsltDebugTraceCodes XSLTCALL
|
||||||
/*
|
xsltDebugGetDefaultTrace(void);
|
||||||
* XSLT specific error and debug reporting functions.
|
|
||||||
*/
|
/*
|
||||||
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError;
|
* XSLT specific error and debug reporting functions.
|
||||||
XSLTPUBVAR void *xsltGenericErrorContext;
|
*/
|
||||||
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug;
|
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError;
|
||||||
XSLTPUBVAR void *xsltGenericDebugContext;
|
XSLTPUBVAR void *xsltGenericErrorContext;
|
||||||
|
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug;
|
||||||
XSLTPUBFUN void XSLTCALL
|
XSLTPUBVAR void *xsltGenericDebugContext;
|
||||||
xsltPrintErrorContext (xsltTransformContextPtr ctxt,
|
|
||||||
xsltStylesheetPtr style,
|
XSLTPUBFUN void XSLTCALL
|
||||||
xmlNodePtr node);
|
xsltPrintErrorContext (xsltTransformContextPtr ctxt,
|
||||||
XSLTPUBFUN void XSLTCALL
|
xsltStylesheetPtr style,
|
||||||
xsltMessage (xsltTransformContextPtr ctxt,
|
xmlNodePtr node);
|
||||||
xmlNodePtr node,
|
XSLTPUBFUN void XSLTCALL
|
||||||
xmlNodePtr inst);
|
xsltMessage (xsltTransformContextPtr ctxt,
|
||||||
XSLTPUBFUN void XSLTCALL
|
xmlNodePtr node,
|
||||||
xsltSetGenericErrorFunc (void *ctx,
|
xmlNodePtr inst);
|
||||||
xmlGenericErrorFunc handler);
|
XSLTPUBFUN void XSLTCALL
|
||||||
XSLTPUBFUN void XSLTCALL
|
xsltSetGenericErrorFunc (void *ctx,
|
||||||
xsltSetGenericDebugFunc (void *ctx,
|
xmlGenericErrorFunc handler);
|
||||||
xmlGenericErrorFunc handler);
|
XSLTPUBFUN void XSLTCALL
|
||||||
XSLTPUBFUN void XSLTCALL
|
xsltSetGenericDebugFunc (void *ctx,
|
||||||
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
|
xmlGenericErrorFunc handler);
|
||||||
void *ctx,
|
XSLTPUBFUN void XSLTCALL
|
||||||
xmlGenericErrorFunc handler);
|
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
|
||||||
XSLTPUBFUN void XSLTCALL
|
void *ctx,
|
||||||
xsltTransformError (xsltTransformContextPtr ctxt,
|
xmlGenericErrorFunc handler);
|
||||||
xsltStylesheetPtr style,
|
XSLTPUBFUN void XSLTCALL
|
||||||
xmlNodePtr node,
|
xsltTransformError (xsltTransformContextPtr ctxt,
|
||||||
const char *msg,
|
xsltStylesheetPtr style,
|
||||||
...);
|
xmlNodePtr node,
|
||||||
|
const char *msg,
|
||||||
XSLTPUBFUN int XSLTCALL
|
...);
|
||||||
xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt,
|
|
||||||
int options);
|
XSLTPUBFUN int XSLTCALL
|
||||||
/*
|
xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt,
|
||||||
* Sorting.
|
int options);
|
||||||
*/
|
/*
|
||||||
|
* Sorting.
|
||||||
XSLTPUBFUN void XSLTCALL
|
*/
|
||||||
xsltDocumentSortFunction (xmlNodeSetPtr list);
|
|
||||||
XSLTPUBFUN void XSLTCALL
|
XSLTPUBFUN void XSLTCALL
|
||||||
xsltSetSortFunc (xsltSortFunc handler);
|
xsltDocumentSortFunction (xmlNodeSetPtr list);
|
||||||
XSLTPUBFUN void XSLTCALL
|
XSLTPUBFUN void XSLTCALL
|
||||||
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
|
xsltSetSortFunc (xsltSortFunc handler);
|
||||||
xsltSortFunc handler);
|
XSLTPUBFUN void XSLTCALL
|
||||||
XSLTPUBFUN void XSLTCALL
|
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
|
||||||
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
|
xsltSortFunc handler);
|
||||||
xmlNodePtr *sorts,
|
XSLTPUBFUN void XSLTCALL
|
||||||
int nbsorts);
|
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
|
||||||
XSLTPUBFUN void XSLTCALL
|
xmlNodePtr *sorts,
|
||||||
xsltDoSortFunction (xsltTransformContextPtr ctxt,
|
int nbsorts);
|
||||||
xmlNodePtr * sorts,
|
XSLTPUBFUN void XSLTCALL
|
||||||
int nbsorts);
|
xsltDoSortFunction (xsltTransformContextPtr ctxt,
|
||||||
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
|
xmlNodePtr * sorts,
|
||||||
xsltComputeSortResult (xsltTransformContextPtr ctxt,
|
int nbsorts);
|
||||||
xmlNodePtr sort);
|
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
|
||||||
|
xsltComputeSortResult (xsltTransformContextPtr ctxt,
|
||||||
/*
|
xmlNodePtr sort);
|
||||||
* QNames handling.
|
|
||||||
*/
|
/*
|
||||||
|
* QNames handling.
|
||||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
*/
|
||||||
xsltSplitQName (xmlDictPtr dict,
|
|
||||||
const xmlChar *name,
|
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||||
const xmlChar **prefix);
|
xsltSplitQName (xmlDictPtr dict,
|
||||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
const xmlChar *name,
|
||||||
xsltGetQNameURI (xmlNodePtr node,
|
const xmlChar **prefix);
|
||||||
xmlChar **name);
|
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||||
|
xsltGetQNameURI (xmlNodePtr node,
|
||||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
xmlChar **name);
|
||||||
xsltGetQNameURI2 (xsltStylesheetPtr style,
|
|
||||||
xmlNodePtr node,
|
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||||
const xmlChar **name);
|
xsltGetQNameURI2 (xsltStylesheetPtr style,
|
||||||
|
xmlNodePtr node,
|
||||||
/*
|
const xmlChar **name);
|
||||||
* Output, reuse libxml I/O buffers.
|
|
||||||
*/
|
/*
|
||||||
XSLTPUBFUN int XSLTCALL
|
* Output, reuse libxml I/O buffers.
|
||||||
xsltSaveResultTo (xmlOutputBufferPtr buf,
|
*/
|
||||||
xmlDocPtr result,
|
XSLTPUBFUN int XSLTCALL
|
||||||
xsltStylesheetPtr style);
|
xsltSaveResultTo (xmlOutputBufferPtr buf,
|
||||||
XSLTPUBFUN int XSLTCALL
|
xmlDocPtr result,
|
||||||
xsltSaveResultToFilename (const char *URI,
|
xsltStylesheetPtr style);
|
||||||
xmlDocPtr result,
|
XSLTPUBFUN int XSLTCALL
|
||||||
xsltStylesheetPtr style,
|
xsltSaveResultToFilename (const char *URI,
|
||||||
int compression);
|
xmlDocPtr result,
|
||||||
XSLTPUBFUN int XSLTCALL
|
xsltStylesheetPtr style,
|
||||||
xsltSaveResultToFile (FILE *file,
|
int compression);
|
||||||
xmlDocPtr result,
|
XSLTPUBFUN int XSLTCALL
|
||||||
xsltStylesheetPtr style);
|
xsltSaveResultToFile (FILE *file,
|
||||||
XSLTPUBFUN int XSLTCALL
|
xmlDocPtr result,
|
||||||
xsltSaveResultToFd (int fd,
|
xsltStylesheetPtr style);
|
||||||
xmlDocPtr result,
|
XSLTPUBFUN int XSLTCALL
|
||||||
xsltStylesheetPtr style);
|
xsltSaveResultToFd (int fd,
|
||||||
XSLTPUBFUN int XSLTCALL
|
xmlDocPtr result,
|
||||||
xsltSaveResultToString (xmlChar **doc_txt_ptr,
|
xsltStylesheetPtr style);
|
||||||
int * doc_txt_len,
|
XSLTPUBFUN int XSLTCALL
|
||||||
xmlDocPtr result,
|
xsltSaveResultToString (xmlChar **doc_txt_ptr,
|
||||||
xsltStylesheetPtr style);
|
int * doc_txt_len,
|
||||||
|
xmlDocPtr result,
|
||||||
/*
|
xsltStylesheetPtr style);
|
||||||
* XPath interface
|
|
||||||
*/
|
/*
|
||||||
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
* XPath interface
|
||||||
xsltXPathCompile (xsltStylesheetPtr style,
|
*/
|
||||||
const xmlChar *str);
|
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||||
|
xsltXPathCompile (xsltStylesheetPtr style,
|
||||||
/*
|
const xmlChar *str);
|
||||||
* Profiling.
|
|
||||||
*/
|
/*
|
||||||
XSLTPUBFUN void XSLTCALL
|
* Profiling.
|
||||||
xsltSaveProfiling (xsltTransformContextPtr ctxt,
|
*/
|
||||||
FILE *output);
|
XSLTPUBFUN void XSLTCALL
|
||||||
XSLTPUBFUN xmlDocPtr XSLTCALL
|
xsltSaveProfiling (xsltTransformContextPtr ctxt,
|
||||||
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
|
FILE *output);
|
||||||
|
XSLTPUBFUN xmlDocPtr XSLTCALL
|
||||||
XSLTPUBFUN long XSLTCALL
|
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
|
||||||
xsltTimestamp (void);
|
|
||||||
XSLTPUBFUN void XSLTCALL
|
XSLTPUBFUN long XSLTCALL
|
||||||
xsltCalibrateAdjust (long delta);
|
xsltTimestamp (void);
|
||||||
|
XSLTPUBFUN void XSLTCALL
|
||||||
/**
|
xsltCalibrateAdjust (long delta);
|
||||||
* XSLT_TIMESTAMP_TICS_PER_SEC:
|
|
||||||
*
|
/**
|
||||||
* Sampling precision for profiling
|
* XSLT_TIMESTAMP_TICS_PER_SEC:
|
||||||
*/
|
*
|
||||||
#define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
|
* Sampling precision for profiling
|
||||||
|
*/
|
||||||
/*
|
#define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
|
||||||
* Hooks for the debugger.
|
|
||||||
*/
|
/*
|
||||||
|
* Hooks for the debugger.
|
||||||
typedef enum {
|
*/
|
||||||
XSLT_DEBUG_NONE = 0, /* no debugging allowed */
|
|
||||||
XSLT_DEBUG_INIT,
|
typedef enum {
|
||||||
XSLT_DEBUG_STEP,
|
XSLT_DEBUG_NONE = 0, /* no debugging allowed */
|
||||||
XSLT_DEBUG_STEPOUT,
|
XSLT_DEBUG_INIT,
|
||||||
XSLT_DEBUG_NEXT,
|
XSLT_DEBUG_STEP,
|
||||||
XSLT_DEBUG_STOP,
|
XSLT_DEBUG_STEPOUT,
|
||||||
XSLT_DEBUG_CONT,
|
XSLT_DEBUG_NEXT,
|
||||||
XSLT_DEBUG_RUN,
|
XSLT_DEBUG_STOP,
|
||||||
XSLT_DEBUG_RUN_RESTART,
|
XSLT_DEBUG_CONT,
|
||||||
XSLT_DEBUG_QUIT
|
XSLT_DEBUG_RUN,
|
||||||
} xsltDebugStatusCodes;
|
XSLT_DEBUG_RUN_RESTART,
|
||||||
|
XSLT_DEBUG_QUIT
|
||||||
XSLTPUBVAR int xslDebugStatus;
|
} xsltDebugStatusCodes;
|
||||||
|
|
||||||
typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node,
|
XSLTPUBVAR int xslDebugStatus;
|
||||||
xsltTemplatePtr templ, xsltTransformContextPtr ctxt);
|
|
||||||
typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source);
|
typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node,
|
||||||
typedef void (*xsltDropCallCallback) (void);
|
xsltTemplatePtr templ, xsltTransformContextPtr ctxt);
|
||||||
|
typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source);
|
||||||
XSLTPUBFUN void XSLTCALL
|
typedef void (*xsltDropCallCallback) (void);
|
||||||
xsltSetDebuggerStatus (int value);
|
|
||||||
XSLTPUBFUN int XSLTCALL
|
XSLTPUBFUN void XSLTCALL
|
||||||
xsltGetDebuggerStatus (void);
|
xsltSetDebuggerStatus (int value);
|
||||||
XSLTPUBFUN int XSLTCALL
|
XSLTPUBFUN int XSLTCALL
|
||||||
xsltSetDebuggerCallbacks (int no, void *block);
|
xsltGetDebuggerStatus (void);
|
||||||
XSLTPUBFUN int XSLTCALL
|
XSLTPUBFUN int XSLTCALL
|
||||||
xslAddCall (xsltTemplatePtr templ,
|
xsltSetDebuggerCallbacks (int no, void *block);
|
||||||
xmlNodePtr source);
|
XSLTPUBFUN int XSLTCALL
|
||||||
XSLTPUBFUN void XSLTCALL
|
xslAddCall (xsltTemplatePtr templ,
|
||||||
xslDropCall (void);
|
xmlNodePtr source);
|
||||||
|
XSLTPUBFUN void XSLTCALL
|
||||||
#ifdef __cplusplus
|
xslDropCall (void);
|
||||||
}
|
|
||||||
#endif
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
#endif /* __XML_XSLTUTILS_H__ */
|
#endif
|
||||||
|
|
||||||
|
#endif /* __XML_XSLTUTILS_H__ */
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user