Eneboo - Documentación para desarrolladores
'defines' | 'typedefs' | Enumeraciones | Funciones | Variables
Referencia del Archivo src/libxslt/libxslt/xsltutils.h
#include <libxslt/xsltconfig.h>
#include <libxml/xpath.h>
#include <libxml/dict.h>
#include <libxml/xmlerror.h>
#include "xsltexports.h"
#include "xsltInternals.h"

Ir al código fuente de este archivo.

'defines'

#define XSLT_TODO
#define XSLT_STRANGE
#define IS_XSLT_ELEM(n)
#define IS_XSLT_NAME(n, val)   (xmlStrEqual((n)->name, (const xmlChar *) (val)))
#define IS_XSLT_REAL_NODE(n)
#define XSLT_TRACE(ctxt, code, call)
#define XSLT_TIMESTAMP_TICS_PER_SEC   100000l

'typedefs'

typedef void(* xsltHandleDebuggerCallback )(xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt)
typedef int(* xsltAddCallCallback )(xsltTemplatePtr templ, xmlNodePtr source)
typedef void(* xsltDropCallCallback )(void)

Enumeraciones

enum  xsltDebugTraceCodes {
  XSLT_TRACE_ALL = -1, XSLT_TRACE_NONE = 0, XSLT_TRACE_COPY_TEXT = 1<<0, XSLT_TRACE_PROCESS_NODE = 1<<1,
  XSLT_TRACE_APPLY_TEMPLATE = 1<<2, XSLT_TRACE_COPY = 1<<3, XSLT_TRACE_COMMENT = 1<<4, XSLT_TRACE_PI = 1<<5,
  XSLT_TRACE_COPY_OF = 1<<6, XSLT_TRACE_VALUE_OF = 1<<7, XSLT_TRACE_CALL_TEMPLATE = 1<<8, XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
  XSLT_TRACE_CHOOSE = 1<<10, XSLT_TRACE_IF = 1<<11, XSLT_TRACE_FOR_EACH = 1<<12, XSLT_TRACE_STRIP_SPACES = 1<<13,
  XSLT_TRACE_TEMPLATES = 1<<14, XSLT_TRACE_KEYS = 1<<15, XSLT_TRACE_VARIABLES = 1<<16
}
enum  xsltDebugStatusCodes {
  XSLT_DEBUG_NONE = 0, XSLT_DEBUG_INIT, XSLT_DEBUG_STEP, XSLT_DEBUG_STEPOUT,
  XSLT_DEBUG_NEXT, XSLT_DEBUG_STOP, XSLT_DEBUG_CONT, XSLT_DEBUG_RUN,
  XSLT_DEBUG_RUN_RESTART, XSLT_DEBUG_QUIT
}

Funciones

