Gnome XSLT Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# xsltutils

## Name

xsltutils --

## Synopsis

    #define     XSLT_TODO
    #define     XSLT_STRANGE
    #define     IS_XSLT_ELEM                    (n)
    #define     IS_XSLT_NAME                    (n, val)
    #define     IS_XSLT_REAL_NODE               (n)
    xmlChar*    xsltGetNsProp                   (xmlNodePtr node,
                                                 const xmlChar *name,
                                                 const xmlChar *nameSpace);
    void        xsltPrintErrorContext           (xsltTransformContextPtr ctxt,
                                                 xsltStylesheetPtr style,
                                                 xmlNodePtr node);
    void        xsltMessage                     (xsltTransformContextPtr ctxt,
                                                 xmlNodePtr node,
                                                 xmlNodePtr inst);
    void        xsltSetGenericErrorFunc         (void *ctx,
                                                 xmlGenericErrorFunc handler);
    void        xsltSetGenericDebugFunc         (void *ctx,
                                                 xmlGenericErrorFunc handler);
    void        xsltDocumentSortFunction        (xmlNodeSetPtr list);
    void        xsltDoSortFunction              (xsltTransformContextPtr ctxt,
                                                 xmlNodePtr *sorts,
                                                 int nbsorts);
    const xmlChar* xsltGetQNameURI              (xmlNodePtr node,
                                                 xmlChar **name);
    int         xsltSaveResultTo                (xmlOutputBufferPtr buf,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style);
    int         xsltSaveResultToFilename        (const char *URI,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style,
                                                 int compression);
    int         xsltSaveResultToFile            (FILE *file,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style);
    int         xsltSaveResultToFd              (int fd,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style);
    void        xsltSaveProfiling               (xsltTransformContextPtr ctxt,
                                                 FILE *output);
    long        xsltTimestamp                   (void);
    void        xsltCalibrateAdjust             (long delta);
    #define     XSLT_TIMESTAMP_TICS_PER_SEC
    enum        xsltDebugStatusCodes;
    void        (*xsltHandleDebuggerCallback)   (xmlNodePtr cur,
                                                 xmlNodePtr node,
                                                 xsltTemplatePtr templ,
                                                 xsltTransformContextPtr ctxt);
    int         (*xsltAddCallCallback)          (xsltTemplatePtr templ,
                                                 xmlNodePtr source);
    void        (*xsltDropCallCallback)         (void);
    int         xsltSetDebuggerCallbacks        (int no,
                                                 void *block);
    int         xslAddCall                      (xsltTemplatePtr templ,
                                                 xmlNodePtr source);
    void        xslDropCall                     ();

## Description

## Details

### XSLT_TODO

    #define     XSLT_TODO

### XSLT_STRANGE

    #define     XSLT_STRANGE

### IS_XSLT_ELEM()

    #define     IS_XSLT_ELEM(n)

Checks that the element pertains to XSLt namespace

`n` : |

### IS_XSLT_NAME()

    #define     IS_XSLT_NAME(n, val)

Checks the value of an element in XSLT namespace

`n` : |
`val` : |

### IS_XSLT_REAL_NODE()

    #define     IS_XSLT_REAL_NODE(n)

check that a node is a 'real' one: document, element, text or attribute

`n` : |

### xsltGetNsProp ()

    xmlChar*    xsltGetNsProp                   (xmlNodePtr node,
                                                 const xmlChar *name,
                                                 const xmlChar *nameSpace);

Similar to xmlGetNsProp() but with a slightly different semantic

Search and get the value of an attribute associated to a node This attribute has to be anchored in the namespace specified, or has no namespace and the element is in that namespace.

This does the entity substitution. This function looks in DTD attribute declaration for FIXED or default declaration values unless DTD use has been turned off.

`node` : | the node
`name` : | the attribute name
`nameSpace` : | the URI of the namespace
Returns : | the attribute value or NULL if not found. It's up to the caller to free the memory.

### xsltPrintErrorContext ()

    void        xsltPrintErrorContext           (xsltTransformContextPtr ctxt,
                                                 xsltStylesheetPtr style,
                                                 xmlNodePtr node);

Display the context of an error.

`ctxt` : | the transformation context
`style` : | the stylesheet
`node` : | the current node being processed

### xsltMessage ()

    void        xsltMessage                     (xsltTransformContextPtr ctxt,
                                                 xmlNodePtr node,
                                                 xmlNodePtr inst);

Process and xsl:message construct

`ctxt` : | an XSLT processing context
`node` : | The current node
`inst` : | The node containing the message instruction

### xsltSetGenericErrorFunc ()

    void        xsltSetGenericErrorFunc         (void *ctx,
                                                 xmlGenericErrorFunc handler);

Function to reset the handler and the error context for out of context error messages. This simply means that `handler` will be called for subsequent error messages while not parsing nor validating. And `ctx` will be passed as first argument to `handler` One can simply force messages to be emitted to another FILE * than stderr by setting `ctx` to this file handle and `handler` to NULL.

`ctx` : | the new error handling context
`handler` : | the new handler function

### xsltSetGenericDebugFunc ()

    void        xsltSetGenericDebugFunc         (void *ctx,
                                                 xmlGenericErrorFunc handler);

Function to reset the handler and the error context for out of context error messages. This simply means that `handler` will be called for subsequent error messages while not parsing or validating. And `ctx` will be passed as first argument to `handler` One can simply force messages to be emitted to another FILE * than stderr by setting `ctx` to this file handle and `handler` to NULL.

