/* * imports.c: Implementation of the XSLT imports * * Reference: * http://www.w3.org/TR/1999/REC-xslt-19991116 * * See Copyright for the status of this software. * * [email protected] */ #define IN_LIBXSLT #include "libxslt.h" #include <string.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> #include <libxml/hash.h> #include <libxml/xmlerror.h> #include <libxml/uri.h> #include "xslt.h" #include "xsltInternals.h" #include "xsltutils.h" #include "preproc.h" #include "imports.h" #include "documents.h" #include "security.h" #include "pattern.h" /************************************************************************ * * * Module interfaces * * * ************************************************************************/ /** * xsltFixImportedCompSteps: * @master: the "master" stylesheet * @style: the stylesheet being imported by the master * * normalize the comp steps for the stylesheet being imported * by the master, together with any imports within that. * */ static void xsltFixImportedCompSteps(xsltStylesheetPtr master, xsltStylesheetPtr style) { … } #define XSLT_MAX_NESTING … static int xsltCheckCycle(xsltStylesheetPtr style, xmlNodePtr cur, const xmlChar *URI) { … } /** * xsltParseStylesheetImport: * @style: the XSLT stylesheet * @cur: the import element * * parse an XSLT stylesheet import element * * Returns 0 in case of success -1 in case of failure. */ int xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) { … } /** * xsltParseStylesheetInclude: * @style: the XSLT stylesheet * @cur: the include node * * parse an XSLT stylesheet include element * * Returns 0 in case of success -1 in case of failure */ int xsltParseStylesheetInclude(xsltStylesheetPtr style, xmlNodePtr cur) { … } /** * xsltNextImport: * @cur: the current XSLT stylesheet * * Find the next stylesheet in import precedence. * * Returns the next stylesheet or NULL if it was the last one */ xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur) { … } /** * xsltNeedElemSpaceHandling: * @ctxt: an XSLT transformation context * * Checks whether that stylesheet requires white-space stripping * * Returns 1 if space should be stripped, 0 if not */ int xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt) { … } /** * xsltFindElemSpaceHandling: * @ctxt: an XSLT transformation context * @node: an XML node * * Find strip-space or preserve-space information for an element * respect the import precedence or the wildcards * * Returns 1 if space should be stripped, 0 if not, and 2 if everything * should be CDTATA wrapped. */ int xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, xmlNodePtr node) { … } /** * xsltFindTemplate: * @ctxt: an XSLT transformation context * @name: the template name * @nameURI: the template name URI * * Finds the named template, apply import precedence rule. * REVISIT TODO: We'll change the nameURI fields of * templates to be in the string dict, so if the * specified @nameURI is in the same dict, then use pointer * comparison. Check if this can be done in a sane way. * Maybe this function is not needed internally at * transformation-time if we hard-wire the called templates * to the caller. * * Returns the xsltTemplatePtr or NULL if not found */ xsltTemplatePtr xsltFindTemplate(xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI) { … }