| Gnome XSLT Library Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
struct xsltStackElem {
struct _xsltStackElem *next;/* chained list */
xsltElem type; /* type of the element */
int computed; /* was the evaluation done */
xmlChar *name; /* the local part of the name QName */
xmlChar *nameURI; /* the URI part of the name QName */
xmlChar *select; /* the eval string */
xmlNodePtr tree; /* the tree if no eval string */
xmlXPathObjectPtr value; /* The value if computed */
}; |
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 */
xmlChar *name; /* the local part of the name QName */
xmlChar *nameURI; /* the URI part of the name QName */
xmlChar *mode; /* the local part of the mode QName */
xmlChar *modeURI; /* the URI part of the mode QName */
xmlNodePtr content; /* the template replacement value */
xmlNodePtr elem; /* the source element */
}; |
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 result */
xmlChar *decimalPoint;
xmlChar *grouping;
xmlChar *percent;
xmlChar *permille;
xmlChar *zeroDigit;
} xsltDecimalFormat, *xsltDecimalFormatPtr;
/*
* Data structure associated to a document
*/
typedef struct _xsltDocument xsltDocument;
typedef xsltDocument *xsltDocumentPtr;
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 xsltStylesheet {
/*
* The stylesheet import relation is kept as a tree
*/
struct _xsltStylesheet *parent;
struct _xsltStylesheet *next;
struct _xsltStylesheet *imports;
xsltDocumentPtr docList; /* the include document list */
/*
* General data on the style sheet document
*/
xmlDocPtr doc; /* the parsed XML stylesheet */
xmlHashTablePtr stripSpaces;/* the hash table of the strip-space
preserve space and cdata-section elements */
int stripAll; /* strip-space * (1) preserve-space * (-1) */
/*
* Global variable or parameters
*/
xsltStackElemPtr variables; /* linked list of param and variables */
/*
* Template descriptions
*/
xsltTemplatePtr templates; /* the ordered list of templates */
void *templatesHash; /* hash table or wherever compiled templates
informations are stored */
void *rootMatch; /* template based on / */
void *keyMatch; /* template based on key() */
void *elemMatch; /* template based on * */
void *attrMatch; /* template based on @* */
void *parentMatch; /* template based on .. */
void *textMatch; /* template based on text() */
void *piMatch; /* template based on processing-instruction() */
void *commentMatch; /* template based on comment() */
/*
* Namespace aliases
*/
xmlHashTablePtr nsAliases; /* the namespace alias hash tables */
/*
* Attribute sets
*/
xmlHashTablePtr attributeSets;/* the attribute sets hash tables */
/*
* Namespaces
*/
xmlHashTablePtr nsHash; /* the set of namespaces in use */
void *nsDefs; /* the namespaces defined */
/*
* Key definitions
*/
void *keys; /* key definitions */
/*
* Output related stuff.
*/
xmlChar *method; /* the output method */
xmlChar *methodURI; /* associated namespace if any */
xmlChar *version; /* version string */
xmlChar *encoding; /* encoding string */
int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */
/* 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; /* media-type string */
}; |
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 */
/*
* Precomputed blocks
*/
xsltStylePreCompPtr preComps; /* list of precomputed blocks */
/*
* Extensions
*/
xmlHashTablePtr extFunctions; /* the extension functions */
xmlHashTablePtr extElements; /* the extension elements */
const xmlChar *mode; /* the current mode */
const xmlChar *modeURI; /* the current mode URI */
xsltDocumentPtr docList; /* the document list */
xsltDocumentPtr document; /* the current document */
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; /* the current state */
}; |
struct xsltStylePreComp {
struct _xsltStylePreComp *next;/* chained list */
xsltStyleType type; /* type of the element */
xsltTransformFunction func; /* handling function */
xmlNodePtr inst; /* the instruction */
/*
* Pre computed values
*/
xmlChar *stype; /* sort */
int has_stype; /* sort */
int number; /* sort */
xmlChar *order; /* sort */
int has_order; /* sort */
int descending; /* sort */
xmlChar *use; /* copy, element */
int has_use; /* copy, element */
int noescape; /* text */
xmlChar *name; /* element, attribute, pi */
int has_name; /* element, attribute, pi */
xmlChar *ns; /* element */
int has_ns; /* element */
xmlChar *mode; /* apply-templates */
xmlChar *modeURI; /* apply-templates */
xmlChar *test; /* if */
xsltTemplatePtr templ; /* call-template */
xmlChar *select; /* sort, copy-of, value-of, apply-templates */
int ver11; /* document */
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 */
}; |
void (*xsltTransformFunction) (xsltTransformContextPtr ctxt, |
| ctxt: | |
| node: | |
| inst: | |
| comp: |
typedef enum {
XSLT_FUNC_COPY=1,
XSLT_FUNC_SORT,
XSLT_FUNC_TEXT,
XSLT_FUNC_ELEMENT,
XSLT_FUNC_ATTRIBUTE,
XSLT_FUNC_COMMENT,
XSLT_FUNC_PI,
XSLT_FUNC_COPYOF,
XSLT_FUNC_VALUEOF,
XSLT_FUNC_NUMBER,
XSLT_FUNC_APPLYIMPORTS,
XSLT_FUNC_CALLTEMPLATE,
XSLT_FUNC_APPLYTEMPLATES,
XSLT_FUNC_CHOOSE,
XSLT_FUNC_IF,
XSLT_FUNC_FOREACH,
XSLT_FUNC_DOCUMENT
} xsltStyleType; |
typedef enum {
XSLT_OUTPUT_XML = 0,
XSLT_OUTPUT_HTML,
XSLT_OUTPUT_TEXT
} xsltOutputType; |
typedef enum {
XSLT_STATE_OK = 0,
XSLT_STATE_ERROR,
XSLT_STATE_STOPPED
} xsltTransformState; |
xsltStylesheetPtr xsltNewStylesheet (void); |
Create a new XSLT Stylesheet
| Returns : | the newly allocated xsltStylesheetPtr or NULL in case of error |
xsltStylesheetPtr xsltParseStylesheetFile (const |
Load and parse an XSLT stylesheet
| filename: | the filename/URL to the stylesheet |
| Returns : | a new XSLT stylesheet structure. |
void xsltFreeStylesheet (xsltStylesheetPtr sheet); |
Free up the memory allocated by sheet
| sheet: | an XSLT stylesheet |
int xsltIsBlank ( |
| str: | a string |
| Returns : | 1 if the string is NULL or made of blanks chars, 0 otherwise |
void xsltFreeStackElemList (xsltStackElemPtr elem); |
Free up the memory allocated by elem
| elem: | an XSLT stack element |
|
Find decimal-format by name
| sheet: | the XSLT stylesheet |
| name: | the decimal-format name to find |
| Returns : |
xsltStylesheetPtr xsltParseStylesheetProcess (xsltStylesheetPtr ret, |
parse an XSLT stylesheet adding the associated structures
| ret: | the XSLT stylesheet |
| doc: | and xmlDoc parsed XML |
| Returns : | a new XSLT stylesheet structure. |
void xsltParseStylesheetOutput (xsltStylesheetPtr style, |
parse an XSLT stylesheet output element and record information related to the stylesheet output
| style: | the XSLT stylesheet |
| cur: |
xsltStylesheetPtr xsltParseStylesheetDoc ( |
parse an XSLT stylesheet building the associated structures
| doc: | and xmlDoc parsed XML |
| Returns : | a new XSLT stylesheet structure. |
void xsltNumberFormat (xsltTransformContextPtr ctxt, |
| ctxt: | |
| data: | |
| node: |