XSLTPUBFUN xmlChar *XSLTCALL xsltGetNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetCNsProp (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
XSLTPUBFUN int XSLTCALL xsltGetUTF8Char (const unsigned char *utf, int *len)
XSLTPUBFUN void XSLTCALL xsltDebugSetDefaultTrace (xsltDebugTraceCodes val)
XSLTPUBFUN xsltDebugTraceCodes
XSLTCALL 
xsltDebugGetDefaultTrace (void)
XSLTPUBFUN void XSLTCALL xsltPrintErrorContext (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node)
XSLTPUBFUN void XSLTCALL xsltMessage (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst)
XSLTPUBFUN void XSLTCALL xsltSetGenericErrorFunc (void *ctx, xmlGenericErrorFunc handler)
XSLTPUBFUN void XSLTCALL xsltSetGenericDebugFunc (void *ctx, xmlGenericErrorFunc handler)
XSLTPUBFUN void XSLTCALL xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, void *ctx, xmlGenericErrorFunc handler)
XSLTPUBFUN void XSLTCALL xsltTransformError (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
XSLTPUBFUN int XSLTCALL xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt, int options)
XSLTPUBFUN void XSLTCALL xsltDocumentSortFunction (xmlNodeSetPtr list)
XSLTPUBFUN void XSLTCALL xsltSetSortFunc (xsltSortFunc handler)
XSLTPUBFUN void XSLTCALL xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, xsltSortFunc handler)
XSLTPUBFUN void XSLTCALL xsltDefaultSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
XSLTPUBFUN void XSLTCALL xsltDoSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
XSLTPUBFUN xmlXPathObjectPtr
*XSLTCALL 
xsltComputeSortResult (xsltTransformContextPtr ctxt, xmlNodePtr sort)
XSLTPUBFUN const xmlChar *XSLTCALL xsltSplitQName (xmlDictPtr dict, const xmlChar *name, const xmlChar **prefix)
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI (xmlNodePtr node, xmlChar **name)
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI2 (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar **name)
XSLTPUBFUN int XSLTCALL xsltSaveResultTo (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style)
XSLTPUBFUN int XSLTCALL xsltSaveResultToFilename (const char *URI, xmlDocPtr result, xsltStylesheetPtr style, int compression)
XSLTPUBFUN int XSLTCALL xsltSaveResultToFile (FILE *file, xmlDocPtr result, xsltStylesheetPtr style)
XSLTPUBFUN int XSLTCALL xsltSaveResultToFd (int fd, xmlDocPtr result, xsltStylesheetPtr style)
XSLTPUBFUN int XSLTCALL xsltSaveResultToString (xmlChar **doc_txt_ptr, int *doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style)
XSLTPUBFUN xmlXPathCompExprPtr
XSLTCALL 
xsltXPathCompile (xsltStylesheetPtr style, const xmlChar *str)
XSLTPUBFUN void XSLTCALL xsltSaveProfiling (xsltTransformContextPtr ctxt, FILE *output)
XSLTPUBFUN xmlDocPtr XSLTCALL xsltGetProfileInformation (xsltTransformContextPtr ctxt)
XSLTPUBFUN long XSLTCALL xsltTimestamp (void)
XSLTPUBFUN void XSLTCALL xsltCalibrateAdjust (long delta)
XSLTPUBFUN void XSLTCALL xsltSetDebuggerStatus (int value)
XSLTPUBFUN int XSLTCALL xsltGetDebuggerStatus (void)
XSLTPUBFUN int XSLTCALL xsltSetDebuggerCallbacks (int no, void *block)
XSLTPUBFUN int XSLTCALL xslAddCall (xsltTemplatePtr templ, xmlNodePtr source)
XSLTPUBFUN void XSLTCALL xslDropCall (void)

Variables

XSLTPUBVAR xmlGenericErrorFunc xsltGenericError
XSLTPUBVAR void * xsltGenericErrorContext
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug
XSLTPUBVAR void * xsltGenericDebugContext
XSLTPUBVAR int xslDebugStatus

Documentación de los 'defines'

#define IS_XSLT_ELEM (   n)
Valor:
(((n) != NULL) && ((n)->ns != NULL) &&                          \
     (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))

IS_XSLT_ELEM:

Checks that the element pertains to XSLT namespace.

#define IS_XSLT_NAME (   n,
  val 
)    (xmlStrEqual((n)->name, (const xmlChar *) (val)))

IS_XSLT_NAME:

Checks the value of an element in XSLT namespace.

#define IS_XSLT_REAL_NODE (   n)
Valor:
(((n) != NULL) &&                                                       \
     (((n)->type == XML_ELEMENT_NODE) ||                                \
      ((n)->type == XML_TEXT_NODE) ||                                   \
      ((n)->type == XML_CDATA_SECTION_NODE) ||                          \
      ((n)->type == XML_ATTRIBUTE_NODE) ||                              \
      ((n)->type == XML_DOCUMENT_NODE) ||                               \
      ((n)->type == XML_HTML_DOCUMENT_NODE) ||                          \
      ((n)->type == XML_COMMENT_NODE) ||                                \
      ((n)->type == XML_PI_NODE)))

