Eneboo - Documentación para desarrolladores
Clases | 'defines' | 'typedefs' | Enumeraciones | Funciones
Referencia del Archivo src/libxslt/libxslt/xsltInternals.h
#include <libxml/tree.h>
#include <libxml/hash.h>
#include <libxml/xpath.h>
#include <libxml/xmlerror.h>
#include <libxml/dict.h>
#include <libxml/xmlstring.h>
#include <libxslt/xslt.h>
#include "xsltexports.h"
#include "xsltlocale.h"
#include "numbersInternals.h"

Ir al código fuente de este archivo.


struct  _xsltRuntimeExtra
struct  _xsltTemplate
struct  _xsltDecimalFormat
struct  _xsltDocument
struct  _xsltKeyDef
struct  _xsltKeyTable
struct  _xsltElemPreComp
struct  _xsltStylePreComp
struct  _xsltStackElem
struct  _xsltStylesheet
struct  _xsltTransformCache
struct  _xsltTransformContext


#define XSLT_IS_TEXT_NODE(n)
#define XSLT_MARK_RES_TREE_FRAG(n)   (n)->name = (char *) xmlStrdup(BAD_CAST " fake node libxslt");
#define XSLT_FAST_IF
#define XSLT_MAX_SORT   15
#define XSLT_PAT_NO_PRIORITY   -12345789
#define XSLT_RUNTIME_EXTRA_LST(ctxt, nr)   (ctxt)->extras[(nr)].info
#define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr)   (ctxt)->extras[(nr)].deallocate
#define XSLT_RUNTIME_EXTRA(ctxt, nr, typ)   (ctxt)->extras[(nr)].val.typ
#define CHECK_STOPPED   if (ctxt->state == XSLT_STATE_STOPPED) return;
#define CHECK_STOPPEDE   if (ctxt->state == XSLT_STATE_STOPPED) goto error;
#define CHECK_STOPPED0   if (ctxt->state == XSLT_STATE_STOPPED) return(0);
#define XML_CAST_FPTR(fptr)   fptr


