Eneboo - Documentación para desarrolladores
|
#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.
#define CHECK_STOPPED if (ctxt->state == XSLT_STATE_STOPPED) return; |
CHECK_STOPPED:
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); |
CHECK_STOPPED0:
Macro to check if the XSLT processing should be stopped. Will return from the function with a 0 value.
CHECK_STOPPEDE:
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 |
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] == ' '))
XSLT_IS_RES_TREE_FRAG:
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)))
XSLT_IS_TEXT_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"); |
XSLT_MARK_RES_TREE_FRAG:
internal macro to set up tree fragments
#define XSLT_MAX_SORT 15 |
XSLT_REFACTORED_PARSING:
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 |
XSLT_PAT_NO_PRIORITY:
Specific value for pattern without priority expressed.
#define XSLT_REFACTORED_KEYCOMP |
XSLT_REFACTORED_KEYCOMP:
Internal define to enable on-demand xsl:key computation. That's the only mode now but the define is kept for compatibility
#define XSLT_REFACTORED_VARS |
XSLT_REFACTORED:
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, | |
nr, | |||
typ | |||
) | (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, | |
nr | |||
) | (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, | |
nr | |||
) | (ctxt)->extras[(nr)].info |
XSLT_RUNTIME_EXTRA_LST: : the transformation context : the index
Macro used to access extra information stored in the context
typedef struct _xsltDecimalFormat xsltDecimalFormat |
xsltDecimalFormat:
Data structure of decimal-format.
typedef xsltDecimalFormat* xsltDecimalFormatPtr |
typedef struct _xsltDocument xsltDocument |
xsltDocument:
Data structure associated to a parsed document.
typedef xsltDocument* xsltDocumentPtr |
typedef struct _xsltElemPreComp xsltElemPreComp |
xsltElemPreComp:
The in-memory structure corresponding to element precomputed data, designed to be extended by extension implementors.
typedef void(* xsltElemPreCompDeallocator)(xsltElemPreCompPtr comp) |
xsltElemPreCompDeallocator: : the xsltElemPreComp to free up
Deallocates an xsltElemPreComp structure.
typedef xsltElemPreComp* xsltElemPreCompPtr |
typedef struct _xsltKeyDef xsltKeyDef |
xsltKeyDef:
Representation of an xsl:key.
typedef xsltKeyDef* xsltKeyDefPtr |
typedef struct _xsltKeyTable xsltKeyTable |
xsltKeyTable:
Holds the computed keys for key definitions of the same QName. Is owned by an xsltDocument.
typedef xsltKeyTable* xsltKeyTablePtr |
typedef struct _xsltRuntimeExtra xsltRuntimeExtra |
xsltRuntimeExtra:
Extra information added to the transformation context.
typedef xsltRuntimeExtra* xsltRuntimeExtraPtr |
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 |
typedef xsltStackElem* xsltStackElemPtr |
typedef struct _xsltStylePreComp xsltStylePreComp |
xsltStylePreComp:
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 xsltStylePreComp* xsltStylePreCompPtr |
typedef struct _xsltStylesheet xsltStylesheet |
typedef xsltStylesheet* xsltStylesheetPtr |
typedef struct _xsltTemplate xsltTemplate |
xsltTemplate:
The in-memory structure corresponding to an XSLT Template.
typedef xsltTemplate* xsltTemplatePtr |
typedef struct _xsltTransformCache xsltTransformCache |
typedef xsltTransformCache* xsltTransformCachePtr |
typedef struct _xsltTransformContext xsltTransformContext |
typedef void(* xsltTransformFunction)(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltElemPreCompPtr comp) |
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.
enum xsltOutputType |
enum xsltStyleType |
enum xsltTransformState |
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 | ) |
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
format-number() uses the JDK 1.1 DecimalFormat class:
http://java.sun.com/products/jdk/1.1/docs/api/java.text.DecimalFormat.html
Structure:
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.
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
INTERNAL ROUTINE ONLY
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
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 | ) |
xsltNewStylesheet:
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 | ) |
xsltUninit:
Uninitializes the processor.