IS_XSLT_REAL_NODE:

Check that a node is a 'real' one: document, element, text or attribute.

#define XSLT_STRANGE
Valor:
xsltGenericError(xsltGenericErrorContext,                               \
            "Internal error at %s:%d\n",                                \
            __FILE__, __LINE__);

XSLT_STRANGE:

Macro to flag that a problem was detected internally.

#define XSLT_TIMESTAMP_TICS_PER_SEC   100000l

XSLT_TIMESTAMP_TICS_PER_SEC:

Sampling precision for profiling

#define XSLT_TODO
Valor:
xsltGenericError(xsltGenericErrorContext,                               \
            "Unimplemented block at %s:%d\n",                           \
            __FILE__, __LINE__);

XSLT_TODO:

Macro to flag unimplemented blocks.

#define XSLT_TRACE (   ctxt,
  code,
  call 
)
Valor:
if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
            call

XSLT_TRACE:

Control the type of xsl debugtrace messages emitted.


Documentación de los 'typedefs'

typedef void(* xsltDropCallCallback)(void)

Documentación de las enumeraciones

Valores de enumeraciones:
XSLT_DEBUG_NONE 
XSLT_DEBUG_INIT 
XSLT_DEBUG_STEP 
XSLT_DEBUG_STEPOUT 
XSLT_DEBUG_NEXT 
XSLT_DEBUG_STOP 
XSLT_DEBUG_CONT 
XSLT_DEBUG_RUN 
XSLT_DEBUG_RUN_RESTART 
XSLT_DEBUG_QUIT 
Valores de enumeraciones:
XSLT_TRACE_ALL 
XSLT_TRACE_NONE 
XSLT_TRACE_COPY_TEXT 
XSLT_TRACE_PROCESS_NODE 
XSLT_TRACE_APPLY_TEMPLATE 
XSLT_TRACE_COPY 
XSLT_TRACE_COMMENT 
XSLT_TRACE_PI 
XSLT_TRACE_COPY_OF 
XSLT_TRACE_VALUE_OF 
XSLT_TRACE_CALL_TEMPLATE 
XSLT_TRACE_APPLY_TEMPLATES 
XSLT_TRACE_CHOOSE 
XSLT_TRACE_IF 
XSLT_TRACE_FOR_EACH 
XSLT_TRACE_STRIP_SPACES 
XSLT_TRACE_TEMPLATES 
XSLT_TRACE_KEYS 
XSLT_TRACE_VARIABLES 

Documentación de las funciones

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

XSLTPUBFUN void XSLTCALL xslDropCall ( void  )

xslDropCall:

Drop the topmost item off the call stack

XSLTPUBFUN void XSLTCALL xsltCalibrateAdjust ( long  delta)

xsltCalibrateAdjust: : a negative dealy value found

Used for to correct the calibration for xsltTimestamp()

XSLTPUBFUN xmlXPathObjectPtr* XSLTCALL 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.

XSLTPUBFUN xsltDebugTraceCodes XSLTCALL xsltDebugGetDefaultTrace ( void  )

xsltDebugGetDefaultTrace:

Get the current default debug tracing level mask

Returns the current default debug tracing level mask

XSLTPUBFUN void XSLTCALL xsltDebugSetDefaultTrace ( xsltDebugTraceCodes  val)

xsltDebugSetDefaultTrace: : tracing level mask

Set the default debug tracing level mask

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

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

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

XSLTPUBFUN const xmlChar* XSLTCALL xsltGetCNsProp ( xsltStylesheetPtr  style,
xmlNodePtr  node,
const xmlChar name,
const xmlChar nameSpace 
)
XSLTPUBFUN int XSLTCALL xsltGetDebuggerStatus ( void  )

xsltGetDebuggerStatus:

