Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:44:21

0001 /*
0002  * Summary: interface for the document handling
0003  * Description: implements document loading and cache (multiple
0004  *              document() reference for the same resources must
0005  *              be equal.
0006  *
0007  * Copy: See Copyright for the status of this software.
0008  *
0009  * Author: Daniel Veillard
0010  */
0011 
0012 #ifndef __XML_XSLT_DOCUMENTS_H__
0013 #define __XML_XSLT_DOCUMENTS_H__
0014 
0015 #include <libxml/tree.h>
0016 #include "xsltexports.h"
0017 #include "xsltInternals.h"
0018 
0019 #ifdef __cplusplus
0020 extern "C" {
0021 #endif
0022 
0023 XSLTPUBFUN xsltDocumentPtr XSLTCALL
0024         xsltNewDocument     (xsltTransformContextPtr ctxt,
0025                      xmlDocPtr doc);
0026 XSLTPUBFUN xsltDocumentPtr XSLTCALL
0027         xsltLoadDocument    (xsltTransformContextPtr ctxt,
0028                      const xmlChar *URI);
0029 XSLTPUBFUN xsltDocumentPtr XSLTCALL
0030         xsltFindDocument    (xsltTransformContextPtr ctxt,
0031                      xmlDocPtr doc);
0032 XSLTPUBFUN void XSLTCALL
0033         xsltFreeDocuments   (xsltTransformContextPtr ctxt);
0034 
0035 XSLTPUBFUN xsltDocumentPtr XSLTCALL
0036         xsltLoadStyleDocument   (xsltStylesheetPtr style,
0037                      const xmlChar *URI);
0038 XSLTPUBFUN xsltDocumentPtr XSLTCALL
0039         xsltNewStyleDocument    (xsltStylesheetPtr style,
0040                      xmlDocPtr doc);
0041 XSLTPUBFUN void XSLTCALL
0042         xsltFreeStyleDocuments  (xsltStylesheetPtr style);
0043 
0044 /*
0045  * Hooks for document loading
0046  */
0047 
0048 /**
0049  * xsltLoadType:
0050  *
0051  * Enum defining the kind of loader requirement.
0052  */
0053 typedef enum {
0054     XSLT_LOAD_START = 0,    /* loading for a top stylesheet */
0055     XSLT_LOAD_STYLESHEET = 1,   /* loading for a stylesheet include/import */
0056     XSLT_LOAD_DOCUMENT = 2  /* loading document at transformation time */
0057 } xsltLoadType;
0058 
0059 /**
0060  * xsltDocLoaderFunc:
0061  * @URI: the URI of the document to load
0062  * @dict: the dictionary to use when parsing that document
0063  * @options: parsing options, a set of xmlParserOption
0064  * @ctxt: the context, either a stylesheet or a transformation context
0065  * @type: the xsltLoadType indicating the kind of loading required
0066  *
0067  * An xsltDocLoaderFunc is a signature for a function which can be
0068  * registered to load document not provided by the compilation or
0069  * transformation API themselve, for example when an xsl:import,
0070  * xsl:include is found at compilation time or when a document()
0071  * call is made at runtime.
0072  *
0073  * Returns the pointer to the document (which will be modified and
0074  * freed by the engine later), or NULL in case of error.
0075  */
0076 typedef xmlDocPtr (*xsltDocLoaderFunc)      (const xmlChar *URI,
0077                          xmlDictPtr dict,
0078                          int options,
0079                          void *ctxt,
0080                          xsltLoadType type);
0081 
0082 XSLTPUBFUN void XSLTCALL
0083         xsltSetLoaderFunc       (xsltDocLoaderFunc f);
0084 
0085 /* the loader may be needed by extension libraries so it is exported */
0086 XSLTPUBVAR xsltDocLoaderFunc xsltDocDefaultLoader;
0087 
0088 #ifdef __cplusplus
0089 }
0090 #endif
0091 
0092 #endif /* __XML_XSLT_DOCUMENTS_H__ */
0093