Eneboo - Documentación para desarrolladores
Clases | 'defines' | 'typedefs' | Funciones | Variables
Referencia del Archivo src/libxslt/libxslt/transform.c
#include "libxslt.h"
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/valid.h>
#include <libxml/hash.h>
#include <libxml/encoding.h>
#include <libxml/xmlerror.h>
#include <libxml/xpath.h>
#include <libxml/parserInternals.h>
#include <libxml/xpathInternals.h>
#include <libxml/HTMLtree.h>
#include <libxml/debugXML.h>
#include <libxml/uri.h>
#include "xslt.h"
#include "xsltInternals.h"
#include "xsltutils.h"
#include "pattern.h"
#include "transform.h"
#include "variables.h"
#include "numbersInternals.h"
#include "namespaces.h"
#include "attributes.h"
#include "templates.h"
#include "imports.h"
#include "keys.h"
#include "documents.h"
#include "extensions.h"
#include "extra.h"
#include "preproc.h"
#include "security.h"

Clases

struct  xsltHTMLVersion

'defines'

#define IN_LIBXSLT
#define XSLT_GENERATE_HTML_DOCTYPE
#define FALSE   (0 == 1)
#define TRUE   (!FALSE)
#define IS_BLANK_NODE(n)   (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))

'typedefs'

typedef struct xsltHTMLVersion xsltHTMLVersion

Funciones

