libxslt Reference Manual |
---|
xsltInternals - internal data structures, constants and functions
Internal data structures, constants and functions used by the XSLT engine. They are not part of the API or ABI, i.e. they can change without prior notice, use carefully.
Author(s): Daniel Veillard
#define CHECK_STOPPED; #define CHECK_STOPPED0; #define CHECK_STOPPEDE; #define IS_XSLT_ATTR_FAST; #define IS_XSLT_ELEM_FAST; #define XML_CAST_FPTR(fptr); #define XSLT_CCTXT; #define XSLT_FAST_IF; #define XSLT_GET_INTERNAL_NSMAP; #define XSLT_HAS_INTERNAL_NSMAP; #define XSLT_IS_RES_TREE_FRAG; #define XSLT_IS_TEXT_NODE; #define XSLT_ITEM_COMMON_FIELDS; #define XSLT_ITEM_COMPATIBILITY_FIELDS; #define XSLT_ITEM_NAVIGATION_FIELDS; #define XSLT_ITEM_NSINSCOPE_FIELDS; #define XSLT_MARK_RES_TREE_FRAG; #define XSLT_MAX_SORT; #define XSLT_PAT_NO_PRIORITY; #define XSLT_REFACTORED_KEYCOMP; #define XSLT_REFACTORED_VARS; #define XSLT_RUNTIME_EXTRA(ctxt, nr); #define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr); #define XSLT_RUNTIME_EXTRA_LST(ctxt, nr); typedef struct _xsltCompilerCtxt xsltCompilerCtxt; typedef xsltCompilerCtxt * xsltCompilerCtxtPtr; typedef struct _xsltCompilerNodeInfo xsltCompilerNodeInfo; typedef xsltCompilerNodeInfo * xsltCompilerNodeInfoPtr; typedef struct _xsltDecimalFormat xsltDecimalFormat; typedef xsltDecimalFormat * xsltDecimalFormatPtr; typedef struct _xsltDocument xsltDocument; typedef xsltDocument * xsltDocumentPtr; typedef struct _xsltEffectiveNs xsltEffectiveNs; typedef xsltEffectiveNs * xsltEffectiveNsPtr; typedef struct _xsltElemPreComp xsltElemPreComp; typedef xsltElemPreComp * xsltElemPreCompPtr; typedef enum xsltErrorSeverityType; typedef struct _xsltKeyDef xsltKeyDef; typedef xsltKeyDef * xsltKeyDefPtr; typedef struct _xsltKeyTable xsltKeyTable; typedef xsltKeyTable * xsltKeyTablePtr; typedef struct _xsltNsAlias xsltNsAlias; typedef xsltNsAlias * xsltNsAliasPtr; typedef struct _xsltNsList xsltNsList; typedef struct _xsltNsListContainer xsltNsListContainer; typedef xsltNsListContainer * xsltNsListContainerPtr; typedef xsltNsList * xsltNsListPtr; typedef struct _xsltNsMap xsltNsMap; typedef xsltNsMap * xsltNsMapPtr; typedef enum xsltOutputType; typedef struct _xsltPointerList xsltPointerList; typedef xsltPointerList * xsltPointerListPtr; typedef struct _xsltPrincipalStylesheetData xsltPrincipalStylesheetData; typedef xsltPrincipalStylesheetData * xsltPrincipalStylesheetDataPtr; typedef struct _xsltRuntimeExtra xsltRuntimeExtra; typedef xsltRuntimeExtra * xsltRuntimeExtraPtr; typedef struct _xsltStackElem xsltStackElem; typedef xsltStackElem * xsltStackElemPtr; typedef struct _xsltStyleBasicEmptyItem xsltStyleBasicEmptyItem; typedef xsltStyleBasicEmptyItem * xsltStyleBasicEmptyItemPtr; typedef struct _xsltStyleBasicExpressionItem xsltStyleBasicExpressionItem; typedef xsltStyleBasicExpressionItem * xsltStyleBasicExpressionItemPtr; typedef struct _xsltStyleBasicItemVariable xsltStyleBasicItemVariable; typedef xsltStyleBasicItemVariable * xsltStyleBasicItemVariablePtr; typedef xsltStyleBasicEmptyItem xsltStyleItemApplyImports; typedef xsltStyleItemApplyImports * xsltStyleItemApplyImportsPtr; typedef struct _xsltStyleItemApplyTemplates xsltStyleItemApplyTemplates; typedef xsltStyleItemApplyTemplates * xsltStyleItemApplyTemplatesPtr; typedef struct _xsltStyleItemAttribute xsltStyleItemAttribute; typedef xsltStyleItemAttribute * xsltStyleItemAttributePtr; typedef struct _xsltStyleItemCallTemplate xsltStyleItemCallTemplate; typedef xsltStyleItemCallTemplate * xsltStyleItemCallTemplatePtr; typedef xsltStyleBasicEmptyItem xsltStyleItemChoose; typedef xsltStyleItemChoose * xsltStyleItemChoosePtr; typedef xsltStyleBasicEmptyItem xsltStyleItemComment; typedef xsltStyleItemComment * xsltStyleItemCommentPtr; typedef struct _xsltStyleItemCopy xsltStyleItemCopy; typedef xsltStyleBasicExpressionItem xsltStyleItemCopyOf; typedef xsltStyleItemCopyOf * xsltStyleItemCopyOfPtr; typedef xsltStyleItemCopy * xsltStyleItemCopyPtr; typedef struct _xsltStyleItemDocument xsltStyleItemDocument; typedef xsltStyleItemDocument * xsltStyleItemDocumentPtr; typedef struct _xsltStyleItemElement xsltStyleItemElement; typedef xsltStyleItemElement * xsltStyleItemElementPtr; typedef struct _xsltStyleItemExtElement xsltStyleItemExtElement; typedef xsltStyleItemExtElement * xsltStyleItemExtElementPtr; typedef xsltStyleBasicEmptyItem xsltStyleItemFallback; typedef xsltStyleItemFallback * xsltStyleItemFallbackPtr; typedef xsltStyleBasicExpressionItem xsltStyleItemForEach; typedef xsltStyleItemForEach * xsltStyleItemForEachPtr; typedef struct _xsltStyleItemIf xsltStyleItemIf; typedef xsltStyleItemIf * xsltStyleItemIfPtr; typedef struct _xsltStyleItemInclude xsltStyleItemInclude; typedef xsltStyleItemInclude * xsltStyleItemIncludePtr; typedef struct _xsltStyleItemLRElementInfo xsltStyleItemLRElementInfo; typedef xsltStyleItemLRElementInfo * xsltStyleItemLRElementInfoPtr; typedef struct _xsltStyleItemMessage xsltStyleItemMessage; typedef xsltStyleItemMessage * xsltStyleItemMessagePtr; typedef struct _xsltStyleItemNumber xsltStyleItemNumber; typedef xsltStyleItemNumber * xsltStyleItemNumberPtr; typedef struct _xsltStyleItemOtherwise xsltStyleItemOtherwise; typedef xsltStyleItemOtherwise * xsltStyleItemOtherwisePtr; typedef struct _xsltStyleItemPI xsltStyleItemPI; typedef xsltStyleItemPI * xsltStyleItemPIPtr; typedef struct _xsltStyleItemParam xsltStyleItemParam; typedef xsltStyleItemParam * xsltStyleItemParamPtr; typedef struct _xsltStyleItemSort xsltStyleItemSort; typedef xsltStyleItemSort * xsltStyleItemSortPtr; typedef struct _xsltStyleItemText xsltStyleItemText; typedef xsltStyleItemText * xsltStyleItemTextPtr; typedef struct _xsltStyleItemUknown xsltStyleItemUknown; typedef xsltStyleItemUknown * xsltStyleItemUknownPtr; typedef struct _xsltStyleItemValueOf xsltStyleItemValueOf; typedef xsltStyleItemValueOf * xsltStyleItemValueOfPtr; typedef xsltStyleBasicItemVariable xsltStyleItemVariable; typedef xsltStyleItemVariable * xsltStyleItemVariablePtr; typedef struct _xsltStyleItemWhen xsltStyleItemWhen; typedef xsltStyleItemWhen * xsltStyleItemWhenPtr; typedef xsltStyleBasicItemVariable xsltStyleItemWithParam; typedef xsltStyleItemWithParam * xsltStyleItemWithParamPtr; typedef struct _xsltStylePreComp xsltStylePreComp; typedef xsltStylePreComp * xsltStylePreCompPtr; typedef enum xsltStyleType; typedef struct _xsltStylesheet xsltStylesheet; typedef xsltStylesheet * xsltStylesheetPtr; typedef struct _xsltTemplate xsltTemplate; typedef xsltTemplate * xsltTemplatePtr; typedef struct _xsltTransformCache xsltTransformCache; typedef xsltTransformCache * xsltTransformCachePtr; typedef struct _xsltTransformContext xsltTransformContext; typedef xsltTransformContext * xsltTransformContextPtr; typedef enum xsltTransformState; typedef struct _xsltVarInfo xsltVarInfo; typedef xsltVarInfo * xsltVarInfoPtr; int xsltAllocateExtra (xsltStylesheetPtr style); int xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt); void xsltCompileAttr (xsltStylesheetPtr style,
xmlAttrPtr attr); xmlDocPtr xsltCreateRVT (xsltTransformContextPtr ctxt); xsltDecimalFormatPtr xsltDecimalFormatGetByName (xsltStylesheetPtr style,
xmlChar * name); xsltDecimalFormatPtr xsltDecimalFormatGetByQName (xsltStylesheetPtr style,
const xmlChar * nsUri,
const xmlChar * name); typedef void xsltElemPreCompDeallocator (xsltElemPreCompPtr comp); xmlChar * xsltEvalAVT (xsltTransformContextPtr ctxt,
void * avt,
xmlNodePtr node); int xsltExtensionInstructionResultFinalize (xsltTransformContextPtr ctxt); int xsltExtensionInstructionResultRegister (xsltTransformContextPtr ctxt,
xmlXPathObjectPtr obj); int xsltFlagRVTs (xsltTransformContextPtr ctxt,
xmlXPathObjectPtr obj,
int val); xmlXPathError xsltFormatNumberConversion (xsltDecimalFormatPtr self,
xmlChar * format,
double number,
xmlChar ** result); void xsltFreeAVTList (void * avt); typedef void xsltFreeLocaleFunc (void * locale); void xsltFreeRVTs (xsltTransformContextPtr ctxt); void xsltFreeStackElemList (xsltStackElemPtr elem); void xsltFreeStylesheet (xsltStylesheetPtr style); typedef xmlChar * xsltGenSortKeyFunc (void * locale,
const xmlChar * lang); int xsltInitAllDocKeys (xsltTransformContextPtr ctxt); int xsltInitCtxtKey (xsltTransformContextPtr ctxt,
xsltDocumentPtr idoc,
xsltKeyDefPtr keyDef); int xsltIsBlank (xmlChar * str); xsltStylesheetPtr xsltLoadStylesheetPI (xmlDocPtr doc); typedef void * xsltNewLocaleFunc (const xmlChar * lang,
int lowerFirst); xsltStylesheetPtr xsltNewStylesheet (void); void xsltNumberFormat (xsltTransformContextPtr ctxt,
xsltNumberDataPtr data,
xmlNodePtr node); int xsltParseAnyXSLTElem (xsltCompilerCtxtPtr cctxt,
xmlNodePtr elem); void xsltParseSequenceConstructor (xsltCompilerCtxtPtr cctxt,
xmlNodePtr cur); xsltStylesheetPtr xsltParseStylesheetDoc (xmlDocPtr doc); xsltStylesheetPtr xsltParseStylesheetFile (const xmlChar * filename); xsltStylesheetPtr xsltParseStylesheetImportedDoc (xmlDocPtr doc,
xsltStylesheetPtr parentStyle); void xsltParseStylesheetOutput (xsltStylesheetPtr style,
xmlNodePtr cur); xsltStylesheetPtr xsltParseStylesheetProcess (xsltStylesheetPtr ret,
xmlDocPtr doc); int xsltParseStylesheetUser (xsltStylesheetPtr style,
xmlDocPtr doc); void xsltParseTemplateContent (xsltStylesheetPtr style,
xmlNodePtr templ); int xsltPointerListAddSize (xsltPointerListPtr list,
void * item,
int initialSize); void xsltPointerListClear (xsltPointerListPtr list); xsltPointerListPtr xsltPointerListCreate (int initialSize); void xsltPointerListFree (xsltPointerListPtr list); int xsltRegisterLocalRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); int xsltRegisterPersistRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); int xsltRegisterTmpRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); void xsltReleaseRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); int xsltRestoreDocumentNamespaces (xsltNsMapPtr ns,
xmlDocPtr doc); typedef void xsltSortFunc (xsltTransformContextPtr ctxt,
xmlNodePtr * sorts,
int nbsorts); typedef void xsltTransformFunction (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp); void xsltUninit (void);
#define CHECK_STOPPED;
Macro to check if the XSLT processing should be stopped. Will return from the function.
#define CHECK_STOPPED0;
Macro to check if the XSLT processing should be stopped. Will return from the function with a 0 value.
#define CHECK_STOPPEDE;
Macro to check if the XSLT processing should be stopped. Will goto the error: label.
#define XML_CAST_FPTR(fptr);
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
fptr: | pointer to a function |
#define XSLT_FAST_IF;
Internal define to enable usage of xmlXPathCompiledEvalToBoolean() for XSLT "tests"; e.g. in <xsl:if test="/foo/bar">
#define XSLT_ITEM_COMPATIBILITY_FIELDS;
Fields for API compatibility to the structure _xsltElemPreComp which is used for extension functions. Note that @next is used for storage; it does not reflect a next sibling in the tree. TODO: Evaluate if we really need such a compatibility.
#define XSLT_ITEM_NAVIGATION_FIELDS;
Currently empty. TODO: It is intended to hold navigational fields in the future.
#define XSLT_MARK_RES_TREE_FRAG;
internal macro to set up tree fragments
#define XSLT_PAT_NO_PRIORITY;
Specific value for pattern without priority expressed.
#define 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;
Internal define to enable the refactored variable part of libxslt
#define XSLT_RUNTIME_EXTRA(ctxt, nr);
Macro used to define extra information stored in the context
ctxt: | the transformation context |
nr: | the index |
#define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr);
Macro used to free extra information stored in the context
ctxt: | the transformation context |
nr: | the index |
#define XSLT_RUNTIME_EXTRA_LST(ctxt, nr);
Macro used to access extra information stored in the context
ctxt: | the transformation context |
nr: | the index |
struct _xsltCompilerCtxt { void * errorCtxt : * used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING xsltErrorSeverityType errSeverity int warnings : TODO: number of warnings found at compilation int errors : TODO: number of errors found at compilation xmlDictPtr dict xsltStylesheetPtr style int simplified : whether this is a simplified stylesheet TODO: structured/unstructured int depth : Current depth of processing xsltCompilerNodeInfoPtr inode xsltCompilerNodeInfoPtr inodeList xsltCompilerNodeInfoPtr inodeLast xsltPointerListPtr tmpList : * The XSLT version as specified by the stylesheet's root element. * int isInclude int hasForwardsCompat : whether forwards-compatible mode was used in a parsing episode int maxNodeInfos : TEMP TODO: just for the interest int maxLREs : * In order to keep the old behaviour, applying strict rules of * the s int strict xsltPrincipalStylesheetDataPtr psData xsltStyleItemUknownPtr unknownItem int hasNsAliases : Indicator if there was an xsl:namespace-alias. xsltNsAliasPtr nsAliases xsltVarInfoPtr ivars : Storage of local in-scope variables/params. xsltVarInfoPtr ivar : topmost local variable/param. } xsltCompilerCtxt;
xsltCompilerCtxt * xsltCompilerCtxtPtr;
struct _xsltCompilerNodeInfo { xsltCompilerNodeInfoPtr next xsltCompilerNodeInfoPtr prev xmlNodePtr node int depth xsltTemplatePtr templ : The owning template int category : XSLT element, LR-element or extension element xsltStyleType type xsltElemPreCompPtr item : The compiled information The current in-scope namespaces xsltNsListContainerPtr inScopeNs : The current excluded result namespaces xsltPointerListPtr exclResultNs : The current extension instruction namespaces xsltPointerListPtr extElemNs : The current info for literal result elements. xsltStyleItemLRElementInfoPtr litResElemInfo : * Set to 1 if in-scope namespaces changed, * or excluded result names int nsChanged int preserveWhitespace int stripWhitespace int isRoot : whether this is the stylesheet's root node int forwardsCompat : whether forwards-compatible mode is enabled whether the content of an int extContentHandled : the type of the current child xsltStyleType curChildType } xsltCompilerNodeInfo;
xsltCompilerNodeInfo * xsltCompilerNodeInfoPtr;
struct _xsltDecimalFormat { struct _xsltDecimalFormat * next : chained list xmlChar * name : Used for interpretation of pattern xmlChar * digit xmlChar * patternSeparator : May appear in result xmlChar * minusSign xmlChar * infinity xmlChar * noNumber : Not-a-number Used for interpretation of pattern and may appear in res xmlChar * decimalPoint xmlChar * grouping xmlChar * percent xmlChar * permille xmlChar * zeroDigit const xmlChar * nsUri } xsltDecimalFormat;
xsltDecimalFormat * xsltDecimalFormatPtr;
struct _xsltDocument { struct _xsltDocument * next : documents are kept in a chained list int main : is this the main document xmlDocPtr doc : the parsed document void * keys : key tables storage struct _xsltDocument * includes : subsidiary includes int preproc : pre-processing already done int nbKeysComputed } xsltDocument;
xsltDocument * xsltDocumentPtr;
struct _xsltEffectiveNs { xsltEffectiveNsPtr nextInStore : storage next xsltEffectiveNsPtr next : next item in the list const xmlChar * prefix const xmlChar * nsName : * Indicates if eclared on the literal result element; dunno if really int holdByElem } xsltEffectiveNs;
xsltEffectiveNs * xsltEffectiveNsPtr;
struct _xsltElemPreComp { xsltElemPreCompPtr next : next item in the global chained list held by xsltStylesheet. xsltStyleType type : type of the element xsltTransformFunction func : handling function xmlNodePtr inst : the node in the stylesheet's tree corresponding to this item end of c xsltElemPreCompDeallocator free : the deallocator } xsltElemPreComp;
xsltElemPreComp * xsltElemPreCompPtr;
enum xsltErrorSeverityType { XSLT_ERROR_SEVERITY_ERROR = 0 XSLT_ERROR_SEVERITY_WARNING = 1 };
struct _xsltKeyDef { struct _xsltKeyDef * next xmlNodePtr inst xmlChar * name xmlChar * nameURI xmlChar * match xmlChar * use xmlXPathCompExprPtr comp xmlXPathCompExprPtr usecomp xmlNsPtr * nsList : the namespaces in scope int nsNr : the number of namespaces in scope } xsltKeyDef;
xsltKeyDef * xsltKeyDefPtr;
struct _xsltKeyTable { struct _xsltKeyTable * next xmlChar * name xmlChar * nameURI xmlHashTablePtr keys } xsltKeyTable;
xsltKeyTable * xsltKeyTablePtr;
struct _xsltNsAlias { xsltNsAliasPtr next : next in the list xmlNsPtr literalNs xmlNsPtr targetNs xmlDocPtr docOfTargetNs } xsltNsAlias;
xsltNsAlias * xsltNsAliasPtr;
struct _xsltNsList { xsltNsListPtr next : next in the list xmlNsPtr ns } xsltNsList;
struct _xsltNsListContainer { xmlNsPtr * list int totalNumber int xpathNumber } xsltNsListContainer;
xsltNsListContainer * xsltNsListContainerPtr;
xsltNsList * xsltNsListPtr;
struct _xsltNsMap { xsltNsMapPtr next : next in the list xmlDocPtr doc xmlNodePtr elem : the element holding the ns-decl xmlNsPtr ns : the xmlNs structure holding the XML namespace name const xmlChar * origNsName : the original XML namespace name const xmlChar * newNsName : the mapped XML namespace name } xsltNsMap;
enum xsltOutputType { XSLT_OUTPUT_XML = 0 XSLT_OUTPUT_HTML = 1 XSLT_OUTPUT_TEXT = 2 };
struct _xsltPointerList { void ** items int number int size } xsltPointerList;
xsltPointerList * xsltPointerListPtr;
struct _xsltPrincipalStylesheetData { xmlDictPtr namespaceDict : * Global list of in-scope namespaces. * xsltPointerListPtr inScopeNamespaces : * Global list of information for [xsl:]excluded-result-prefixes. * xsltPointerListPtr exclResultNamespaces : * Global list of information for [xsl:]extension-element-prefixes. * xsltPointerListPtr extElemNamespaces xsltEffectiveNsPtr effectiveNs : * Namespace name map to get rid of string comparison of namespace name xsltNsMapPtr nsMap } xsltPrincipalStylesheetData;
xsltPrincipalStylesheetData * xsltPrincipalStylesheetDataPtr;
struct _xsltRuntimeExtra { void * info : pointer to the extra data xmlFreeFunc deallocate : pointer to the deallocation routine } xsltRuntimeExtra;
xsltRuntimeExtra * xsltRuntimeExtraPtr;
struct _xsltStackElem { struct _xsltStackElem * next : chained list xsltStylePreCompPtr comp : the compiled form int computed : was the evaluation done const xmlChar * name : the local part of the name QName const xmlChar * nameURI : the URI part of the name QName const xmlChar * select : the eval string xmlNodePtr tree : the sequence constructor if no eval string or the location xmlXPathObjectPtr value : The value if computed xmlDocPtr fragment : The Result Tree Fragments (needed for XSLT 1.0) which are bound to th int level : the depth in the tree; -1 if persistent (e.g. a given xsl:with-param) xsltTransformContextPtr context : The transformation context; needed to cache the variables int flags } xsltStackElem;
xsltStackElem * xsltStackElemPtr;
struct _xsltStyleBasicEmptyItem { The content of this structure is not made public by the API. } xsltStyleBasicEmptyItem;
xsltStyleBasicEmptyItem * xsltStyleBasicEmptyItemPtr;
struct _xsltStyleBasicExpressionItem { const xmlChar * select : TODO: Change this to "expression". xmlXPathCompExprPtr comp : TODO: Change this to compExpr. } xsltStyleBasicExpressionItem;
xsltStyleBasicExpressionItem * xsltStyleBasicExpressionItemPtr;
struct _xsltStyleBasicItemVariable { const xmlChar * select xmlXPathCompExprPtr comp const xmlChar * name int has_name const xmlChar * ns int has_ns } xsltStyleBasicItemVariable;
xsltStyleBasicItemVariable * xsltStyleBasicItemVariablePtr;
xsltStyleBasicEmptyItem xsltStyleItemApplyImports;
<!-- Category: instruction --> <xsl:apply-imports />
xsltStyleItemApplyImports * xsltStyleItemApplyImportsPtr;
struct _xsltStyleItemApplyTemplates { const xmlChar * mode : apply-templates const xmlChar * modeURI : apply-templates const xmlChar * select : sort, copy-of, value-of, apply-templates xmlXPathCompExprPtr comp : a precompiled XPath expression TODO: with-params } xsltStyleItemApplyTemplates;
xsltStyleItemApplyTemplates * xsltStyleItemApplyTemplatesPtr;
struct _xsltStyleItemAttribute { const xmlChar * name int has_name const xmlChar * ns const xmlChar * nsPrefix int has_ns } xsltStyleItemAttribute;
xsltStyleItemAttribute * xsltStyleItemAttributePtr;
struct _xsltStyleItemCallTemplate { xsltTemplatePtr templ : call-template const xmlChar * name : element, attribute, pi int has_name : element, attribute, pi const xmlChar * ns : element int has_ns : element TODO: with-params } xsltStyleItemCallTemplate;
xsltStyleItemCallTemplate * xsltStyleItemCallTemplatePtr;
xsltStyleBasicEmptyItem xsltStyleItemChoose;
<!-- Category: instruction --> <xsl:choose> <!-- Content: (xsl:when+, xsl:otherwise?) --> </xsl:choose>
xsltStyleItemChoose * xsltStyleItemChoosePtr;
xsltStyleBasicEmptyItem xsltStyleItemComment;
<!-- Category: instruction --> <xsl:comment> <!-- Content: template --> </xsl:comment>
xsltStyleItemComment * xsltStyleItemCommentPtr;
struct _xsltStyleItemCopy { const xmlChar * use : copy, element int has_use : copy, element } xsltStyleItemCopy;
xsltStyleBasicExpressionItem xsltStyleItemCopyOf;
<!-- Category: instruction --> <xsl:copy-of select = expression />
xsltStyleItemCopyOf * xsltStyleItemCopyOfPtr;
xsltStyleItemCopy * xsltStyleItemCopyPtr;
struct _xsltStyleItemDocument { int ver11 : assigned: in xsltDocumentComp; read: nowhere; TODO: Check if we need. const xmlChar * filename : document URL int has_filename } xsltStyleItemDocument;
xsltStyleItemDocument * xsltStyleItemDocumentPtr;
struct _xsltStyleItemElement { const xmlChar * use int has_use const xmlChar * name int has_name const xmlChar * ns const xmlChar * nsPrefix int has_ns } xsltStyleItemElement;
xsltStyleItemElement * xsltStyleItemElementPtr;
struct _xsltStyleItemExtElement { xsltElemPreCompPtr item } xsltStyleItemExtElement;
xsltStyleItemExtElement * xsltStyleItemExtElementPtr;
xsltStyleBasicEmptyItem xsltStyleItemFallback;
<!-- Category: instruction --> <xsl:fallback> <!-- Content: template --> </xsl:fallback>
xsltStyleItemFallback * xsltStyleItemFallbackPtr;
xsltStyleBasicExpressionItem xsltStyleItemForEach;
<!-- Category: instruction --> <xsl:for-each select = node-set-expression> <!-- Content: (xsl:sort*, template) --> </xsl:for-each>
xsltStyleItemForEach * xsltStyleItemForEachPtr;
struct _xsltStyleItemIf { const xmlChar * test : if xmlXPathCompExprPtr comp : a precompiled XPath expression } xsltStyleItemIf;
xsltStyleItemIf * xsltStyleItemIfPtr;
struct _xsltStyleItemInclude { xsltDocumentPtr include } xsltStyleItemInclude;
xsltStyleItemInclude * xsltStyleItemIncludePtr;
struct _xsltStyleItemLRElementInfo { xsltEffectiveNsPtr effectiveNs } xsltStyleItemLRElementInfo;
xsltStyleItemLRElementInfo * xsltStyleItemLRElementInfoPtr;
struct _xsltStyleItemMessage { int terminate } xsltStyleItemMessage;
xsltStyleItemMessage * xsltStyleItemMessagePtr;
struct _xsltStyleItemNumber { xsltNumberData numdata : number } xsltStyleItemNumber;
xsltStyleItemNumber * xsltStyleItemNumberPtr;
struct _xsltStyleItemOtherwise { The content of this structure is not made public by the API. } xsltStyleItemOtherwise;
xsltStyleItemOtherwise * xsltStyleItemOtherwisePtr;
struct _xsltStyleItemPI { const xmlChar * name int has_name } xsltStyleItemPI;
xsltStyleItemPI * xsltStyleItemPIPtr;
struct _xsltStyleItemParam { const xmlChar * select xmlXPathCompExprPtr comp const xmlChar * name int has_name const xmlChar * ns int has_ns } xsltStyleItemParam;
xsltStyleItemParam * xsltStyleItemParamPtr;
struct _xsltStyleItemSort { const xmlChar * stype : sort int has_stype : sort int number : sort const xmlChar * order : sort int has_order : sort int descending : sort const xmlChar * lang : sort int has_lang : sort const xmlChar * case_order : sort int lower_first : sort const xmlChar * use int has_use const xmlChar * select : sort, copy-of, value-of, apply-templates xmlXPathCompExprPtr comp : a precompiled XPath expression } xsltStyleItemSort;
xsltStyleItemSort * xsltStyleItemSortPtr;
struct _xsltStyleItemText { int noescape : text } xsltStyleItemText;
xsltStyleItemText * xsltStyleItemTextPtr;
struct _xsltStyleItemUknown { The content of this structure is not made public by the API. } xsltStyleItemUknown;
xsltStyleItemUknown * xsltStyleItemUknownPtr;
struct _xsltStyleItemValueOf { const xmlChar * select xmlXPathCompExprPtr comp : a precompiled XPath expression int noescape } xsltStyleItemValueOf;
xsltStyleItemValueOf * xsltStyleItemValueOfPtr;
xsltStyleBasicItemVariable xsltStyleItemVariable;
<!-- Category: top-level-element --> <xsl:param name = qname select = expression> <!-- Content: template --> </xsl:param>
xsltStyleItemVariable * xsltStyleItemVariablePtr;
struct _xsltStyleItemWhen { const xmlChar * test xmlXPathCompExprPtr comp } xsltStyleItemWhen;
xsltStyleItemWhen * xsltStyleItemWhenPtr;
xsltStyleBasicItemVariable xsltStyleItemWithParam;
<xsl:with-param name = qname select = expression> <!-- Content: template --> </xsl:with-param>
xsltStyleItemWithParam * xsltStyleItemWithParamPtr;
struct _xsltStylePreComp { xsltElemPreCompPtr next : chained list xsltStyleType type : type of the element xsltTransformFunction func : handling function xmlNodePtr inst : * Pre computed values. * const xmlChar * stype : sort int has_stype : sort int number : sort const xmlChar * order : sort int has_order : sort int descending : sort const xmlChar * lang : sort int has_lang : sort const xmlChar * case_order : sort int lower_first : sort const xmlChar * use : copy, element int has_use : copy, element int noescape : text const xmlChar * name : element, attribute, pi int has_name : element, attribute, pi const xmlChar * ns : element int has_ns : element const xmlChar * mode : apply-templates const xmlChar * modeURI : apply-templates const xmlChar * test : if xsltTemplatePtr templ : call-template const xmlChar * select : sort, copy-of, value-of, apply-templates int ver11 : document const xmlChar * filename : document URL int has_filename : document xsltNumberData numdata : number xmlXPathCompExprPtr comp : a precompiled XPath expression xmlNsPtr * nsList : the namespaces in scope int nsNr : the number of namespaces in scope } xsltStylePreComp;
xsltStylePreComp * xsltStylePreCompPtr;
enum xsltStyleType { XSLT_FUNC_COPY = 1 XSLT_FUNC_SORT = 2 XSLT_FUNC_TEXT = 3 XSLT_FUNC_ELEMENT = 4 XSLT_FUNC_ATTRIBUTE = 5 XSLT_FUNC_COMMENT = 6 XSLT_FUNC_PI = 7 XSLT_FUNC_COPYOF = 8 XSLT_FUNC_VALUEOF = 9 XSLT_FUNC_NUMBER = 10 XSLT_FUNC_APPLYIMPORTS = 11 XSLT_FUNC_CALLTEMPLATE = 12 XSLT_FUNC_APPLYTEMPLATES = 13 XSLT_FUNC_CHOOSE = 14 XSLT_FUNC_IF = 15 XSLT_FUNC_FOREACH = 16 XSLT_FUNC_DOCUMENT = 17 XSLT_FUNC_WITHPARAM = 18 XSLT_FUNC_PARAM = 19 XSLT_FUNC_VARIABLE = 20 XSLT_FUNC_WHEN = 21 XSLT_FUNC_EXTENSION = 22 XSLT_FUNC_OTHERWISE = 23 XSLT_FUNC_FALLBACK = 24 XSLT_FUNC_MESSAGE = 25 XSLT_FUNC_INCLUDE = 26 XSLT_FUNC_ATTRSET = 27 XSLT_FUNC_LITERAL_RESULT_ELEMENT = 28 XSLT_FUNC_UNKOWN_FORWARDS_COMPAT = 29 };
struct _xsltStylesheet { struct _xsltStylesheet * parent struct _xsltStylesheet * next struct _xsltStylesheet * imports xsltDocumentPtr docList : * General data on the style sheet document. * xmlDocPtr doc : the parsed XML stylesheet xmlHashTablePtr stripSpaces : the hash table of the strip-space and preserve space elements int stripAll : strip-space * (1) preserve-space * (-1) xmlHashTablePtr cdataSection : * Global variable or parameters. * xsltStackElemPtr variables : * Template descriptions. * xsltTemplatePtr templates : the ordered list of templates xmlHashTablePtr templatesHash : hash table or wherever compiled templates information is stored struct _xsltCompMatch * rootMatch : template based on / struct _xsltCompMatch * keyMatch : template based on key() struct _xsltCompMatch * elemMatch : template based on * struct _xsltCompMatch * attrMatch : template based on @* struct _xsltCompMatch * parentMatch : template based on .. struct _xsltCompMatch * textMatch : template based on text() struct _xsltCompMatch * piMatch : template based on processing-instruction() struct _xsltCompMatch * commentMatch : * Namespace aliases. * NOTE: Not used in the refactored code. * xmlHashTablePtr nsAliases : * Attribute sets. * xmlHashTablePtr attributeSets : * Namespaces. * TODO: Eliminate this. * xmlHashTablePtr nsHash : the set of namespaces in use: ATTENTION: This is used for execution o void * nsDefs : * Key definitions. * void * keys : * Output related stuff. * xmlChar * method : the output method xmlChar * methodURI : associated namespace if any xmlChar * version : version string xmlChar * encoding : encoding string int omitXmlDeclaration : * Number formatting. * xsltDecimalFormatPtr decimalFormat int standalone : standalone = "yes" | "no" xmlChar * doctypePublic : doctype-public string xmlChar * doctypeSystem : doctype-system string int indent : should output being indented xmlChar * mediaType : * Precomputed blocks. * xsltElemPreCompPtr preComps : list of precomputed blocks int warnings : number of warnings found at compilation int errors : number of errors found at compilation xmlChar * exclPrefix : last excluded prefixes xmlChar ** exclPrefixTab : array of excluded prefixes int exclPrefixNr : number of excluded prefixes in scope int exclPrefixMax : size of the array void * _private : * Extensions. * xmlHashTablePtr extInfos : the extension data int extrasNr : * For keeping track of nested includes * xsltDocumentPtr includes : * dictionary: shared between stylesheet, context and documents. * xmlDictPtr dict : * precompiled attribute value templates. * void * attVTs : * if namespace-alias has an alias for the default stylesheet prefix * const xmlChar * defaultAlias : * bypass pre-processing (already done) (used in imports) * int nopreproc : * all document text strings were internalized * int internalized : * Literal Result Element as Stylesheet c.f. section 2.3 * int literal_result : * The principal stylesheet * xsltStylesheetPtr principal : * Compilation context used during compile-time. * xsltCompilerCtxtPtr compCtxt : TODO: Change this to (void *). xsltPrincipalStylesheetDataPtr principalData : * Forwards-compatible processing * int forwards_compatible xmlHashTablePtr namedTemplates : hash table of named templates xmlXPathContextPtr xpathCtxt } xsltStylesheet;
xsltStylesheet * xsltStylesheetPtr;
struct _xsltTemplate { struct _xsltTemplate * next : chained list sorted by priority struct _xsltStylesheet * style : the containing stylesheet xmlChar * match : the matching string float priority : as given from the stylesheet, not computed const xmlChar * name : the local part of the name QName const xmlChar * nameURI : the URI part of the name QName const xmlChar * mode : the local part of the mode QName const xmlChar * modeURI : the URI part of the mode QName xmlNodePtr content : the template replacement value xmlNodePtr elem : * TODO: @inheritedNsNr and @inheritedNs won't be used in the * refact int inheritedNsNr : number of inherited namespaces xmlNsPtr * inheritedNs : inherited non-excluded namespaces Profiling information int nbCalls : the number of time the template was called unsigned long time : the time spent in this template void * params : xsl:param instructions int templNr : Nb of templates in the stack int templMax : Size of the templtes stack xsltTemplatePtr * templCalledTab : templates called int * templCountTab : .. and how often Conflict resolution int position } xsltTemplate;
xsltTemplate * xsltTemplatePtr;
struct _xsltTransformCache { xmlDocPtr RVT int nbRVT xsltStackElemPtr stackItems int nbStackItems int dbgCachedRVTs int dbgReusedRVTs int dbgCachedVars int dbgReusedVars } xsltTransformCache;
xsltTransformCache * xsltTransformCachePtr;
struct _xsltTransformContext { xsltStylesheetPtr style : the stylesheet used xsltOutputType type : the type of output xsltTemplatePtr templ : the current template int templNr : Nb of templates in the stack int templMax : Size of the templtes stack xsltTemplatePtr * templTab : the template stack xsltStackElemPtr vars : the current variable list int varsNr : Nb of variable list in the stack int varsMax : Size of the variable list stack xsltStackElemPtr * varsTab : the variable list stack int varsBase : * Extensions * xmlHashTablePtr extFunctions : the extension functions xmlHashTablePtr extElements : the extension elements xmlHashTablePtr extInfos : the extension data const xmlChar * mode : the current mode const xmlChar * modeURI : the current mode URI xsltDocumentPtr docList : the document list xsltDocumentPtr document : the current source document; can be NULL if an RTF xmlNodePtr node : the current node being processed xmlNodeSetPtr nodeList : the current node list xmlNodePtr current; the node xmlDocPtr output : the resulting document xmlNodePtr insert : the insertion node xmlXPathContextPtr xpathCtxt : the XPath context xsltTransformState state : * Global variables * xmlHashTablePtr globalVars : the global variables and params xmlNodePtr inst : the instruction in the stylesheet int xinclude : should XInclude be processed const char * outputFile : the output URI if known int profile : is this run profiled long prof : the current profiled value int profNr : Nb of templates in the stack int profMax : Size of the templtaes stack long * profTab : the profile template stack void * _private : user defined data int extrasNr : the number of extras used int extrasMax : the number of extras allocated xsltRuntimeExtraPtr extras : extra per runtime information xsltDocumentPtr styleList : the stylesheet docs list void * sec : the security preferences if any xmlGenericErrorFunc error : a specific error handler void * errctx : context for the error handler xsltSortFunc sortfunc : * handling of temporary Result Value Tree * (XSLT 1.0 term: "Result Tr xmlDocPtr tmpRVT : list of RVT without persistance xmlDocPtr persistRVT : list of persistant RVTs int ctxtflags : * Speed optimization when coalescing text nodes * const xmlChar * lasttext : last text node content int lasttsize : last text node size int lasttuse : * Per Context Debugging * int debugStatus : the context level debug status unsigned long * traceCode : pointer to the variable holding the mask int parserOptions : * dictionary: shared between stylesheet, context and documents. * xmlDictPtr dict xmlDocPtr tmpDoc : * all document text strings are internalized * int internalized int nbKeys int hasTemplKeyPatterns xsltTemplatePtr currentTemplateRule : the Current Template Rule xmlNodePtr initialContextNode xmlDocPtr initialContextDoc xsltTransformCachePtr cache void * contextVariable : the current variable item xmlDocPtr localRVT : list of local tree fragments; will be freed when the instruction whic xmlDocPtr localRVTBase : Obsolete int keyInitLevel : Needed to catch recursive keys issues int depth : Needed to catch recursions int maxTemplateDepth int maxTemplateVars unsigned long opLimit unsigned long opCount int sourceDocDirty unsigned long currentId : For generate-id() xsltNewLocaleFunc newLocale xsltFreeLocaleFunc freeLocale xsltGenSortKeyFunc genSortKey } xsltTransformContext;
xsltTransformContext * xsltTransformContextPtr;
enum xsltTransformState { XSLT_STATE_OK = 0 XSLT_STATE_ERROR = 1 XSLT_STATE_STOPPED = 2 };
struct _xsltVarInfo { xsltVarInfoPtr next : next in the list xsltVarInfoPtr prev int depth : the depth in the tree const xmlChar * name const xmlChar * nsName } xsltVarInfo;
xsltVarInfo * xsltVarInfoPtr;
void xsltElemPreCompDeallocator (xsltElemPreCompPtr comp)
Deallocates an #xsltElemPreComp structure.
comp: | the #xsltElemPreComp to free up |
xmlChar * xsltGenSortKeyFunc (void * locale,
const xmlChar * lang)
locale: | |
lang: | |
Returns: |
void * xsltNewLocaleFunc (const xmlChar * lang,
int lowerFirst)
lang: | |
lowerFirst: | |
Returns: |
void xsltSortFunc (xsltTransformContextPtr ctxt,
xmlNodePtr * sorts,
int nbsorts)
Signature of the function to use during sorting
ctxt: | a transformation context |
sorts: | the node-set to sort |
nbsorts: | the number of sorts |
void xsltTransformFunction (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp)
Signature of the function associated to elements part of the stylesheet language like xsl:if or xsl:apply-templates.
ctxt: | the XSLT transformation context |
node: | the input node |
inst: | the stylesheet node |
comp: | the compiled information from the stylesheet |
const xmlChar * xsltConstNamespaceNameXSLT;
const xmlChar * xsltXSLTAttrMarker;
Marker for XSLT attribute on Literal Result Elements.
int xsltAllocateExtra (xsltStylesheetPtr style)
Allocate an extra runtime information slot statically while compiling the stylesheet and return its number
style: | an XSLT stylesheet |
Returns: | the number of the slot |
int xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt)
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
ctxt: | an XSLT transformation context |
Returns: | the number of the slot |
void xsltCompileAttr (xsltStylesheetPtr style,
xmlAttrPtr attr)
Precompile an attribute in a stylesheet, basically it checks if it is an attribute value template, and if yes, establish some structures needed to process it at transformation time.
style: | a XSLT process context |
attr: | the attribute coming from the stylesheet. |
xmlDocPtr xsltCreateRVT (xsltTransformContextPtr ctxt)
Creates a Result Value Tree (the XSLT 1.0 term for this is "Result Tree Fragment")
ctxt: | an XSLT transformation context |
Returns: | the result value tree or NULL in case of API or internal errors. |
xsltDecimalFormatPtr xsltDecimalFormatGetByName (xsltStylesheetPtr style,
xmlChar * name)
Find decimal-format by name
style: | the XSLT stylesheet |
name: | the decimal-format name to find |
Returns: | the xsltDecimalFormatPtr |
xsltDecimalFormatPtr xsltDecimalFormatGetByQName (xsltStylesheetPtr style,
const xmlChar * nsUri,
const xmlChar * name)
Find decimal-format by QName
style: | the XSLT stylesheet |
nsUri: | the namespace URI of the QName |
name: | the local part of the QName |
Returns: | the xsltDecimalFormatPtr |
xmlChar * xsltEvalAVT (xsltTransformContextPtr ctxt,
void * avt,
xmlNodePtr node)
Process the given AVT, and return the new string value.
ctxt: | the XSLT transformation context |
avt: | the prevompiled attribute value template info |
node: | the node hosting the attribute |
Returns: | the computed string value or NULL, must be deallocated by the caller. |
int xsltExtensionInstructionResultFinalize (xsltTransformContextPtr ctxt)
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.
ctxt: | an XSLT transformation context |
Returns: | 0 in case of success and -1 in case of API or internal errors. This function is unsupported in newer releases of libxslt. |
int xsltExtensionInstructionResultRegister (xsltTransformContextPtr ctxt,
xmlXPathObjectPtr obj)
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().
ctxt: | an XSLT transformation context |
obj: | an XPath object to be inspected for result tree fragments |
Returns: | 0 in case of success and -1 in case of error. It isn't necessary to call this function in newer releases of libxslt. |
int xsltFlagRVTs (xsltTransformContextPtr ctxt,
xmlXPathObjectPtr obj,
int val)
Updates ownership information of RVTs in @obj according to @val. @val = XSLT_RVT_FUNC_RESULT for the result of an extension function, so its RVTs won't be destroyed after leaving the returning scope. @val = XSLT_RVT_LOCAL for the result of an extension function to reset the state of its RVTs after it was returned to a new scope. @val = XSLT_RVT_GLOBAL for parts of global variables.
ctxt: | an XSLT transformation context |
obj: | an XPath object to be inspected for result tree fragments |
val: | the flag value |
Returns: | 0 in case of success and -1 in case of error. |
xmlXPathError xsltFormatNumberConversion (xsltDecimalFormatPtr self,
xmlChar * format,
double number,
xmlChar ** result)
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. - default negative prefix. % multiply by 100 and show as percentage ? multiply by 1000 and show as per mille X any other characters can be used in the prefix or suffix ' used to quote special characters in a prefix or suffix.
self: | the decimal format |
format: | the format requested |
number: | the value to format |
result: | the place to output the result |
Returns: | a possible XPath error |
void xsltFreeAVTList (void * avt)
Free up the memory associated to the attribute value templates
avt: | pointer to an list of AVT structures |
void xsltFreeRVTs (xsltTransformContextPtr ctxt)
Frees all registered result value trees (Result Tree Fragments) of the transformation. Internal function; should not be called by user-code.
ctxt: | an XSLT transformation context |
void xsltFreeStackElemList (xsltStackElemPtr elem)
Free up the memory allocated by @elem
elem: | an XSLT stack element |
void xsltFreeStylesheet (xsltStylesheetPtr style)
Free up the memory allocated by @style
style: | an XSLT stylesheet |
int xsltInitAllDocKeys (xsltTransformContextPtr ctxt)
INTERNAL ROUTINE ONLY Check if any keys on the current document need to be computed
ctxt: | transformation context |
Returns: | 0 in case of success, -1 in case of failure |
int xsltInitCtxtKey (xsltTransformContextPtr ctxt,
xsltDocumentPtr idoc,
xsltKeyDefPtr keyDef)
Computes the key tables this key and for the current input document.
ctxt: | an XSLT transformation context |
idoc: | the document information (holds key values) |
keyDef: | the key definition |
Returns: | 0 on success, -1 on error |
int xsltIsBlank (xmlChar * str)
Check if a string is ignorable
str: | a string |
Returns: | 1 if the string is NULL or made of blanks chars, 0 otherwise |
xsltStylesheetPtr xsltLoadStylesheetPI (xmlDocPtr doc)
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 (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.
doc: | a document to process |
Returns: | a new XSLT stylesheet structure or NULL if not found. |
xsltStylesheetPtr xsltNewStylesheet (void)
Create a new XSLT Stylesheet
Returns: | the newly allocated xsltStylesheetPtr or NULL in case of error |
void xsltNumberFormat (xsltTransformContextPtr ctxt,
xsltNumberDataPtr data,
xmlNodePtr node)
Convert one number.
ctxt: | the XSLT transformation context |
data: | the formatting information |
node: | the data to format |
int xsltParseAnyXSLTElem (xsltCompilerCtxtPtr cctxt,
xmlNodePtr elem)
Parses, validates the content models and compiles XSLT instructions.
cctxt: | the compilation context |
elem: | the element node of the XSLT instruction |
Returns: | 0 if everything's fine; -1 on API or internal errors. |
void xsltParseSequenceConstructor (xsltCompilerCtxtPtr cctxt,
xmlNodePtr cur)
Parses a "template" content (or "sequence constructor" in XSLT 2.0 terms). This will additionally remove xsl:text elements from the tree.
cctxt: | the compilation context |
cur: | the start-node of the content to be parsed |
xsltStylesheetPtr xsltParseStylesheetDoc (xmlDocPtr doc)
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.
doc: | an xmlDoc parsed XML |
Returns: | a new XSLT stylesheet structure. |
xsltStylesheetPtr xsltParseStylesheetFile (const xmlChar * filename)
Load and parse an XSLT stylesheet
filename: | the filename/URL to the stylesheet |
Returns: | a new XSLT stylesheet structure. |
xsltStylesheetPtr xsltParseStylesheetImportedDoc (xmlDocPtr doc,
xsltStylesheetPtr parentStyle)
parse an XSLT stylesheet building the associated structures except the processing not needed for imported documents.
doc: | an xmlDoc parsed XML |
parentStyle: | pointer to the parent stylesheet (if it exists) |
Returns: | a new XSLT stylesheet structure. |
void xsltParseStylesheetOutput (xsltStylesheetPtr style,
xmlNodePtr cur)
parse an XSLT stylesheet output element and record information related to the stylesheet output
style: | the XSLT stylesheet |
cur: | the "output" element |
xsltStylesheetPtr xsltParseStylesheetProcess (xsltStylesheetPtr ret,
xmlDocPtr doc)
Parses an XSLT stylesheet, adding the associated structures. Called by: xsltParseStylesheetImportedDoc() (xslt.c) xsltParseStylesheetInclude() (imports.c)
ret: | the XSLT stylesheet (the current stylesheet-level) |
doc: | and xmlDoc parsed XML |
Returns: | the value of the @style parameter if everything went right, NULL if something went amiss. |
int xsltParseStylesheetUser (xsltStylesheetPtr style,
xmlDocPtr doc)
Parse an XSLT stylesheet with a user-provided stylesheet struct.
style: | pointer to the stylesheet |
doc: | an xmlDoc parsed XML |
Returns: | 0 if successful, -1 in case of error. |
void xsltParseTemplateContent (xsltStylesheetPtr style,
xmlNodePtr templ)
parse a template content-model Clean-up the template content from unwanted ignorable blank nodes and process xslt:text
style: | the XSLT stylesheet |
templ: | the container node (can be a document for literal results) |
int xsltPointerListAddSize (xsltPointerListPtr list,
void * item,
int initialSize)
Adds an item to the list.
list: | the pointer list structure |
item: | the item to be stored |
initialSize: | the initial size of the list |
Returns: | the position of the added item in the list or -1 in case of an error. |
void xsltPointerListClear (xsltPointerListPtr list)
Resets the list, but does not free the allocated array and does not free the content of the list.
list: | pointer to the list to be cleared |
xsltPointerListPtr xsltPointerListCreate (int initialSize)
Creates an xsltPointerList structure.
initialSize: | the initial size for the list |
Returns: | a xsltPointerList structure or NULL in case of an error. |
void xsltPointerListFree (xsltPointerListPtr list)
Frees the xsltPointerList structure. This does not free the content of the list.
list: | pointer to the list to be freed |
int xsltRegisterLocalRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT)
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.
ctxt: | an XSLT transformation context |
RVT: | a result value tree (Result Tree Fragment; xmlDocPtr) |
Returns: | 0 in case of success and -1 in case of API or internal errors. |
int xsltRegisterPersistRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT)
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.
ctxt: | an XSLT transformation context |
RVT: | a result value tree (Result Tree Fragment) |
Returns: | 0 in case of success and -1 in case of error. |
int xsltRegisterTmpRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT)
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.
ctxt: | an XSLT transformation context |
RVT: | a result value tree (Result Tree Fragment) |
Returns: | 0 in case of success and -1 in case of API or internal errors. |
void xsltReleaseRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT)
Either frees the RVT (which is an xmlDoc) or stores it in the context's cache for later reuse.
ctxt: | an XSLT transformation context |
RVT: | a result value tree (Result Tree Fragment) |
int xsltRestoreDocumentNamespaces (xsltNsMapPtr ns,
xmlDocPtr doc)
Restore the namespaces for the document
ns: | map of namespaces |
doc: | the document |
Returns: | 0 in case of success, -1 in case of failure |