Eneboo - Documentación para desarrolladores
|
#include "libxslt.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlIO.h>
#include "xsltutils.h"
#include "templates.h"
#include "xsltInternals.h"
#include "imports.h"
#include "transform.h"
Clases | |
struct | _xsltDebuggerCallbacks |
'defines' | |
#define | IN_LIBXSLT |
Funciones | |
: the full QName | |
xsltSplitQName: : a dictionary : the return value Split QNames into prefix and local names, both allocated from a dictionary. Returns: the localname or NULL in case of error. | |
const xmlChar * | xsltSplitQName (xmlDictPtr dict, const xmlChar *name, const xmlChar **prefix) |
: the attribute name | |
: the URI of the namespace Similar to xmlGetNsProp() but with a slightly different semantic Search and get the value of an attribute associated to a node This attribute has to be anchored in the namespace specified, or has no namespace and the element is in that namespace. This does the entity substitution. This function looks in DTD attribute declaration for FIXED or default declaration values unless DTD use has been turned off. Returns the attribute value or NULL if not found. It's up to the caller to free the memory. | |
#define | XSLT_GET_VAR_STR(msg, str) |
xmlGenericErrorFunc | xsltGenericError = xsltGenericErrorDefaultFunc |
void * | xsltGenericErrorContext = NULL |
xmlGenericErrorFunc | xsltGenericDebug = xsltGenericDebugDefaultFunc |
void * | xsltGenericDebugContext = NULL |
const xmlChar * | xsltGetCNsProp (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) |
xmlChar * | xsltGetNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) |
int | xsltGetUTF8Char (const unsigned char *utf, int *len) |
void | xsltMessage (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) |
void | xsltSetGenericErrorFunc (void *ctx, xmlGenericErrorFunc handler) |
void | xsltSetGenericDebugFunc (void *ctx, xmlGenericErrorFunc handler) |
void | xsltPrintErrorContext (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node) |
void | xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, void *ctx, xmlGenericErrorFunc handler) |
void | xsltTransformError (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...) |
is | |
#define | MAX_TEMPLATES 10000 |
#define | XSLT_CALLBACK_NUMBER 3 |
typedef struct _xsltDebuggerCallbacks | xsltDebuggerCallbacks |
typedef xsltDebuggerCallbacks * | xsltDebuggerCallbacksPtr |
int | xslDebugStatus |
const xmlChar * | xsltGetQNameURI (xmlNodePtr node, xmlChar **name) |
const xmlChar * | xsltGetQNameURI2 (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar **name) |
void | xsltDocumentSortFunction (xmlNodeSetPtr list) |
xmlXPathObjectPtr * | xsltComputeSortResult (xsltTransformContextPtr ctxt, xmlNodePtr sort) |
void | xsltDefaultSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts) |
void | xsltDoSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts) |
void | xsltSetSortFunc (xsltSortFunc handler) |
void | xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, xsltSortFunc handler) |
int | xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt, int options) |
int | xsltSaveResultTo (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style) |
int | xsltSaveResultToFilename (const char *URL, xmlDocPtr result, xsltStylesheetPtr style, int compression) |
int | xsltSaveResultToFile (FILE *file, xmlDocPtr result, xsltStylesheetPtr style) |
int | xsltSaveResultToFd (int fd, xmlDocPtr result, xsltStylesheetPtr style) |
int | xsltSaveResultToString (xmlChar **doc_txt_ptr, int *doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style) |
void | xsltCalibrateAdjust (long delta) |
long | xsltTimestamp (void) |
void | xsltSaveProfiling (xsltTransformContextPtr ctxt, FILE *output) |
xmlDocPtr | xsltGetProfileInformation (xsltTransformContextPtr ctxt) |
xmlXPathCompExprPtr | xsltXPathCompile (xsltStylesheetPtr style, const xmlChar *str) |
void | xsltSetDebuggerStatus (int value) |
int | xsltGetDebuggerStatus (void) |
int | xsltSetDebuggerCallbacks (int no, void *block) |
void | xslHandleDebugger (xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt) |
int | xslAddCall (xsltTemplatePtr templ, xmlNodePtr source) |
void | xslDropCall (void) |
Returns the number of bytes written or -1 in case of failure.
#define IN_LIBXSLT |
#define MAX_TEMPLATES 10000 |
#define XSLT_CALLBACK_NUMBER 3 |
#define XSLT_GET_VAR_STR | ( | msg, | |
str | |||
) |
typedef struct _xsltDebuggerCallbacks xsltDebuggerCallbacks |
int xslAddCall | ( | xsltTemplatePtr | templ, |
xmlNodePtr | source | ||
) |
xslAddCall: : current template being applied : the source node being processed
Add template "call" to call stack Returns : 1 on sucess 0 otherwise an error may be printed if WITH_XSLT_DEBUG_BREAKPOINTS is defined
void xslDropCall | ( | void | ) |
xslDropCall:
Drop the topmost item off the call stack
void xslHandleDebugger | ( | xmlNodePtr | cur, |
xmlNodePtr | node, | ||
xsltTemplatePtr | templ, | ||
xsltTransformContextPtr | ctxt | ||
) |
xslHandleDebugger: : source node being executed : data node being processed : temlate that applies to node : the xslt transform context
If either cur or node are a breakpoint, or xslDebugStatus in state where debugging must occcur at this time then transfer control to the xslDebugBreak function
void xsltCalibrateAdjust | ( | long | delta | ) |
xsltCalibrateAdjust: : a negative dealy value found
Used for to correct the calibration for xsltTimestamp()
xmlXPathObjectPtr* xsltComputeSortResult | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | sort | ||
) |
xsltComputeSortResult: : a XSLT process context : node list
reorder the current node list accordingly to the set of sorting requirement provided by the array of nodes.
Returns a ordered XPath nodeset or NULL in case of error.
void xsltDefaultSortFunction | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr * | sorts, | ||
int | nbsorts | ||
) |
xsltDefaultSortFunction: : a XSLT process context : array of sort nodes : the number of sorts in the array
reorder the current node list accordingly to the set of sorting requirement provided by the arry of nodes.
void xsltDocumentSortFunction | ( | xmlNodeSetPtr | list | ) |
xsltDocumentSortFunction: : the node set
reorder the current node list accordingly to the document order This function is slow, obsolete and should not be used anymore.
void xsltDoSortFunction | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr * | sorts, | ||
int | nbsorts | ||
) |
xsltDoSortFunction: : a XSLT process context : array of sort nodes : the number of sorts in the array
reorder the current node list accordingly to the set of sorting requirement provided by the arry of nodes. This is a wrapper function, the actual function used is specified using xsltSetCtxtSortFunc() to set the context specific sort function, or xsltSetSortFunc() to set the global sort function. If a sort function is set on the context, this will get called. Otherwise the global sort function is called.
const xmlChar* xsltGetCNsProp | ( | xsltStylesheetPtr | style, |
xmlNodePtr | node, | ||
const xmlChar * | name, | ||
const xmlChar * | nameSpace | ||
) |
int xsltGetDebuggerStatus | ( | void | ) |
xsltGetDebuggerStatus:
Get xslDebugStatus.
Returns the value of xslDebugStatus.
xmlChar* xsltGetNsProp | ( | xmlNodePtr | node, |
const xmlChar * | name, | ||
const xmlChar * | nameSpace | ||
) |
xmlDocPtr xsltGetProfileInformation | ( | xsltTransformContextPtr | ctxt | ) |
xsltGetProfileInformation: : a transformation context
This function should be called after the transformation completed to extract template processing profiling informations if availble. The informations are returned as an XML document tree like <?xml version="1.0"?> <profile> <template rank="1" match="*" name="" mode="" calls="6" time="48" average="8"> <template rank="2" match="item2|item3" name="" mode="" calls="10" time="30" average="3"> <template rank="3" match="item1" name="" mode="" calls="5" time="17" average="3"> </profile> The caller will need to free up the returned tree with xmlFreeDoc()
Returns the xmlDocPtr corresponding to the result or NULL if not available.
const xmlChar* xsltGetQNameURI | ( | xmlNodePtr | node, |
xmlChar ** | name | ||
) |
const xmlChar* xsltGetQNameURI2 | ( | xsltStylesheetPtr | style, |
xmlNodePtr | node, | ||
const xmlChar ** | name | ||
) |
xsltGetUTF8Char: : a sequence of UTF-8 encoded bytes : a pointer to len
Read one UTF8 Char from Function copied from libxml2 xmlGetUTF8Char() ... to discard ultimately and use the original API
Returns the char value or -1 in case of error and update with the number of bytes used
void xsltMessage | ( | xsltTransformContextPtr | ctxt, |
xmlNodePtr | node, | ||
xmlNodePtr | inst | ||
) |
xsltMessage: : an XSLT processing context : The current node : The node containing the message instruction
Process and xsl:message construct
void xsltPrintErrorContext | ( | xsltTransformContextPtr | ctxt, |
xsltStylesheetPtr | style, | ||
xmlNodePtr | node | ||
) |
xsltPrintErrorContext: : the transformation context : the stylesheet : the current node being processed
Display the context of an error.
void xsltSaveProfiling | ( | xsltTransformContextPtr | ctxt, |
FILE * | output | ||
) |
xsltSaveProfiling: : an XSLT context : a FILE * for saving the informations
Save the profiling informations on
int xsltSaveResultTo | ( | xmlOutputBufferPtr | buf, |
xmlDocPtr | result, | ||
xsltStylesheetPtr | style | ||
) |
xsltSaveResultTo: : an output buffer
Save the result
Returns the number of byte written or -1 in case of failure.
int xsltSaveResultToFd | ( | int | fd, |
xmlDocPtr | result, | ||
xsltStylesheetPtr | style | ||
) |
xsltSaveResultToFd: : a file descriptor
Save the result
Returns the number of bytes written or -1 in case of failure.
int xsltSaveResultToFile | ( | FILE * | file, |
xmlDocPtr | result, | ||
xsltStylesheetPtr | style | ||
) |
int xsltSaveResultToFilename | ( | const char * | URL, |
xmlDocPtr | result, | ||
xsltStylesheetPtr | style, | ||
int | compression | ||
) |
xsltSaveResultToFilename: : a filename or URL
Save the result
Returns the number of byte written or -1 in case of failure.
int xsltSaveResultToString | ( | xmlChar ** | doc_txt_ptr, |
int * | doc_txt_len, | ||
xmlDocPtr | result, | ||
xsltStylesheetPtr | style | ||
) |
xsltSaveResultToString: : Memory pointer for allocated XML text : Length of the generated XML text
Save the result
Returns 0 in case of success and -1 in case of error
int xsltSetCtxtParseOptions | ( | xsltTransformContextPtr | ctxt, |
int | options | ||
) |
xsltSetCtxtParseOptions: : a XSLT process context : a combination of libxml2 xmlParserOption
Change the default parser option passed by the XSLT engine to the parser when using document() loading.
Returns the previous options or -1 in case of error
void xsltSetCtxtSortFunc | ( | xsltTransformContextPtr | ctxt, |
xsltSortFunc | handler | ||
) |
xsltSetCtxtSortFunc: : a XSLT process context : the new handler function
Function to set the handler for XSLT sorting for the specified context. If the handler is NULL, then the global sort function will be called
xsltSetDebuggerCallbacks: : number of callbacks : the block of callbacks
This function allow to plug a debugger into the XSLT library points to a block of memory containing the address of callback routines.
Returns 0 in case of success and -1 in case of error
void xsltSetDebuggerStatus | ( | int | value | ) |
xsltSetDebuggerStatus: : the value to be set
This function sets the value of xslDebugStatus.
void xsltSetGenericDebugFunc | ( | void * | ctx, |
xmlGenericErrorFunc | handler | ||
) |
xsltSetGenericDebugFunc: : the new error handling context : the new handler function
Function to reset the handler and the error context for out of context error messages. This simply means that will be called for subsequent error messages while not parsing or validating. And will be passed as first argument to One can simply force messages to be emitted to another FILE * than stderr by setting to this file handle and to NULL.
void xsltSetGenericErrorFunc | ( | void * | ctx, |
xmlGenericErrorFunc | handler | ||
) |
xsltSetGenericErrorFunc: : the new error handling context : the new handler function
Function to reset the handler and the error context for out of context error messages. This simply means that will be called for subsequent error messages while not parsing nor validating. And will be passed as first argument to One can simply force messages to be emitted to another FILE * than stderr by setting to this file handle and to NULL.
void xsltSetSortFunc | ( | xsltSortFunc | handler | ) |
xsltSetSortFunc: : the new handler function
Function to reset the global handler for XSLT sorting. If the handler is NULL, the default sort function will be used.
void xsltSetTransformErrorFunc | ( | xsltTransformContextPtr | ctxt, |
void * | ctx, | ||
xmlGenericErrorFunc | handler | ||
) |
xsltSetTransformErrorFunc: : the XSLT transformation context : the new error handling context : the new handler function
Function to reset the handler and the error context for out of context error messages specific to a given XSLT transromation.
This simply means that will be called for subsequent error messages while running the transformation.
const xmlChar* xsltSplitQName | ( | xmlDictPtr | dict, |
const xmlChar * | name, | ||
const xmlChar ** | prefix | ||
) |
long xsltTimestamp | ( | void | ) |
xsltTimestamp:
Used for gathering profiling data
Returns the number of tenth of milliseconds since the beginning of the profiling
void xsltTransformError | ( | xsltTransformContextPtr | ctxt, |
xsltStylesheetPtr | style, | ||
xmlNodePtr | node, | ||
const char * | msg, | ||
... | |||
) |
xsltTransformError: : an XSLT transformation context : the XSLT stylesheet used : the current node in the stylesheet : the message to display/transmit @...: extra parameters for the message display
Display and format an error messages, gives file, line, position and extra parameters, will use the specific transformation context if available
xmlXPathCompExprPtr xsltXPathCompile | ( | xsltStylesheetPtr | style, |
const xmlChar * | str | ||
) |
xsltXPathCompile: : the stylesheet : the XPath expression
Compile an XPath expression
Returns the xmlXPathCompExprPtr resulting from the compilation or NULL. the caller has to free the object.
xmlGenericErrorFunc xsltGenericDebug = xsltGenericDebugDefaultFunc |
void* xsltGenericDebugContext = NULL |
xmlGenericErrorFunc xsltGenericError = xsltGenericErrorDefaultFunc |
void* xsltGenericErrorContext = NULL |