/*1* Summary: interface for the document handling2* Description: implements document loading and cache (multiple3* document() reference for the same resources must4* be equal.5*6* Copy: See Copyright for the status of this software.7*8* Author: Daniel Veillard9*/1011#ifndef __XML_XSLT_DOCUMENTS_H__12#define __XML_XSLT_DOCUMENTS_H__1314#include <libxml/tree.h>15#include "xsltexports.h"16#include "xsltInternals.h"1718#ifdef __cplusplus19extern "C" {20#endif2122XSLTPUBFUN xsltDocumentPtr XSLTCALL23xsltNewDocument (xsltTransformContextPtr ctxt,24xmlDocPtr doc);25XSLTPUBFUN xsltDocumentPtr XSLTCALL26xsltLoadDocument (xsltTransformContextPtr ctxt,27const xmlChar *URI);28XSLTPUBFUN xsltDocumentPtr XSLTCALL29xsltFindDocument (xsltTransformContextPtr ctxt,30xmlDocPtr doc);31XSLTPUBFUN void XSLTCALL32xsltFreeDocuments (xsltTransformContextPtr ctxt);3334XSLTPUBFUN xsltDocumentPtr XSLTCALL35xsltLoadStyleDocument (xsltStylesheetPtr style,36const xmlChar *URI);37XSLTPUBFUN xsltDocumentPtr XSLTCALL38xsltNewStyleDocument (xsltStylesheetPtr style,39xmlDocPtr doc);40XSLTPUBFUN void XSLTCALL41xsltFreeStyleDocuments (xsltStylesheetPtr style);4243/*44* Hooks for document loading45*/4647/**48* xsltLoadType:49*50* Enum defining the kind of loader requirement.51*/52typedef enum {53XSLT_LOAD_START = 0, /* loading for a top stylesheet */54XSLT_LOAD_STYLESHEET = 1, /* loading for a stylesheet include/import */55XSLT_LOAD_DOCUMENT = 2 /* loading document at transformation time */56} xsltLoadType;5758/**59* xsltDocLoaderFunc:60* @URI: the URI of the document to load61* @dict: the dictionary to use when parsing that document62* @options: parsing options, a set of xmlParserOption63* @ctxt: the context, either a stylesheet or a transformation context64* @type: the xsltLoadType indicating the kind of loading required65*66* An xsltDocLoaderFunc is a signature for a function which can be67* registered to load document not provided by the compilation or68* transformation API themselve, for example when an xsl:import,69* xsl:include is found at compilation time or when a document()70* call is made at runtime.71*72* Returns the pointer to the document (which will be modified and73* freed by the engine later), or NULL in case of error.74*/75typedef xmlDocPtr (*xsltDocLoaderFunc) (const xmlChar *URI,76xmlDictPtr dict,77int options,78void *ctxt,79xsltLoadType type);8081XSLTPUBFUN void XSLTCALL82xsltSetLoaderFunc (xsltDocLoaderFunc f);8384/* the loader may be needed by extension libraries so it is exported */85XSLTPUBVAR xsltDocLoaderFunc xsltDocDefaultLoader;8687#ifdef __cplusplus88}89#endif9091#endif /* __XML_XSLT_DOCUMENTS_H__ */92939495