typedef struct _xsltRuntimeExtra xsltRuntimeExtra
typedef xsltRuntimeExtraxsltRuntimeExtraPtr
typedef struct _xsltTemplate xsltTemplate
typedef xsltTemplatexsltTemplatePtr
typedef struct _xsltDecimalFormat xsltDecimalFormat
typedef xsltDecimalFormatxsltDecimalFormatPtr
typedef struct _xsltDocument xsltDocument
typedef xsltDocumentxsltDocumentPtr
typedef struct _xsltKeyDef xsltKeyDef
typedef xsltKeyDefxsltKeyDefPtr
typedef struct _xsltKeyTable xsltKeyTable
typedef xsltKeyTablexsltKeyTablePtr
typedef struct _xsltStylesheet xsltStylesheet
typedef xsltStylesheetxsltStylesheetPtr
typedef struct
typedef xsltTransformContextxsltTransformContextPtr
typedef struct _xsltElemPreComp xsltElemPreComp
typedef xsltElemPreCompxsltElemPreCompPtr
typedef void(* xsltTransformFunction )(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltElemPreCompPtr comp)
typedef void(* xsltSortFunc )(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
typedef void(* xsltElemPreCompDeallocator )(xsltElemPreCompPtr comp)
typedef struct _xsltStylePreComp xsltStylePreComp
typedef xsltStylePreCompxsltStylePreCompPtr
typedef struct _xsltStackElem xsltStackElem
typedef xsltStackElemxsltStackElemPtr
typedef struct _xsltTransformCache xsltTransformCache
typedef xsltTransformCachexsltTransformCachePtr


enum  xsltStyleType {


XSLTPUBFUN xsltStylesheetPtr
xsltNewStylesheet (void)
XSLTPUBFUN xsltStylesheetPtr
xsltParseStylesheetFile (const xmlChar *filename)
XSLTPUBFUN void XSLTCALL xsltFreeStylesheet (xsltStylesheetPtr style)
XSLTPUBFUN int XSLTCALL xsltIsBlank (xmlChar *str)
XSLTPUBFUN void XSLTCALL xsltFreeStackElemList (xsltStackElemPtr elem)
xsltDecimalFormatPtr XSLTCALL 
xsltDecimalFormatGetByName (xsltStylesheetPtr style, xmlChar *name)
XSLTPUBFUN xsltStylesheetPtr
xsltParseStylesheetProcess (xsltStylesheetPtr ret, xmlDocPtr doc)
XSLTPUBFUN void XSLTCALL xsltParseStylesheetOutput (xsltStylesheetPtr style, xmlNodePtr cur)
XSLTPUBFUN xsltStylesheetPtr
xsltParseStylesheetDoc (xmlDocPtr doc)
XSLTPUBFUN xsltStylesheetPtr
xsltParseStylesheetImportedDoc (xmlDocPtr doc, xsltStylesheetPtr style)
XSLTPUBFUN xsltStylesheetPtr
xsltLoadStylesheetPI (xmlDocPtr doc)
XSLTPUBFUN void XSLTCALL xsltNumberFormat (xsltTransformContextPtr ctxt, xsltNumberDataPtr data, xmlNodePtr node)
XSLTPUBFUN xmlXPathError XSLTCALL xsltFormatNumberConversion (xsltDecimalFormatPtr self, xmlChar *format, double number, xmlChar **result)
XSLTPUBFUN void XSLTCALL xsltParseTemplateContent (xsltStylesheetPtr style, xmlNodePtr templ)
XSLTPUBFUN int XSLTCALL xsltAllocateExtra (xsltStylesheetPtr style)
XSLTPUBFUN int XSLTCALL xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt)
XSLTPUBFUN xmlDocPtr XSLTCALL xsltCreateRVT (xsltTransformContextPtr ctxt)
XSLTPUBFUN int XSLTCALL xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT)
XSLTPUBFUN int XSLTCALL xsltRegisterLocalRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT)
XSLTPUBFUN int XSLTCALL xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT)
XSLTPUBFUN int XSLTCALL xsltExtensionInstructionResultRegister (xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj)
XSLTPUBFUN int XSLTCALL xsltExtensionInstructionResultFinalize (xsltTransformContextPtr ctxt)
XSLTPUBFUN void XSLTCALL xsltFreeRVTs (xsltTransformContextPtr ctxt)
XSLTPUBFUN void XSLTCALL xsltReleaseRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT)
XSLTPUBFUN int XSLTCALL xsltTransStorageAdd (xsltTransformContextPtr ctxt, void *id, void *data)
XSLTPUBFUN void *XSLTCALL xsltTransStorageRemove (xsltTransformContextPtr ctxt, void *id)
XSLTPUBFUN void XSLTCALL xsltCompileAttr (xsltStylesheetPtr style, xmlAttrPtr attr)
XSLTPUBFUN xmlChar *XSLTCALL xsltEvalAVT (xsltTransformContextPtr ctxt, void *avt, xmlNodePtr node)
XSLTPUBFUN void XSLTCALL xsltFreeAVTList (void *avt)
XSLTPUBFUN void XSLTCALL xsltUninit (void)
XSLTPUBFUN int XSLTCALL xsltInitCtxtKey (xsltTransformContextPtr ctxt, xsltDocumentPtr doc, xsltKeyDefPtr keyd)
XSLTPUBFUN int XSLTCALL xsltInitAllDocKeys (xsltTransformContextPtr ctxt)

Documentación de los 'defines'

#define CHECK_STOPPED   if (ctxt->state == XSLT_STATE_STOPPED) return;


Macro to check if the XSLT processing should be stopped. Will return from the function.

#define CHECK_STOPPED0   if (ctxt->state == XSLT_STATE_STOPPED) return(0);


Macro to check if the XSLT processing should be stopped. Will return from the function with a 0 value.

#define CHECK_STOPPEDE   if (ctxt->state == XSLT_STATE_STOPPED) goto error;


Macro to check if the XSLT processing should be stopped. Will goto the error: label.

