transform

transform - the XSLT engine transformation part.

This module implements the bulk of the actual

Author(s): Daniel Veillard

Synopsis

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

Description

Details

xslHandleDebugger ()

void	xslHandleDebugger		(xmlNodePtr cur, 
xmlNodePtr node,
xsltTemplatePtr templ,
xsltTransformContextPtr ctxt)

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

cur:source node being executed
node:data node being processed
templ:temlate that applies to node
ctxt:the xslt transform context

xsltApplyImports ()

void	xsltApplyImports		(xsltTransformContextPtr ctxt, 
xmlNodePtr contextNode,
xmlNodePtr inst,
xsltElemPreCompPtr comp)

Process the XSLT apply-imports element.

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

xsltApplyOneTemplate ()

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

Processes a sequence constructor on the current node in the source tree. @params 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 @params 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). @templ is obsolete and not used anymore (e.g. <exslt:function> does not provide a @templ); a non-NULL @templ 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 @list and will report errors if found. Called by: - xsltEvalVariable() (variables.c) - exsltFuncFunctionFunction() (libexsl/functions.c)

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

xsltApplyStripSpaces ()

void	xsltApplyStripSpaces		(xsltTransformContextPtr ctxt, 
xmlNodePtr node)

Strip the unwanted ignorable spaces from the input tree

ctxt:a XSLT process context
node:the root of the XML tree

xsltApplyStylesheet ()

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

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

style:a parsed XSLT stylesheet
doc:a parsed XML document
params:a NULL terminated arry of parameters names/values tuples
Returns:the result document or NULL in case of error

xsltApplyStylesheetUser ()

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

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

style:a parsed XSLT stylesheet
doc:a parsed XML document
params:a NULL terminated array of parameters names/values tuples
output:the targetted output
profile:profile FILE * output or NULL
userCtxt:user provided transform context
Returns:the result document or NULL in case of error

xsltApplyTemplates ()

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

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

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

xsltAttribute ()

void	xsltAttribute			(xsltTransformContextPtr ctxt, 
xmlNodePtr contextNode,
xmlNodePtr inst,
xsltElemPreCompPtr castedComp)

Process the xslt attribute node on the source node

ctxt:a XSLT process context
contextNode:the current node in the source tree
inst:the xsl:attribute element
castedComp:precomputed information

xsltCallTemplate ()

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

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

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

xsltChoose ()

void	xsltChoose			(xsltTransformContextPtr ctxt, 
xmlNodePtr contextNode,
xmlNodePtr inst,
xsltElemPreCompPtr comp)

Processes the xsl:choose instruction on the source node.

ctxt:a XSLT process context
contextNode:the current node in the source tree
inst:the xsl:choose instruction
comp:compiled information of the instruction

xsltComment ()

void	xsltComment			(xsltTransformContextPtr ctxt, 
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp)

Process the xslt comment node on the source node

ctxt:a XSLT process context
node:the node in the source tree.
inst:the xslt comment node
comp:precomputed information

xsltCopy ()

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

Execute the XSLT-copy instruction on the source node.

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

xsltCopyOf ()

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

Process the XSLT copy-of instruction.

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

xsltCopyTextString ()

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

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

ctxt:a XSLT process context
target:the element where the text will be attached
string:the text string
noescape:should disable-escaping be activated for this text node.
Returns:the text node, where the text content of @cur is copied to. NULL in case of API or internal errors.