`ctx` : | the new error handling context
`handler` : | the new handler function

### xsltDocumentSortFunction ()

    void        xsltDocumentSortFunction        (xmlNodeSetPtr list);

reorder the current node list `list` accordingly to the document order

`list` : | the node set

### xsltDoSortFunction ()

    void        xsltDoSortFunction              (xsltTransformContextPtr ctxt,
                                                 xmlNodePtr *sorts,
                                                 int nbsorts);

reorder the current node list accordingly to the set of sorting requirement provided by the arry of nodes.

`ctxt` : | a XSLT process context
`sorts` : | array of sort nodes
`nbsorts` : | the number of sorts in the array

### xsltGetQNameURI ()

    const xmlChar* xsltGetQNameURI              (xmlNodePtr node,
                                                 xmlChar **name);

This function analyzes `name`, if the name contains a prefix, the function seaches the associated namespace in scope for it. It will also replace `name` value with the NCName, the old value being freed. Errors in the prefix lookup are signalled by setting `name` to NULL.

NOTE: the namespace returned is a pointer to the place where it is defined and hence has the same lifespan as the document holding it.

`node` : | the node holding the QName
`name` : | pointer to the initial QName value
Returns : | the namespace URI if there is a prefix, or NULL if `name` is not prefixed.

### xsltSaveResultTo ()

    int         xsltSaveResultTo                (xmlOutputBufferPtr buf,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style);

Save the result `result` obtained by applying the `style` stylesheet to an I/O output channel `buf`

`buf` : | an output buffer
`result` : | the result xmlDocPtr
`style` : | the stylesheet
Returns : | the number of byte written or -1 in case of failure.

### xsltSaveResultToFilename ()

    int         xsltSaveResultToFilename        (const char *URI,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style,
                                                 int compression);

Save the result `result` obtained by applying the `style` stylesheet to a file or URL `URL`

`URI` : |
`result` : | the result xmlDocPtr
`style` : | the stylesheet
`compression` : | the compression factor (0 - 9 included)
Returns : | the number of byte written or -1 in case of failure.

### xsltSaveResultToFile ()

    int         xsltSaveResultToFile            (FILE *file,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style);

Save the result `result` obtained by applying the `style` stylesheet to an open FILE * I/O. This does not close the FILE `file`

`file` : | a FILE * I/O
`result` : | the result xmlDocPtr
`style` : | the stylesheet
Returns : | the number of bytes written or -1 in case of failure.

### xsltSaveResultToFd ()

    int         xsltSaveResultToFd              (int fd,
                                                 xmlDocPtr result,
                                                 xsltStylesheetPtr style);

Save the result `result` obtained by applying the `style` stylesheet to an open file descriptor This does not close the descriptor.

`fd` : | a file descriptor
`result` : | the result xmlDocPtr
`style` : | the stylesheet
Returns : | the number of bytes written or -1 in case of failure.

### xsltSaveProfiling ()

    void        xsltSaveProfiling               (xsltTransformContextPtr ctxt,
                                                 FILE *output);

Save the profiling informations on `output`

`ctxt` : | an XSLT context
`output` : | a FILE * for saving the informations

### xsltTimestamp ()

    long        xsltTimestamp                   (void);

Used for gathering profiling data

Returns : | the number of tenth of milliseconds since the beginning of the profiling

### xsltCalibrateAdjust ()

    void        xsltCalibrateAdjust             (long delta);

Used for to correct the calibration for xsltTimestamp()

`delta` : | a negative dealy value found

### XSLT_TIMESTAMP_TICS_PER_SEC

    #define XSLT_TIMESTAMP_TICS_PER_SEC 100000l

### enum xsltDebugStatusCodes

    typedef enum {
        XSLT_DEBUG_NONE = 0, /* no debugging allowed */
        XSLT_DEBUG_INIT,
        XSLT_DEBUG_STEP,
        XSLT_DEBUG_STEPOUT,
        XSLT_DEBUG_NEXT,
        XSLT_DEBUG_STOP,
        XSLT_DEBUG_CONT,
        XSLT_DEBUG_RUN,
        XSLT_DEBUG_RUN_RESTART,
        XSLT_DEBUG_QUIT
    } xsltDebugStatusCodes;

### xsltHandleDebuggerCallback ()

    void        (*xsltHandleDebuggerCallback)   (xmlNodePtr cur,
                                                 xmlNodePtr node,
                                                 xsltTemplatePtr templ,
                                                 xsltTransformContextPtr ctxt);

`cur` : |
`node` : |
`templ` : |
`ctxt` : |

### xsltAddCallCallback ()

    int         (*xsltAddCallCallback)          (xsltTemplatePtr templ,
                                                 xmlNodePtr source);

`templ` : |
`source` : |
Returns : |

### xsltDropCallCallback ()

    void        (*xsltDropCallCallback)         (void);

### xsltSetDebuggerCallbacks ()

    int         xsltSetDebuggerCallbacks        (int no,
                                                 void *block);

`no` : |
`block` : |
Returns : |

### xslAddCall ()

    int         xslAddCall                      (xsltTemplatePtr templ,
                                                 xmlNodePtr source);

DEPRECATED

`templ` : |
`source` : |
Returns : |

### xslDropCall ()

    void        xslDropCall                     ();

DEPRECATED

<<< Previous Page | Home | Up | Next Page >>>
transform | attributes