Get xslDebugStatus.

Returns the value of xslDebugStatus.

XSLTPUBFUN xmlChar* XSLTCALL xsltGetNsProp ( xmlNodePtr  node,
const xmlChar name,
const xmlChar nameSpace 
)
XSLTPUBFUN xmlDocPtr XSLTCALL 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.

XSLTPUBFUN const xmlChar* XSLTCALL xsltGetQNameURI ( xmlNodePtr  node,
xmlChar **  name 
)
XSLTPUBFUN const xmlChar* XSLTCALL xsltGetQNameURI2 ( xsltStylesheetPtr  style,
xmlNodePtr  node,
const xmlChar **  name 
)
XSLTPUBFUN int XSLTCALL xsltGetUTF8Char ( const unsigned char *  utf,
int len 
)

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

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

XSLTPUBFUN void XSLTCALL xsltPrintErrorContext ( xsltTransformContextPtr  ctxt,
xsltStylesheetPtr  style,
xmlNodePtr  node 
)

xsltPrintErrorContext: : the transformation context : the stylesheet : the current node being processed

Display the context of an error.

XSLTPUBFUN void XSLTCALL xsltSaveProfiling ( xsltTransformContextPtr  ctxt,
FILE *  output 
)

xsltSaveProfiling: : an XSLT context : a FILE * for saving the informations

Save the profiling informations on

XSLTPUBFUN int XSLTCALL xsltSaveResultTo ( xmlOutputBufferPtr  buf,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)

xsltSaveResultTo: : an output buffer

Devuelve:
: the result xmlDocPtr : the stylesheet

Save the result

Devuelve:
obtained by applying the stylesheet to an I/O output channel

Returns the number of byte written or -1 in case of failure.

XSLTPUBFUN int XSLTCALL xsltSaveResultToFd ( int  fd,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)

xsltSaveResultToFd: : a file descriptor

Devuelve:
: the result xmlDocPtr : the stylesheet

Save the result

Devuelve:
obtained by applying the stylesheet to an open file descriptor This does not close the descriptor.

Returns the number of bytes written or -1 in case of failure.

XSLTPUBFUN int XSLTCALL xsltSaveResultToFile ( FILE *  file,
xmlDocPtr  result,
xsltStylesheetPtr  style 
)
XSLTPUBFUN int XSLTCALL xsltSaveResultToFilename ( const char *  URL,
xmlDocPtr  result,
xsltStylesheetPtr  style,
int  compression 
)

xsltSaveResultToFilename: : a filename or URL

Devuelve:
: the result xmlDocPtr : the stylesheet : the compression factor (0 - 9 included)

Save the result

Devuelve:
obtained by applying the stylesheet to a file or

Returns the number of byte written or -1 in case of failure.

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

Devuelve:
: the result xmlDocPtr : the stylesheet

Save the result

Devuelve:
obtained by applying the stylesheet to a new allocated string.

Returns 0 in case of success and -1 in case of error

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

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

XSLTPUBFUN int XSLTCALL xsltSetDebuggerCallbacks ( int  no,
void *  block 
)

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

XSLTPUBFUN void XSLTCALL xsltSetDebuggerStatus ( int  value)

xsltSetDebuggerStatus: : the value to be set

This function sets the value of xslDebugStatus.

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

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

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

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

XSLTPUBFUN const xmlChar* XSLTCALL xsltSplitQName ( xmlDictPtr  dict,
const xmlChar name,
const xmlChar **  prefix 
)
XSLTPUBFUN long XSLTCALL xsltTimestamp ( void  )

xsltTimestamp:

Used for gathering profiling data

Returns the number of tenth of milliseconds since the beginning of the profiling

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

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


Documentación de las variables

XSLTPUBVAR int xslDebugStatus
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug
XSLTPUBVAR void* xsltGenericDebugContext
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError
XSLTPUBVAR void* xsltGenericErrorContext
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'