#define XML_CAST_FPTR (   fptr)    fptr

XML_CAST_FPTR: : pointer to a function

Macro to do a casting from an object pointer to a function pointer without encountering a warning from gcc

#define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) This macro violated ISO C aliasing rules (gcc4 on s390 broke) so it is disabled now

#define XSLT_FAST_IF


Internal define to enable usage of xmlXPathCompiledEvalToBoolean() for XSLT "tests"; e.g. in <xsl:if test="/foo/bar">

#define XSLT_IS_RES_TREE_FRAG (   n)
((n != NULL) && ((n)->type == XML_DOCUMENT_NODE) && \
     ((n)->name != NULL) && ((n)->name[0] == ' '))


internal macro to test tree fragments

#define XSLT_IS_TEXT_NODE (   n)
((n != NULL) && \
    (((n)->type == XML_TEXT_NODE) || \
     ((n)->type == XML_CDATA_SECTION_NODE)))


check if the argument is a text node

#define XSLT_MARK_RES_TREE_FRAG (   n)    (n)->name = (char *) xmlStrdup(BAD_CAST " fake node libxslt");


internal macro to set up tree fragments

#define XSLT_MAX_SORT   15


Internal define to enable the refactored parts of Libxslt related to parsing. XSLT_MAX_SORT:

Max number of specified xsl:sort on an element.

#define XSLT_PAT_NO_PRIORITY   -12345789


Specific value for pattern without priority expressed.



Internal define to enable on-demand xsl:key computation. That's the only mode now but the define is kept for compatibility



Internal define to enable the refactored parts of Libxslt. XSLT_REFACTORED_VARS:

Internal define to enable the refactored variable part of libxslt

#define XSLT_RUNTIME_EXTRA (   ctxt,
)    (ctxt)->extras[(nr)].val.typ

XSLT_RUNTIME_EXTRA: : the transformation context : the index

Macro used to define extra information stored in the context

#define XSLT_RUNTIME_EXTRA_FREE (   ctxt,
)    (ctxt)->extras[(nr)].deallocate

XSLT_RUNTIME_EXTRA_FREE: : the transformation context : the index

Macro used to free extra information stored in the context

#define XSLT_RUNTIME_EXTRA_LST (   ctxt,
)    (ctxt)->extras[(nr)].info

XSLT_RUNTIME_EXTRA_LST: : the transformation context : the index

Macro used to access extra information stored in the context

Documentación de los 'typedefs'


Data structure of decimal-format.

typedef struct _xsltDocument xsltDocument


Data structure associated to a parsed document.


The in-memory structure corresponding to element precomputed data, designed to be extended by extension implementors.

xsltElemPreCompDeallocator: : the xsltElemPreComp to free up

Deallocates an xsltElemPreComp structure.

typedef struct _xsltKeyDef xsltKeyDef


Representation of an xsl:key.

typedef struct _xsltKeyTable xsltKeyTable


Holds the computed keys for key definitions of the same QName. Is owned by an xsltDocument.


Extra information added to the transformation context.

typedef void(* xsltSortFunc)(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)

xsltSortFunc: : a transformation context : the node-set to sort : the number of sorts

Signature of the function to use during sorting

typedef struct _xsltStackElem xsltStackElem


The abstract basic structure for items of the XSLT processor. This includes: 1) compiled forms of XSLT instructions (xsl:if, xsl:attribute, etc.) 2) compiled forms of literal result elements 3) compiled forms of extension elements

typedef struct _xsltTemplate xsltTemplate


The in-memory structure corresponding to an XSLT Template.

xsltTransformFunction: : the XSLT transformation context : the input node : the stylesheet node : the compiled information from the stylesheet

Signature of the function associated to elements part of the stylesheet language like xsl:if or xsl:apply-templates.

Documentación de las enumeraciones

Valores de enumeraciones:
Valores de enumeraciones:
Valores de enumeraciones:

Documentación de las funciones

XSLTPUBFUN int XSLTCALL xsltAllocateExtra ( xsltStylesheetPtr  style)

