Eneboo - Documentación para desarrolladores
|
#include "libxslt.h"
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/valid.h>
#include <libxml/hash.h>
#include <libxml/xmlerror.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/parserInternals.h>
#include <libxml/dict.h>
#include "xslt.h"
#include "xsltInternals.h"
#include "xsltutils.h"
#include "variables.h"
#include "transform.h"
#include "imports.h"
#include "preproc.h"
#include "keys.h"
'defines' | |
#define | IN_LIBXSLT |
#define | XSLT_VAR_GLOBAL 1<<0 |
#define | XSLT_VAR_IN_SELECT 1<<1 |
#define | XSLT_TCTXT_VARIABLE(c) ((xsltStackElemPtr) (c)->contextVariable) |
Funciones | |
xmlDocPtr | xsltCreateRVT (xsltTransformContextPtr ctxt) |
int | xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
int | xsltRegisterLocalRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
int | xsltExtensionInstructionResultFinalize (xsltTransformContextPtr ctxt) |
int | xsltExtensionInstructionResultRegister (xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj) |
void | xsltReleaseRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
int | xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT) |
void | xsltFreeRVTs (xsltTransformContextPtr ctxt) |
void | xsltFreeStackElemList (xsltStackElemPtr elem) |
: the local part of the name | |
xsltStackLookup: : an XSLT transformation context : the URI part of the name Locate an element in the stack based on its name. | |
: the variable name | |
xsltXPathVariableLookup: : a void * but the the XSLT transformation context actually : 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 | |
int | xsltAddStackElemList (xsltTransformContextPtr ctxt, xsltStackElemPtr elems) |
int | xsltEvalGlobalVariables (xsltTransformContextPtr ctxt) |
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 : the XSLT transformation context : a null terminated value (may be an XPath expression) : 0 to treat the value literally, else evaluate as XPath expression If is 0 then is treated literally and is stored in the global parameter/variable table without any change. Uf is 1 then 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 | |
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: : the XSLT transformation context : 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 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) |
Variables | |
const xmlChar * | xsltComputingGlobalVarMarker = " var/param being computed" |
#define IN_LIBXSLT |
#define XSLT_TCTXT_VARIABLE | ( | c | ) | ((xsltStackElemPtr) (c)->contextVariable) |
#define XSLT_VAR_GLOBAL 1<<0 |
#define XSLT_VAR_IN_SELECT 1<<1 |
int xsltAddStackElemList | ( | xsltTransformContextPtr | ctxt, |
xsltStackElemPtr | elems | ||
) |
xsltAddStackElemList: : xn XSLT transformation context : a stack element list
Push an element list onto the stack.
Returns 0 in case of success, -1 in case of failure.
xmlDocPtr xsltCreateRVT | ( | xsltTransformContextPtr | ctxt | ) |
int xsltEvalGlobalVariables | ( | xsltTransformContextPtr | ctxt | ) |
xsltEvalGlobalVariables: : 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
int xsltEvalOneUserParam | ( | xsltTransformContextPtr | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | value | ||
) |
int xsltEvalUserParams | ( | xsltTransformContextPtr | ctxt, |
const char ** | params | ||
) |
xsltEvalUserParams:
: the XSLT transformation context : 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
int xsltExtensionInstructionResultFinalize | ( | xsltTransformContextPtr | ctxt | ) |
xsltExtensionInstructionResultFinalize: : 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.
int xsltExtensionInstructionResultRegister | ( | xsltTransformContextPtr | ctxt, |
xmlXPathObjectPtr | obj | ||
) |
xsltExtensionInstructionResultRegister: : an XSLT transformation context : 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.
void xsltFreeGlobalVariables | ( | xsltTransformContextPtr | ctxt | ) |
xsltFreeGlobalVariables: : the XSLT transformation context
Free up the data associated to the global variables its value.
void xsltFreeRVTs | ( | xsltTransformContextPtr | ctxt | ) |
xsltFreeRVTs: : 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.
void xsltFreeStackElemList | ( | xsltStackElemPtr | elem | ) |
xsltFreeStackElemList: : an XSLT stack element
Free up the memory allocated by
void xsltParseGlobalParam | ( | xsltStylesheetPtr | style, |
xmlNodePtr | cur | ||
) |
xsltParseGlobalParam: : the XSLT stylesheet : the "param" element
parse an XSLT transformation param declaration and record its value.
void xsltParseGlobalVariable | ( | xsltStylesheetPtr | style, |
xmlNodePtr | cur | ||
) |
xsltParseGlobalVariable: : the XSLT stylesheet : the "variable" element
Parses a global XSLT 'variable' declaration at compilation time and registers it
xsltStackElemPtr xsltParseStylesheetCallerParam | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | inst | ||
) |
xsltParseStylesheetCallerParam: : the XSLT transformation context : the xsl:with-param instruction element
Processes an xsl:with-param instruction at transformation time. The value is compute, but not recorded. NOTE that this is also called with an *xsl:param* element from exsltFuncFunctionFunction().
Returns the new xsltStackElemPtr or NULL
void xsltParseStylesheetParam | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | cur | ||
) |
xsltParseStylesheetParam: : the XSLT transformation context : the XSLT 'param' element
Registers a local XSLT 'param' declaration at transformation time and evaluates its value.
void xsltParseStylesheetVariable | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | inst | ||
) |
xsltParseStylesheetVariable: : the XSLT transformation context : the xsl:variable instruction element
Registers a local XSLT 'variable' instruction at transformation time and evaluates its value.
int xsltQuoteOneUserParam | ( | xsltTransformContextPtr | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | value | ||
) |
int xsltQuoteUserParams | ( | xsltTransformContextPtr | ctxt, |
const char ** | params | ||
) |
xsltQuoteUserParams:
: the XSLT transformation context : 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.
int xsltRegisterLocalRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltRegisterLocalRVT: : an XSLT transformation context : 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.
int xsltRegisterPersistRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltRegisterPersistRVT: : an XSLT transformation context : 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.
int xsltRegisterTmpRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltRegisterTmpRVT: : an XSLT transformation context : 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.
void xsltReleaseRVT | ( | xsltTransformContextPtr | ctxt, |
xmlDocPtr | RVT | ||
) |
xsltReleaseRVT: : an XSLT transformation context : 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.
xmlXPathObjectPtr xsltVariableLookup | ( | xsltTransformContextPtr | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | ns_uri | ||
) |
xmlXPathObjectPtr xsltXPathVariableLookup | ( | void * | ctxt, |
const xmlChar * | name, | ||
const xmlChar * | ns_uri | ||
) |
const xmlChar* xsltComputingGlobalVarMarker = " var/param being computed" |