codekingpro/portable-devtools
114k
1/*2 * Summary: interface for the document handling3 * Description: implements document loading and cache (multiple4 * document() reference for the same resources must5 * be equal.6 *7 * Copy: See Copyright for the status of this software.8 *9 * Author: Daniel Veillard10 */11 12#ifndef __XML_XSLT_DOCUMENTS_H__13#define __XML_XSLT_DOCUMENTS_H__14 15#include <libxml/tree.h>16#include "xsltexports.h"17#include "xsltInternals.h"18 19#ifdef __cplusplus20extern "C" {21#endif22 23XSLTPUBFUN xsltDocumentPtr XSLTCALL24 xsltNewDocument (xsltTransformContextPtr ctxt,25 xmlDocPtr doc);26XSLTPUBFUN xsltDocumentPtr XSLTCALL27 xsltLoadDocument (xsltTransformContextPtr ctxt,28 const xmlChar *URI);29XSLTPUBFUN xsltDocumentPtr XSLTCALL30 xsltFindDocument (xsltTransformContextPtr ctxt,31 xmlDocPtr doc);32XSLTPUBFUN void XSLTCALL33 xsltFreeDocuments (xsltTransformContextPtr ctxt);34 35XSLTPUBFUN xsltDocumentPtr XSLTCALL36 xsltLoadStyleDocument (xsltStylesheetPtr style,37 const xmlChar *URI);38XSLTPUBFUN xsltDocumentPtr XSLTCALL39 xsltNewStyleDocument (xsltStylesheetPtr style,40 xmlDocPtr doc);41XSLTPUBFUN void XSLTCALL42 xsltFreeStyleDocuments (xsltStylesheetPtr style);43 44/*45 * Hooks for document loading46 */47 48/**49 * xsltLoadType:50 *51 * Enum defining the kind of loader requirement.52 */53typedef enum {54 XSLT_LOAD_START = 0, /* loading for a top stylesheet */55 XSLT_LOAD_STYLESHEET = 1, /* loading for a stylesheet include/import */56 XSLT_LOAD_DOCUMENT = 2 /* loading document at transformation time */57} xsltLoadType;58 59/**60 * xsltDocLoaderFunc:61 * @URI: the URI of the document to load62 * @dict: the dictionary to use when parsing that document63 * @options: parsing options, a set of xmlParserOption64 * @ctxt: the context, either a stylesheet or a transformation context65 * @type: the xsltLoadType indicating the kind of loading required66 *67 * An xsltDocLoaderFunc is a signature for a function which can be68 * registered to load document not provided by the compilation or69 * transformation API themselve, for example when an xsl:import,70 * xsl:include is found at compilation time or when a document()71 * call is made at runtime.72 *73 * Returns the pointer to the document (which will be modified and74 * freed by the engine later), or NULL in case of error.75 */76typedef xmlDocPtr (*xsltDocLoaderFunc) (const xmlChar *URI,77 xmlDictPtr dict,78 int options,79 void *ctxt,80 xsltLoadType type);81 82XSLTPUBFUN void XSLTCALL83 xsltSetLoaderFunc (xsltDocLoaderFunc f);84 85/* the loader may be needed by extension libraries so it is exported */86XSLTPUBVAR xsltDocLoaderFunc xsltDocDefaultLoader;87 88#ifdef __cplusplus89}90#endif91 92#endif /* __XML_XSLT_DOCUMENTS_H__ */93 94 