xsltInternals

Name

xsltInternals -- 

Synopsis



enum        xsltElem;
struct      xsltStackElem;
typedef     xsltStackElemPtr;
#define     XSLT_PAT_NO_PRIORITY
struct      xsltTemplate;
typedef     xsltTemplatePtr;
struct      xsltStylesheet;
typedef     xsltStylesheetPtr;
enum        xsltOutputType;
struct      xsltTransformContext;
typedef     xsltTransformContextPtr;
xsltStylesheetPtr xsltParseStylesheetFile   (const xmlChar *filename);
void        xsltFreeStylesheet              (xsltStylesheetPtr sheet);
int         xsltIsBlank                     (xmlChar *str);
void        xsltFreeStackElemList           (xsltStackElemPtr elem);

Description

Details

enum xsltElem

typedef enum {
    XSLT_ELEM_VARIABLE=1,
    XSLT_ELEM_PARAM
} xsltElem;


struct xsltStackElem

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 */
};


xsltStackElemPtr

typedef xsltStackElem *xsltStackElemPtr;


XSLT_PAT_NO_PRIORITY

#define XSLT_PAT_NO_PRIORITY -12345789


struct xsltTemplate

struct xsltTemplate {
    struct _xsltTemplate *next;/* chained list sorted by priority */
    xmlChar *match;	/* the matching string */
    int 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 */
};


xsltTemplatePtr

typedef xsltTemplate *xsltTemplatePtr;


struct xsltStylesheet

struct xsltStylesheet {
    /*
     * The stylesheet import relation is kept as a tree
     */
    struct _xsltStylesheet *parent;
    struct _xsltStylesheet *imports;

    /*
     * 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 */

    /*
     * 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 *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() */
    
    /*
     * 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" */
    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 */
};


xsltStylesheetPtr

typedef xsltStylesheet *xsltStylesheetPtr;


enum xsltOutputType

typedef enum {
    XSLT_OUTPUT_XML = 0,
    XSLT_OUTPUT_HTML,
    XSLT_OUTPUT_TEXT
} xsltOutputType;


struct xsltTransformContext

struct xsltTransformContext {
    xsltStylesheetPtr style;		/* the stylesheet used */
    xsltOutputType type;		/* the type of output */

    xmlDocPtr doc;			/* the current doc */
    xmlNodePtr node;			/* the current node */
    xmlNodeSetPtr nodeList;		/* the current node list */

    xmlDocPtr output;			/* the resulting document */
    xmlNodePtr insert;			/* the insertion node */

    xmlXPathContextPtr xpathCtxt;	/* the XPath context */
    void *variablesHash;		/* hash table or wherever variables
				   	   informations are stored */
    xmlDocPtr extraDocs;		/* extra docs parsed by document() */
};


xsltTransformContextPtr

typedef xsltTransformContext *xsltTransformContextPtr;


xsltParseStylesheetFile ()

xsltStylesheetPtr xsltParseStylesheetFile   (const xmlChar *filename);

Load and parse an XSLT stylesheet

filename : the filename/URL to the stylesheet
Returns :a new XSLT stylesheet structure.


xsltFreeStylesheet ()

void        xsltFreeStylesheet              (xsltStylesheetPtr sheet);

Free up the memory allocated by sheet

sheet : an XSLT stylesheet


xsltIsBlank ()

int         xsltIsBlank                     (xmlChar *str);

str : a string
Returns :1 if the string is NULL or made of blanks chars, 0 otherwise


xsltFreeStackElemList ()

void        xsltFreeStackElemList           (xsltStackElemPtr elem);

Free up the memory allocated by elem

elem : an XSLT stack element