xsltAllocateExtra: : an XSLT stylesheet

Allocate an extra runtime information slot statically while compiling the stylesheet and return its number

Returns the number of the slot

XSLTPUBFUN int XSLTCALL xsltAllocateExtraCtxt ( xsltTransformContextPtr  ctxt)

xsltAllocateExtraCtxt: : an XSLT transformation context

Allocate an extra runtime information slot at run-time and return its number This make sure there is a slot ready in the transformation context

Returns the number of the slot

XSLTPUBFUN void XSLTCALL xsltCompileAttr ( xsltStylesheetPtr  style,
xmlAttrPtr  attr 

xsltCompileAttr: : a XSLT process context : the attribute coming from the stylesheet.

Precompile an attribute in a stylesheet, basically it checks if it is an attrubute value template, and if yes establish some structures needed to process it at transformation time.

XSLTPUBFUN xmlDocPtr XSLTCALL xsltCreateRVT ( xsltTransformContextPtr  ctxt)

xsltCreateRVT: : 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.

XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL xsltDecimalFormatGetByName ( xsltStylesheetPtr  style,
xmlChar name 
XSLTPUBFUN xmlChar* XSLTCALL xsltEvalAVT ( xsltTransformContextPtr  ctxt,
void *  avt,
xmlNodePtr  node 

xsltEvalAVT: : the XSLT transformation context : the prevompiled attribute value template info : the node hosting the attribute

Process the given AVT, and return the new string value.

Returns the computed string value or NULL, must be deallocated by the caller.

XSLTPUBFUN int XSLTCALL 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.

XSLTPUBFUN int XSLTCALL 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.

XSLTPUBFUN xmlXPathError XSLTCALL xsltFormatNumberConversion ( xsltDecimalFormatPtr  self,
xmlChar format,
double  number,
xmlChar **  result 

xsltFormatNumberConversion: : the decimal format : the format requested : the value to format

: the place to ouput the result

format-number() uses the JDK 1.1 DecimalFormat class:



pattern := subpattern{;subpattern} subpattern := {prefix}integer{.fraction}{suffix} prefix := '\u0000'..'\uFFFD' - specialCharacters suffix := '\u0000'..'\uFFFD' - specialCharacters integer := '#'* '0'* '0' fraction := '0'* '#'*

Notation: X* 0 or more instances of X (X | Y) either X or Y. X..Y any character from X up to Y, inclusive. S - T characters in S, except those in T

Special Characters:

Symbol Meaning 0 a digit # a digit, zero shows as absent . placeholder for decimal separator , placeholder for grouping separator. ; separates formats.

  • default negative prefix. % multiply by 100 and show as percentage ? multiply by 1000 and show as per mille X any other characters can be used in the prefix or suffix ' used to quote special characters in a prefix or suffix.

Returns a possible XPath error

XSLTPUBFUN void XSLTCALL xsltFreeAVTList ( void *  avt)

xsltFreeAVTList: : pointer to an list of AVT structures

Free up the memory associated to the attribute value templates

XSLTPUBFUN void XSLTCALL 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.

XSLTPUBFUN void XSLTCALL xsltFreeStackElemList ( xsltStackElemPtr  elem)

xsltFreeStackElemList: : an XSLT stack element

Free up the memory allocated by

XSLTPUBFUN void XSLTCALL xsltFreeStylesheet ( xsltStylesheetPtr  style)

xsltFreeStylesheet: : an XSLT stylesheet

Free up the memory allocated by

XSLTPUBFUN int XSLTCALL xsltInitAllDocKeys ( xsltTransformContextPtr  ctxt)

xsltInitAllDocKeys: : transformation context


Check if any keys on the current document need to be computed

Returns 0 in case of success, -1 in case of failure

XSLTPUBFUN int XSLTCALL xsltInitCtxtKey ( xsltTransformContextPtr  ctxt,
xsltDocumentPtr  idoc,
xsltKeyDefPtr  keyDef 

xsltInitCtxtKey: : an XSLT transformation context : the document information (holds key values) : the key definition

Computes the key tables this key and for the current input document.

Returns: 0 on success, -1 on error

Multiple key definitions for the same name are allowed, so we must check if the key is already present for this doc

If the key was not previously defined, create it now and chain it to the list of keys for the doc

XSLTPUBFUN int XSLTCALL xsltIsBlank ( xmlChar str)

xsltIsBlank: : a string

Check if a string is ignorable

Returns 1 if the string is NULL or made of blanks chars, 0 otherwise

XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltLoadStylesheetPI ( xmlDocPtr  doc)

xsltLoadStylesheetPI: : a document to process

This function tries to locate the stylesheet PI in the given document If found, and if contained within the document, it will extract that subtree to build the stylesheet to process (doc itself will be modified). If found but referencing an external document it will attempt to load it and generate a stylesheet from it. In both cases, the resulting stylesheet and the document need to be freed once the transformation is done.

Returns a new XSLT stylesheet structure or NULL if not found.

XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltNewStylesheet ( void  )


Create a new XSLT Stylesheet

Returns the newly allocated xsltStylesheetPtr or NULL in case of error

XSLTPUBFUN void XSLTCALL xsltNumberFormat ( xsltTransformContextPtr  ctxt,
xsltNumberDataPtr  data,
xmlNodePtr  node 

xsltNumberFormat: : the XSLT transformation context : the formatting informations : the data to format

Convert one number.

XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetDoc ( xmlDocPtr  doc)

xsltParseStylesheetDoc: : and xmlDoc parsed XML

parse an XSLT stylesheet, building the associated structures. doc is kept as a reference within the returned stylesheet, so changes to doc after the parsing will be reflected when the stylesheet is applied, and the doc is automatically freed when the stylesheet is closed.

Returns a new XSLT stylesheet structure.

XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetFile ( const xmlChar filename)

xsltParseStylesheetFile: : the filename/URL to the stylesheet

Load and parse an XSLT stylesheet

Returns a new XSLT stylesheet structure.

XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetImportedDoc ( xmlDocPtr  doc,
xsltStylesheetPtr  parentStyle 

xsltParseStylesheetImportedDoc: : an xmlDoc parsed XML : pointer to the parent stylesheet (if it exists)

parse an XSLT stylesheet building the associated structures except the processing not needed for imported documents.

Returns a new XSLT stylesheet structure.

XSLTPUBFUN void XSLTCALL xsltParseStylesheetOutput ( xsltStylesheetPtr  style,
xmlNodePtr  cur 

xsltParseStylesheetOutput: : the XSLT stylesheet : the "output" element

parse an XSLT stylesheet output element and record information related to the stylesheet output

XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetProcess ( xsltStylesheetPtr  ret,
xmlDocPtr  doc 

xsltParseStylesheetProcess: : the XSLT stylesheet (the current stylesheet-level) : and xmlDoc parsed XML

Parses an XSLT stylesheet, adding the associated structures. Called by: xsltParseStylesheetImportedDoc() (xslt.c) xsltParseStylesheetInclude() (imports.c)

Returns the value of the parameter if everything went right, NULL if something went amiss.

XSLTPUBFUN void XSLTCALL xsltParseTemplateContent ( xsltStylesheetPtr  style,
xmlNodePtr  templ 

xsltParseTemplateContent: : the XSLT stylesheet : the container node (can be a document for literal results)

parse a template content-model Clean-up the template content from unwanted ignorable blank nodes and process xslt:text

XSLTPUBFUN int XSLTCALL 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.

XSLTPUBFUN int XSLTCALL 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.

XSLTPUBFUN int XSLTCALL 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.

XSLTPUBFUN void XSLTCALL 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.

XSLTPUBFUN int XSLTCALL xsltTransStorageAdd ( xsltTransformContextPtr  ctxt,
void *  id,
void *  data 
XSLTPUBFUN void* XSLTCALL xsltTransStorageRemove ( xsltTransformContextPtr  ctxt,
void *  id 
XSLTPUBFUN void XSLTCALL xsltUninit ( void  )


Uninitializes the processor.

 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'