ReactOS 0.4.16-dev-306-g647d351
|
#include "precomp.h"
Go to the source code of this file.
Macros | |
#define | XSLT_VAR_GLOBAL (1<<0) |
#define | XSLT_VAR_IN_SELECT (1<<1) |
#define | XSLT_TCTXT_VARIABLE(c) ((xsltStackElemPtr) (c)->contextVariable) |
Functions | |
xmlDocPtr | xsltCreateRVT (xsltTransformContextPtr ctxt) |
int | xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
int | xsltRegisterLocalRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
int | xsltExtensionInstructionResultFinalize (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED) |
int | xsltExtensionInstructionResultRegister (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, xmlXPathObjectPtr obj ATTRIBUTE_UNUSED) |
int | xsltFlagRVTs (xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, void *val) |
void | xsltReleaseRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
int | xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
void | xsltFreeRVTs (xsltTransformContextPtr ctxt) |
static xsltStackElemPtr | xsltNewStackElem (xsltTransformContextPtr ctxt) |
static xsltStackElemPtr | xsltCopyStackElem (xsltStackElemPtr elem) |
static void | xsltFreeStackElem (xsltStackElemPtr elem) |
static void | xsltFreeStackElemEntry (void *payload, const xmlChar *name ATTRIBUTE_UNUSED) |
void | xsltFreeStackElemList (xsltStackElemPtr elem) |
: the local part of the name | |
xsltStackLookup: @ctxt: an XSLT transformation context @nameURI: the URI part of the name Locate an element in the stack based on its name. | |
static xsltStackElemPtr | xsltStackLookup (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI) |
: the variable name | |
xsltXPathVariableLookup: @ctxt: a void * but the the XSLT transformation context actually @ns_uri: the variable namespace URI This is the entry point when a varibale is needed by the XPath interpretor. Returns the value or NULL if not found | |
static int | xsltCheckStackElem (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI) |
static int | xsltAddStackElem (xsltTransformContextPtr ctxt, xsltStackElemPtr elem) |
int | xsltAddStackElemList (xsltTransformContextPtr ctxt, xsltStackElemPtr elems) |
static xmlXPathObjectPtr | xsltEvalVariable (xsltTransformContextPtr ctxt, xsltStackElemPtr variable, xsltStylePreCompPtr castedComp) |
static xmlXPathObjectPtr | xsltEvalGlobalVariable (xsltStackElemPtr elem, xsltTransformContextPtr ctxt) |
static void | xsltEvalGlobalVariableWrapper (void *payload, void *data, const xmlChar *name ATTRIBUTE_UNUSED) |
int | xsltEvalGlobalVariables (xsltTransformContextPtr ctxt) |
static int | xsltRegisterGlobalVariable (xsltStylesheetPtr style, const xmlChar *name, const xmlChar *ns_uri, const xmlChar *sel, xmlNodePtr tree, xsltStylePreCompPtr comp, const xmlChar *value) |
static xmlXPathObjectPtr | xsltGlobalVariableLookup (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri) |
xmlXPathObjectPtr | xsltVariableLookup (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri) |
xsltStackElemPtr | xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt, xmlNodePtr inst) |
void | xsltParseGlobalVariable (xsltStylesheetPtr style, xmlNodePtr cur) |
void | xsltParseGlobalParam (xsltStylesheetPtr style, xmlNodePtr cur) |
void | xsltParseStylesheetVariable (xsltTransformContextPtr ctxt, xmlNodePtr inst) |
void | xsltParseStylesheetParam (xsltTransformContextPtr ctxt, xmlNodePtr cur) |
void | xsltFreeGlobalVariables (xsltTransformContextPtr ctxt) |
xmlXPathObjectPtr | xsltXPathVariableLookup (void *ctxt, const xmlChar *name, const xmlChar *ns_uri) |
: a null terminated parameter name | |
xsltProcessUserParamInternal @ctxt: the XSLT transformation context @value: a null terminated value (may be an XPath expression) @eval: 0 to treat the value literally, else evaluate as XPath expression If @eval is 0 then @value is treated literally and is stored in the global parameter/variable table without any change. Uf @eval is 1 then @value is treated as an XPath expression and is evaluated. In this case, if you want to pass a string which will be interpreted literally then it must be enclosed in single or double quotes. If the string contains single quotes (double quotes) then it cannot be enclosed single quotes (double quotes). If the string which you want to be treated literally contains both single and double quotes (e.g. Meet at Joe's for "Twelfth Night" at 7 o'clock) then there is no suitable quoting character. You cannot use ' or " inside the string because the replacement of character entities with their equivalents is done at a different stage of processing. The solution is to call xsltQuoteUserParams or xsltQuoteOneUserParam. This needs to be done on parsed stylesheets before starting to apply transformations. Normally this will be called (directly or indirectly) only from xsltEvalUserParams, xsltEvalOneUserParam, xsltQuoteUserParams, or xsltQuoteOneUserParam. Returns 0 in case of success, -1 in case of error | |
static int | xsltProcessUserParamInternal (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *value, int eval) |
int | xsltEvalUserParams (xsltTransformContextPtr ctxt, const char **params) |
int | xsltQuoteUserParams (xsltTransformContextPtr ctxt, const char **params) |
: a null terminated string giving the name of the parameter | |
xsltQuoteOneUserParam: @ctxt: the XSLT transformation context @value: a null terminated string giving the parameter value This is normally called from xsltQuoteUserParams to process a single parameter from a list of parameters. The @value is stored in the context's global variable/parameter hash table. Returns 0 in case of success, -1 in case of error. | |
int | xsltEvalOneUserParam (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *value) |
int | xsltQuoteOneUserParam (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *value) |
static xsltStackElemPtr | xsltBuildVariable (xsltTransformContextPtr ctxt, xsltStylePreCompPtr castedComp, xmlNodePtr tree) |
static int | xsltRegisterVariable (xsltTransformContextPtr ctxt, xsltStylePreCompPtr castedComp, xmlNodePtr tree, int isParam) |
Variables | |
static const xmlChar * | xsltComputingGlobalVarMarker |
#define XSLT_TCTXT_VARIABLE | ( | c | ) | ((xsltStackElemPtr) (c)->contextVariable) |
Definition at line 27 of file variables.c.
#define XSLT_VAR_GLOBAL (1<<0) |
Definition at line 25 of file variables.c.
#define XSLT_VAR_IN_SELECT (1<<1) |
Definition at line 26 of file variables.c.
|
static |
xsltAddStackElem: @ctxt: xn XSLT transformation context @elem: a stack element
Push an element (or list) onto the stack. In case of a list, each member will be pushed into a seperate slot; i.e. there's always 1 stack entry for 1 stack element.
Returns 0 in case of success, -1 in case of failure.
Definition at line 731 of file variables.c.
Referenced by xsltAddStackElemList(), and xsltRegisterVariable().
int xsltAddStackElemList | ( | xsltTransformContextPtr | ctxt, |
xsltStackElemPtr | elems | ||
) |
xsltAddStackElemList: @ctxt: xn XSLT transformation context @elems: a stack element list
Push an element list onto the stack.
Returns 0 in case of success, -1 in case of failure.
Definition at line 777 of file variables.c.
|
static |
xsltBuildVariable: @ctxt: the XSLT transformation context @comp: the precompiled form @tree: the tree if select is NULL
Computes a new variable value.
Returns the xsltStackElemPtr or NULL in case of error
Definition at line 1766 of file variables.c.
Referenced by xsltParseStylesheetCallerParam(), and xsltRegisterVariable().
|
static |
Definition at line 696 of file variables.c.
Referenced by xsltRegisterVariable().
|
static |
xsltCopyStackElem: @elem: an XSLT stack element
Makes a copy of the stack element
Returns the copy of NULL
Definition at line 516 of file variables.c.
Referenced by xsltEvalGlobalVariables().
xmlDocPtr xsltCreateRVT | ( | xsltTransformContextPtr | ctxt | ) |
xsltCreateRVT: @ctxt: an XSLT transformation context
Creates a Result Value Tree (the XSLT 1.0 term for this is "Result Tree Fragment")
Returns the result value tree or NULL in case of API or internal errors.
Definition at line 44 of file variables.c.
Referenced by xsltEvalGlobalVariable(), and xsltEvalVariable().
|
static |
xsltEvalGlobalVariable: @elem: the variable or parameter @ctxt: the XSLT transformation context
Evaluates a the value of a global xsl:variable or xsl:param declaration.
Returns the XPath Object value or NULL in case of error
Definition at line 1032 of file variables.c.
Referenced by xsltEvalGlobalVariableWrapper(), and xsltGlobalVariableLookup().
int xsltEvalGlobalVariables | ( | xsltTransformContextPtr | ctxt | ) |
xsltEvalGlobalVariables: @ctxt: the XSLT transformation context
Evaluates all global variables and parameters of a stylesheet. For internal use only. This is called at start of a transformation.
Returns 0 in case of success, -1 in case of error
Definition at line 1260 of file variables.c.
Referenced by xsltApplyStylesheetInternal().
|
static |
Definition at line 1244 of file variables.c.
Referenced by xsltEvalGlobalVariables().
int xsltEvalOneUserParam | ( | xsltTransformContextPtr | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | value | ||
) |
Definition at line 1727 of file variables.c.
Referenced by xsltEvalUserParams().
int xsltEvalUserParams | ( | xsltTransformContextPtr | ctxt, |
const char ** | params | ||
) |
xsltEvalUserParams:
@ctxt: the XSLT transformation context @params: a NULL terminated array of parameters name/value tuples
Evaluate the global variables of a stylesheet. This needs to be done on parsed stylesheets before starting to apply transformations. Each of the parameters is evaluated as an XPath expression and stored in the global variables/parameter hash table. If you want your parameter used literally, use xsltQuoteUserParams.
Returns 0 in case of success, -1 in case of error
Definition at line 1662 of file variables.c.
Referenced by xsltApplyStylesheetInternal().
|
static |
xsltEvalVariable: @ctxt: the XSLT transformation context @variable: the variable or parameter item @comp: the compiled XSLT instruction
Evaluate a variable value.
Returns the XPath Object value or NULL in case of error
Definition at line 799 of file variables.c.
Referenced by xsltBuildVariable(), xsltVariableLookup(), and xsltXPathVariableLookup().
int xsltExtensionInstructionResultFinalize | ( | xsltTransformContextPtr ctxt | ATTRIBUTE_UNUSED | ) |
xsltExtensionInstructionResultFinalize: @ctxt: an XSLT transformation context
Finalizes the data (e.g. result tree fragments) created within a value-returning process (e.g. EXSLT's function). Tree fragments marked as being returned by a function are set to normal state, which means that the fragment garbage collector will free them after the function-calling process exits.
Returns 0 in case of success and -1 in case of API or internal errors.
This function is unsupported in newer releases of libxslt.
Definition at line 187 of file variables.c.
int xsltExtensionInstructionResultRegister | ( | xsltTransformContextPtr ctxt | ATTRIBUTE_UNUSED, |
xmlXPathObjectPtr obj | ATTRIBUTE_UNUSED | ||
) |
xsltExtensionInstructionResultRegister: @ctxt: an XSLT transformation context @obj: an XPath object to be inspected for result tree fragments
Marks the result of a value-returning extension instruction in order to avoid it being garbage collected before the extension instruction exits. Note that one still has to additionally register any newly created tree fragments (via xsltCreateRVT()) with xsltRegisterLocalRVT().
Returns 0 in case of success and -1 in case of error.
It isn't necessary to call this function in newer releases of libxslt.
Definition at line 213 of file variables.c.
int xsltFlagRVTs | ( | xsltTransformContextPtr | ctxt, |
xmlXPathObjectPtr | obj, | ||
void * | val | ||
) |
xsltFlagRVTs: @ctxt: an XSLT transformation context @obj: an XPath object to be inspected for result tree fragments @val: the flag value
Updates ownership information of RVTs in @obj according to @val.
@val = XSLT_RVT_FUNC_RESULT for the result of an extension function, so its RVTs won't be destroyed after leaving the returning scope. @val = XSLT_RVT_LOCAL for the result of an extension function to reset the state of its RVTs after it was returned to a new scope. @val = XSLT_RVT_GLOBAL for parts of global variables.
Returns 0 in case of success and -1 in case of error.
Definition at line 237 of file variables.c.
Referenced by xsltEvalGlobalVariable().
void xsltFreeGlobalVariables | ( | xsltTransformContextPtr | ctxt | ) |
xsltFreeGlobalVariables: @ctxt: the XSLT transformation context
Free up the data associated to the global variables its value.
Definition at line 2227 of file variables.c.
Referenced by xsltFreeTransformContext().
void xsltFreeRVTs | ( | xsltTransformContextPtr | ctxt | ) |
xsltFreeRVTs: @ctxt: an XSLT transformation context
Frees all registered result value trees (Result Tree Fragments) of the transformation. Internal function; should not be called by user-code.
Definition at line 416 of file variables.c.
Referenced by xsltApplyStylesheetInternal(), and xsltFreeTransformContext().
|
static |
xsltFreeStackElem: @elem: an XSLT stack element
Free up the memory allocated by @elem
Definition at line 542 of file variables.c.
Referenced by xsltFreeStackElemEntry(), xsltFreeStackElemList(), and xsltProcessUserParamInternal().
void xsltFreeStackElemList | ( | xsltStackElemPtr | elem | ) |
xsltFreeStackElemList: @elem: an XSLT stack element
Free up the memory allocated by @elem
Definition at line 603 of file variables.c.
Referenced by xsltApplyStylesheetInternal(), xsltApplyTemplates(), xsltCallTemplate(), xsltFreeStylesheet(), xsltLocalVariablePop(), and xsltTemplateParamsCleanup().
|
static |
Definition at line 1873 of file variables.c.
Referenced by xsltVariableLookup(), and xsltXPathVariableLookup().
|
static |
xsltNewStackElem:
Create a new XSLT ParserContext
Returns the newly allocated xsltParserStackElem or NULL in case of error
Definition at line 480 of file variables.c.
Referenced by xsltBuildVariable(), xsltProcessUserParamInternal(), and xsltRegisterGlobalVariable().
void xsltParseGlobalParam | ( | xsltStylesheetPtr | style, |
xmlNodePtr | cur | ||
) |
xsltParseGlobalParam: @style: the XSLT stylesheet @cur: the "param" element
parse an XSLT transformation param declaration and record its value.
Definition at line 2087 of file variables.c.
Referenced by xsltParseStylesheetTop().
void xsltParseGlobalVariable | ( | xsltStylesheetPtr | style, |
xmlNodePtr | cur | ||
) |
xsltParseGlobalVariable: @style: the XSLT stylesheet @cur: the "variable" element
Parses a global XSLT 'variable' declaration at compilation time and registers it
Definition at line 2024 of file variables.c.
Referenced by xsltParseStylesheetTop().
xsltStackElemPtr xsltParseStylesheetCallerParam | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | inst | ||
) |
xsltParseStylesheetCallerParam: @ctxt: the XSLT transformation context @inst: the xsl:with-param instruction element
Processes an xsl:with-param instruction at transformation time. The value is computed, but not recorded. NOTE that this is also called with an xsl:param element from exsltFuncFunctionFunction().
Returns the new xsltStackElemPtr or NULL
Definition at line 1962 of file variables.c.
Referenced by xsltApplyTemplates(), and xsltCallTemplate().
void xsltParseStylesheetParam | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | cur | ||
) |
xsltParseStylesheetParam: @ctxt: the XSLT transformation context @cur: the XSLT 'param' element
Registers a local XSLT 'param' declaration at transformation time and evaluates its value.
Definition at line 2191 of file variables.c.
Referenced by xsltApplyXSLTTemplate().
void xsltParseStylesheetVariable | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | inst | ||
) |
xsltParseStylesheetVariable: @ctxt: the XSLT transformation context @inst: the xsl:variable instruction element
Registers a local XSLT 'variable' instruction at transformation time and evaluates its value.
Definition at line 2149 of file variables.c.
Referenced by xsltApplySequenceConstructor().
|
static |
Definition at line 1438 of file variables.c.
Referenced by xsltEvalOneUserParam(), and xsltQuoteOneUserParam().
int xsltQuoteOneUserParam | ( | xsltTransformContextPtr | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | value | ||
) |
Definition at line 1748 of file variables.c.
Referenced by xsltQuoteUserParams().
int xsltQuoteUserParams | ( | xsltTransformContextPtr | ctxt, |
const char ** | params | ||
) |
xsltQuoteUserParams:
@ctxt: the XSLT transformation context @params: a NULL terminated arry of parameters names/values tuples
Similar to xsltEvalUserParams, but the values are treated literally and are * not evaluated as XPath expressions. This should be done on parsed stylesheets before starting to apply transformations.
Returns 0 in case of success, -1 in case of error.
Definition at line 1692 of file variables.c.
|
static |
Definition at line 1345 of file variables.c.
Referenced by xsltParseGlobalParam(), and xsltParseGlobalVariable().
int xsltRegisterLocalRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltRegisterLocalRVT: @ctxt: an XSLT transformation context @RVT: a result value tree (Result Tree Fragment; xmlDocPtr)
Registers a result value tree (XSLT 1.0 term: Result Tree Fragment) in the RVT garbage collector. The fragment will be freed when the instruction which created the fragment exits.
Returns 0 in case of success and -1 in case of API or internal errors.
Definition at line 138 of file variables.c.
Referenced by xsltFreeStackElem(), and xsltReleaseLocalRVTs().
int xsltRegisterPersistRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltRegisterPersistRVT: @ctxt: an XSLT transformation context @RVT: a result value tree (Result Tree Fragment)
Register the result value tree (XSLT 1.0 term: Result Tree Fragment) in the fragment garbage collector. The fragment will be freed when the transformation context is freed.
Returns 0 in case of success and -1 in case of error.
Definition at line 394 of file variables.c.
Referenced by xsltEvalGlobalVariable(), and xsltReleaseLocalRVTs().
int xsltRegisterTmpRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltRegisterTmpRVT: @ctxt: an XSLT transformation context @RVT: a result value tree (Result Tree Fragment)
Registers the result value tree (XSLT 1.0 term: Result Tree Fragment) in the garbage collector. The fragment will be freed at the exit of the currently instantiated xsl:template. Obsolete; this function might produce massive memory overhead, since the fragment is only freed when the current xsl:template exits. Use xsltRegisterLocalRVT() instead.
Returns 0 in case of success and -1 in case of API or internal errors.
Definition at line 99 of file variables.c.
|
static |
xsltRegisterVariable: @ctxt: the XSLT transformation context @comp: the compiled XSLT-variable (or param) instruction @tree: the tree if select is NULL @isParam: indicates if this is a parameter
Computes and registers a new variable.
Returns 0 in case of success, -1 in case of error
Definition at line 1813 of file variables.c.
Referenced by xsltParseStylesheetParam(), and xsltParseStylesheetVariable().
void xsltReleaseRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltReleaseRVT: @ctxt: an XSLT transformation context @RVT: a result value tree (Result Tree Fragment)
Either frees the RVT (which is an xmlDoc) or stores it in the context's cache for later reuse.
Definition at line 328 of file variables.c.
Referenced by xsltApplyXSLTTemplate(), xsltFreeStackElem(), and xsltReleaseLocalRVTs().
|
static |
Definition at line 627 of file variables.c.
Referenced by xsltCheckStackElem(), and xsltVariableLookup().
xmlXPathObjectPtr xsltVariableLookup | ( | xsltTransformContextPtr | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | ns_uri | ||
) |
Definition at line 1920 of file variables.c.
xmlXPathObjectPtr xsltXPathVariableLookup | ( | void * | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | ns_uri | ||
) |
Definition at line 2243 of file variables.c.
Definition at line 22 of file variables.c.
Referenced by xsltEvalGlobalVariable(), and xsltGlobalVariableLookup().