void xsltLocalVariablePop (xsltTransformContextPtr ctxt, int limitNr, int level)
void xsltSetXIncludeDefault (int xinclude)
int xsltGetXIncludeDefault (void)
void xsltDebugSetDefaultTrace (xsltDebugTraceCodes val)
xsltDebugTraceCodes xsltDebugGetDefaultTrace ()
xsltTransformContextPtr xsltNewTransformContext (xsltStylesheetPtr style, xmlDocPtr doc)
void xsltFreeTransformContext (xsltTransformContextPtr ctxt)
xmlNodePtr xsltCopyTree (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr insert, int literal)
xmlNodePtr xsltCopyTextString (xsltTransformContextPtr ctxt, xmlNodePtr target, const xmlChar *string, int noescape)
void xsltProcessOneNode (xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xsltStackElemPtr withParams)
int xsltLocalVariablePush (xsltTransformContextPtr ctxt, xsltStackElemPtr variable, int level)
void xsltApplyOneTemplate (xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr list, xsltTemplatePtr templ ATTRIBUTE_UNUSED, xsltStackElemPtr params)
void xsltDocumentElem (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltSort (xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr inst, xsltStylePreCompPtr comp)
void xsltCopy (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltText (xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
void xsltElement (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltComment (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
void xsltProcessingInstruction (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltCopyOf (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltValueOf (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltNumber (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltApplyImports (xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
void xsltCallTemplate (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltApplyTemplates (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltChoose (xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst, xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
void xsltIf (xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltForEach (xsltTransformContextPtr ctxt, xmlNodePtr contextNode, xmlNodePtr inst, xsltStylePreCompPtr castedComp)
void xsltApplyStripSpaces (xsltTransformContextPtr ctxt, xmlNodePtr node)
xmlDocPtr xsltApplyStylesheet (xsltStylesheetPtr style, xmlDocPtr doc, const char **params)
xmlDocPtr xsltProfileStylesheet (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, FILE *output)
xmlDocPtr xsltApplyStylesheetUser (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, const char *output, FILE *profile, xsltTransformContextPtr userCtxt)
int xsltRunStylesheetUser (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, const char *output, xmlSAXHandlerPtr SAX, xmlOutputBufferPtr IObuf, FILE *profile, xsltTransformContextPtr userCtxt)
int xsltRunStylesheet (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, const char *output, xmlSAXHandlerPtr SAX, xmlOutputBufferPtr IObuf)
void xsltRegisterAllElement (xsltTransformContextPtr ctxt)

Variables

int xsltMaxDepth = 3000
unsigned long xsltDefaultTrace = (unsigned long) XSLT_TRACE_ALL

Documentación de los 'defines'

#define FALSE   (0 == 1)
#define IN_LIBXSLT
#define IS_BLANK_NODE (   n)    (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
#define TRUE   (!FALSE)
#define XSLT_GENERATE_HTML_DOCTYPE

Documentación de los 'typedefs'


Documentación de las funciones

void xsltApplyImports ( xsltTransformContextPtr  ctxt,
xmlNodePtr  contextNode,
xmlNodePtr  inst,
xsltStylePreCompPtr comp  ATTRIBUTE_UNUSED 
)

xsltApplyImports: : an XSLT transformation context : the current node in the source tree. : the element node of the XSLT 'apply-imports' instruction : the compiled instruction

Process the XSLT apply-imports element.

void xsltApplyOneTemplate ( xsltTransformContextPtr  ctxt,
xmlNodePtr  contextNode,
xmlNodePtr  list,
xsltTemplatePtr templ  ATTRIBUTE_UNUSED,
xsltStackElemPtr  params 
)

xsltApplyOneTemplate: : a XSLT process context : the node in the source tree. : the nodes of a sequence constructor : not used : a set of parameters (xsl:param) or NULL

Processes a sequence constructor on the current node in the source tree.

are the already computed variable stack items; this function pushes them on the variable stack, and pops them before exiting; it's left to the caller to free or reuse afterwards. The initial states of the variable stack will always be restored before this function exits. NOTE that this does *not* initiate a new distinct variable scope; i.e. variables already on the stack are visible to the process. The caller's side needs to start a new variable scope if needed (e.g. in exsl:function).

is obsolete and not used anymore (e.g. <exslt:function> does not provide a ); a non-NULL might raise an error in the future.

BIG NOTE: This function is not intended to process the content of an xsl:template; it does not expect xsl:param instructions in and will report errors if found.

Called by:

  • xsltEvalVariable() (variables.c)
  • exsltFuncFunctionFunction() (libexsl/functions.c)
void xsltApplyStripSpaces ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node 
)

xsltApplyStripSpaces: : a XSLT process context : the root of the XML tree

Strip the unwanted ignorable spaces from the input tree

xmlDocPtr xsltApplyStylesheet ( xsltStylesheetPtr  style,
xmlDocPtr  doc,
const char **  params 
)

xsltApplyStylesheet: : a parsed XSLT stylesheet : a parsed XML document : a NULL terminated arry of parameters names/values tuples

Apply the stylesheet to the document NOTE: This may lead to a non-wellformed output XML wise !

Returns the result document or NULL in case of error

xmlDocPtr xsltApplyStylesheetUser ( xsltStylesheetPtr  style,
xmlDocPtr  doc,
const char **  params,
const char *  output,
FILE *  profile,
xsltTransformContextPtr  userCtxt 
)

xsltApplyStylesheetUser: : a parsed XSLT stylesheet : a parsed XML document : a NULL terminated array of parameters names/values tuples : the targetted output : profile FILE * output or NULL : user provided transform context

Apply the stylesheet to the document and allow the user to provide its own transformation context.

Returns the result document or NULL in case of error

void xsltApplyTemplates ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltApplyTemplates: : a XSLT transformation context : the 'current node' in the source tree : the element node of an XSLT 'apply-templates' instruction : the compiled instruction

Processes the XSLT 'apply-templates' instruction on the current node.

void xsltCallTemplate ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltCallTemplate: : a XSLT transformation context : the "current node" in the source tree : the XSLT 'call-template' instruction : the compiled information of the instruction

Processes the XSLT call-template instruction on the source node.

void xsltChoose ( xsltTransformContextPtr  ctxt,
xmlNodePtr  contextNode,
xmlNodePtr  inst,
xsltStylePreCompPtr comp  ATTRIBUTE_UNUSED 
)

xsltChoose: : a XSLT process context : the current node in the source tree : the xsl:choose instruction : compiled information of the instruction

Processes the xsl:choose instruction on the source node.

void xsltComment ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr comp  ATTRIBUTE_UNUSED 
)

xsltComment: : a XSLT process context : the node in the source tree. : the xslt comment node : precomputed information

Process the xslt comment node on the source node

void xsltCopy ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltCopy: : an XSLT process context : the node in the source tree : the element node of the XSLT-copy instruction : computed information of the XSLT-copy instruction

Execute the XSLT-copy instruction on the source node.

void xsltCopyOf ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltCopyOf: : an XSLT transformation context : the current node in the source tree : the element node of the XSLT copy-of instruction : precomputed information of the XSLT copy-of instruction

Process the XSLT copy-of instruction.

xmlNodePtr xsltCopyTextString ( xsltTransformContextPtr  ctxt,
xmlNodePtr  target,
const xmlChar string,
int  noescape 
)

xsltCopyTextString: : a XSLT process context : the element where the text will be attached : the text string : should disable-escaping be activated for this text node.

Adds to a newly created or an existent text node child of .

Returns: the text node, where the text content of is copied to. NULL in case of API or internal errors.

xmlNodePtr xsltCopyTree ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  insert,
int  literal 
)

xsltCopyTree: : the XSLT transformation context : the element node in the source tree : the parent in the result tree : indicates if is a Literal Result Element

Make a copy of the full tree under the element node and insert it as last child of For literal result element, some of the namespaces may not be copied over according to section 7.1. TODO: Why is this a public function?

Returns a pointer to the new tree, or NULL in case of error

xsltDebugTraceCodes xsltDebugGetDefaultTrace ( void  )

xsltDebugGetDefaultTrace:

Get the current default debug tracing level mask

Returns the current default debug tracing level mask

void xsltDebugSetDefaultTrace ( xsltDebugTraceCodes  val)

xsltDebugSetDefaultTrace: : tracing level mask

Set the default debug tracing level mask

void xsltDocumentElem ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltDocumentElem: : an XSLT processing context : The current node : the instruction in the stylesheet : precomputed information

Process an EXSLT/XSLT-1.1 document element

void xsltElement ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltElement: : a XSLT process context : the node in the source tree. : the xslt element node : precomputed information

Process the xslt element node on the source node

void xsltForEach ( xsltTransformContextPtr  ctxt,
xmlNodePtr  contextNode,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltForEach: : an XSLT transformation context : the "current node" in the source tree : the element node of the xsl:for-each instruction : the compiled information of the instruction

Process the xslt for-each node on the source node

void xsltFreeTransformContext ( xsltTransformContextPtr  ctxt)

xsltFreeTransformContext: : an XSLT parser context

Free up the memory allocated by

int xsltGetXIncludeDefault ( void  )

xsltGetXIncludeDefault:

Provides the default state for XInclude processing

Returns 0 if there is no processing 1 otherwise

void xsltIf ( xsltTransformContextPtr  ctxt,
xmlNodePtr  contextNode,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltIf: : a XSLT process context : the current node in the source tree : the xsl:if instruction : compiled information of the instruction

Processes the xsl:if instruction on the source node.

void xsltLocalVariablePop ( xsltTransformContextPtr  ctxt,
int  limitNr,
int  level 
)

xsltLocalVariablePop: : the transformation context : number of variables which should remain : the depth in the xsl:template's tree

Pops all variable values at the given from the stack.

Returns the stored variable value **NOTE:** This is an internal routine and should not be called by users!

int xsltLocalVariablePush ( xsltTransformContextPtr  ctxt,
xsltStackElemPtr  variable,
int  level 
)

xsltLocalVariablePush: : the transformation context : variable to be pushed to the variable stack : new value for variable's level

Places the variable onto the local variable stack

Returns: 0 for success, -1 for any error **NOTE:** This is an internal routine and should not be called by users!

xsltTransformContextPtr xsltNewTransformContext ( xsltStylesheetPtr  style,
xmlDocPtr  doc 
)

xsltNewTransformContext: : a parsed XSLT stylesheet : the input document

Create a new XSLT TransformContext

Returns the newly allocated xsltTransformContextPtr or NULL in case of error

void xsltNumber ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltNumber: : a XSLT process context : the node in the source tree. : the xslt number node : precomputed information

Process the xslt number node on the source node

void xsltProcessingInstruction ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltProcessingInstruction: : a XSLT process context : the node in the source tree. : the xslt processing-instruction node : precomputed information

Process the xslt processing-instruction node on the source node

void xsltProcessOneNode ( xsltTransformContextPtr  ctxt,
xmlNodePtr  contextNode,
xsltStackElemPtr  withParams 
)

xsltProcessOneNode: : a XSLT process context : the "current node" in the source tree : extra parameters (e.g. xsl:with-param) passed to the template if any

Process the source node.

xmlDocPtr xsltProfileStylesheet ( xsltStylesheetPtr  style,
xmlDocPtr  doc,
const char **  params,
FILE *  output 
)

xsltProfileStylesheet: : a parsed XSLT stylesheet : a parsed XML document : a NULL terminated arry of parameters names/values tuples : a FILE * for the profiling output

Apply the stylesheet to the document and dump the profiling to the given output.

Returns the result document or NULL in case of error

void xsltRegisterAllElement ( xsltTransformContextPtr  ctxt)

xsltRegisterAllElement: : the XPath context

Registers all default XSLT elements in this context

int xsltRunStylesheet ( xsltStylesheetPtr  style,
xmlDocPtr  doc,
const char **  params,
const char *  output,
xmlSAXHandlerPtr  SAX,
xmlOutputBufferPtr  IObuf 
)

xsltRunStylesheet: : a parsed XSLT stylesheet : a parsed XML document : a NULL terminated array of parameters names/values tuples : the URL/filename ot the generated resource if available : a SAX handler for progressive callback output (not implemented yet) : an output buffer for progressive output (not implemented yet)

Apply the stylesheet to the document and generate the output according to and . It's an error to specify both and .

NOTE: This may lead to a non-wellformed output XML wise ! NOTE: This may also result in multiple files being generated NOTE: using IObuf, the result encoding used will be the one used for creating the output buffer, use the following macro to read it from the stylesheet XSLT_GET_IMPORT_PTR(encoding, style, encoding) NOTE: using SAX, any encoding specified in the stylesheet will be lost since the interface uses only UTF8

Returns the number of bytes written to the main resource or -1 in case of error.

int xsltRunStylesheetUser ( xsltStylesheetPtr  style,
xmlDocPtr  doc,
const char **  params,
const char *  output,
xmlSAXHandlerPtr  SAX,
xmlOutputBufferPtr  IObuf,
FILE *  profile,
xsltTransformContextPtr  userCtxt 
)

xsltRunStylesheetUser: : a parsed XSLT stylesheet : a parsed XML document : a NULL terminated array of parameters names/values tuples : the URL/filename ot the generated resource if available : a SAX handler for progressive callback output (not implemented yet) : an output buffer for progressive output (not implemented yet) : profile FILE * output or NULL : user provided transform context

Apply the stylesheet to the document and generate the output according to and . It's an error to specify both and .

NOTE: This may lead to a non-wellformed output XML wise ! NOTE: This may also result in multiple files being generated NOTE: using IObuf, the result encoding used will be the one used for creating the output buffer, use the following macro to read it from the stylesheet XSLT_GET_IMPORT_PTR(encoding, style, encoding) NOTE: using SAX, any encoding specified in the stylesheet will be lost since the interface uses only UTF8

Returns the number of by written to the main resource or -1 in case of error.

void xsltSetXIncludeDefault ( int  xinclude)

xsltSetXIncludeDefault: : whether to do XInclude processing

Set whether XInclude should be processed on document being loaded by default

void xsltSort ( xsltTransformContextPtr  ctxt,
xmlNodePtr node  ATTRIBUTE_UNUSED,
xmlNodePtr  inst,
xsltStylePreCompPtr  comp 
)

xsltSort: : a XSLT process context : the node in the source tree. : the xslt sort node : precomputed information

function attached to xsl:sort nodes, but this should not be called directly

void xsltText ( xsltTransformContextPtr  ctxt,
xmlNodePtr node  ATTRIBUTE_UNUSED,
xmlNodePtr  inst,
xsltStylePreCompPtr comp  ATTRIBUTE_UNUSED 
)

xsltText: : a XSLT process context : the node in the source tree. : the xslt text node : precomputed information

Process the xslt text node on the source node

void xsltValueOf ( xsltTransformContextPtr  ctxt,
xmlNodePtr  node,
xmlNodePtr  inst,
xsltStylePreCompPtr  castedComp 
)

xsltValueOf: : a XSLT process context : the node in the source tree. : the xslt value-of node : precomputed information

Process the xslt value-of node on the source node


Documentación de las variables

unsigned long xsltDefaultTrace = (unsigned long) XSLT_TRACE_ALL
int xsltMaxDepth = 3000
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'