Commit c638618c authored by Alexandre Julliard's avatar Alexandre Julliard

libs: Import code from upstream libxslt 1.1.34.

parent 9d9d4fcc
......@@ -701,6 +701,8 @@ XMKMF
PTHREAD_LIBS
ZLIB_PE_LIBS
ZLIB_PE_CFLAGS
XSLT_PE_LIBS
XSLT_PE_CFLAGS
XML2_PE_LIBS
XML2_PE_CFLAGS
TIFF_PE_LIBS
......@@ -1796,6 +1798,7 @@ enable_wbemuuid
enable_wine
enable_wmcodecdspuuid
enable_xml2
enable_xslt
enable_zlib
enable_loader
enable_nls
......@@ -1937,6 +1940,8 @@ TIFF_PE_CFLAGS
TIFF_PE_LIBS
XML2_PE_CFLAGS
XML2_PE_LIBS
XSLT_PE_CFLAGS
XSLT_PE_LIBS
ZLIB_PE_CFLAGS
ZLIB_PE_LIBS
XMKMF
......@@ -2735,6 +2740,11 @@ Some influential environment variables:
version
XML2_PE_LIBS
Linker flags for the PE libxml2, overriding the bundled version
XSLT_PE_CFLAGS
C compiler flags for the PE libxslt, overriding the bundled
version
XSLT_PE_LIBS
Linker flags for the PE libxslt, overriding the bundled version
ZLIB_PE_CFLAGS
C compiler flags for the PE zlib, overriding the bundled version
ZLIB_PE_LIBS
......@@ -10777,6 +10787,19 @@ fi
$as_echo "$as_me:${as_lineno-$LINENO}: libxml2 cflags: $XML2_PE_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: libxml2 libs: $XML2_PE_LIBS" >&5
if ${XSLT_PE_CFLAGS:+false} :; then :
XSLT_PE_CFLAGS="-I\$(top_srcdir)/libs/xslt"
else
enable_libxslt=no
fi
if ${XSLT_PE_LIBS:+false} :; then :
XSLT_PE_LIBS=xslt
else
enable_libxslt=no
fi
$as_echo "$as_me:${as_lineno-$LINENO}: libxslt cflags: $XSLT_PE_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: libxslt libs: $XSLT_PE_LIBS" >&5
if ${ZLIB_PE_CFLAGS:+false} :; then :
ZLIB_PE_CFLAGS="-I\$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO"
else
......@@ -19432,6 +19455,8 @@ TIFF_PE_CFLAGS = $TIFF_PE_CFLAGS
TIFF_PE_LIBS = $TIFF_PE_LIBS
XML2_PE_CFLAGS = $XML2_PE_CFLAGS
XML2_PE_LIBS = $XML2_PE_LIBS
XSLT_PE_CFLAGS = $XSLT_PE_CFLAGS
XSLT_PE_LIBS = $XSLT_PE_LIBS
ZLIB_PE_CFLAGS = $ZLIB_PE_CFLAGS
ZLIB_PE_LIBS = $ZLIB_PE_LIBS
PTHREAD_LIBS = $PTHREAD_LIBS
......@@ -20731,6 +20756,7 @@ wine_fn_config_makefile libs/wbemuuid enable_wbemuuid
wine_fn_config_makefile libs/wine enable_wine
wine_fn_config_makefile libs/wmcodecdspuuid enable_wmcodecdspuuid
wine_fn_config_makefile libs/xml2 enable_xml2
wine_fn_config_makefile libs/xslt enable_xslt
wine_fn_config_makefile libs/zlib enable_zlib
wine_fn_config_makefile loader enable_loader
wine_fn_config_makefile nls enable_nls
......
......@@ -1065,6 +1065,7 @@ WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I\$(top_srcdir)/libs/lcms2/include")
WINE_EXTLIB_FLAGS(PNG, png, "png \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/png")
WINE_EXTLIB_FLAGS(TIFF, tiff, tiff, "-I\$(top_srcdir)/libs/tiff/libtiff")
WINE_EXTLIB_FLAGS(XML2, libxml2, xml2, "-I\$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC")
WINE_EXTLIB_FLAGS(XSLT, libxslt, xslt, "-I\$(top_srcdir)/libs/xslt")
WINE_EXTLIB_FLAGS(ZLIB, zlib, z, "-I\$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO")
dnl **** Check for pthread ****
......@@ -3775,6 +3776,7 @@ WINE_CONFIG_MAKEFILE(libs/wbemuuid)
WINE_CONFIG_MAKEFILE(libs/wine)
WINE_CONFIG_MAKEFILE(libs/wmcodecdspuuid)
WINE_CONFIG_MAKEFILE(libs/xml2)
WINE_CONFIG_MAKEFILE(libs/xslt)
WINE_CONFIG_MAKEFILE(libs/zlib)
WINE_CONFIG_MAKEFILE(loader)
WINE_CONFIG_MAKEFILE(nls)
......
Daniel Veillard:
daniel@veillard.com
DV on #gnome IRC channel
http://veillard.com/
Used to work at W3C, now Red Hat
co-chair of W3C XML Linking WG
invited expert on the W3C XML Core WG
Author of libxml2 upon which this library is based.
Bjorn Reese:
breese@users.sourceforge.net
http://home1.stofanet.dk/breese/
Software developer at http://www.systematic.dk/
Member of the XML-MTF Mapping WG.
William Brack <wbrack@mmm.com.hk>
Thomas Broyer <tbroyer@ltgt.net>
Igor Zlatkovic <igor@zlatkovic.com> for the Windows port
Patches gently provided by a multitude of people :
Abhishek Arya <inferno@chromium.org>
Ben Walton <bwalton@artsci.utoronto.ca>
Bjorn Reese <breese@src.gnome.org>
C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Colin Walters <walters@verbum.org>
Daniel Mustieles <daniel.mustieles@gmail.com>
Daniel Richard G <oss@teragram.com>
Darin Adler <darin@src.gnome.org>
ÉRDI Gergo <cactus@src.gnome.org>
Fatih Demir <kabalak@src.gnome.org>
Federico Mena Quintero <federico@ximian.com>
Frederic Crozat <fcrozat@mandriva.com>
Hao Hu <ihaohu@gmail.com>
Havoc Pennington <hp@pobox.com>
IlyaS <astro.courier@gmail.com>
jacob berkman <jacob@ximian.com>
Jason Viers <bean@beanalby.net>
Jérôme Carretero <cJ-xslt@zougloub.eu>
Joachim Breitner <nomeata@debian.org>
Johan Dahlin <zilch@src.gnome.org>
John Fleck <jfleck@inkstain.net>
Jose Maria Celorio <chema@src.gnome.org>
Julio M. Merino Vidal <jmmv@NetBSD.org>
Kasimier T. Buchcik <kbuchcik@src.gnome.org>
Kjartan Maraas <kmaraas@src.gnome.org>
Laurence Rowe <l@lrowe.co.uk>
Malcolm Purvis <malcolm@purvis.id.au>
Martin <gzlist@googlemail.com>
Michael Bonfils <murlock42@gmail.com>
Mike Hommey <mh@glandium.org>
money_seshu Dronamraju <mcseshu@gmail.com>
Nick Wellnhofer <wellnhofer@aevum.de>
Nix <nix@esperi.org.uk>
Pedro F. Giffuni <giffunip@tutopia.com>
Peter Williams <peterw@ximian.com>
Rob Richards <rrichard@src.gnome.org>
Roumen Petrov <bugtrack@roumenpetrov.info>
Stefan Kost <ensonic@users.sf.net>
Tomasz Kłoczko <kloczek@src.gnome.org>
Chris Evans <cevans@chromium.org>
Licence for libxslt except libexslt
----------------------------------------------------------------------
Copyright (C) 2001-2002 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Daniel Veillard shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from him.
----------------------------------------------------------------------
Licence for libexslt
----------------------------------------------------------------------
Copyright (C) 2001-2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the authors shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from him.
----------------------------------------------------------------------
EXTLIB = libxslt.a
EXTRAINCL = $(XML2_PE_CFLAGS)
C_SRCS = \
libxslt/attributes.c \
libxslt/attrvt.c \
libxslt/documents.c \
libxslt/extensions.c \
libxslt/extra.c \
libxslt/functions.c \
libxslt/imports.c \
libxslt/keys.c \
libxslt/namespaces.c \
libxslt/numbers.c \
libxslt/pattern.c \
libxslt/preproc.c \
libxslt/security.c \
libxslt/templates.c \
libxslt/transform.c \
libxslt/variables.c \
libxslt/xslt.c \
libxslt/xsltlocale.c \
libxslt/xsltutils.c
/*
* Summary: interface for the XSLT attribute handling
* Description: this module handles the specificities of attribute
* and attribute groups processing.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_ATTRIBUTES_H__
#define __XML_XSLT_ATTRIBUTES_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#ifdef __cplusplus
extern "C" {
#endif
XSLTPUBFUN void XSLTCALL
xsltParseStylesheetAttributeSet (xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL
xsltFreeAttributeSetsHashes (xsltStylesheetPtr style);
XSLTPUBFUN void XSLTCALL
xsltApplyAttributeSet (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
const xmlChar *attributes);
XSLTPUBFUN void XSLTCALL
xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_ATTRIBUTES_H__ */
/*
* Summary: interface for the document handling
* Description: implements document loading and cache (multiple
* document() reference for the same resources must
* be equal.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_DOCUMENTS_H__
#define __XML_XSLT_DOCUMENTS_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltNewDocument (xsltTransformContextPtr ctxt,
xmlDocPtr doc);
XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltLoadDocument (xsltTransformContextPtr ctxt,
const xmlChar *URI);
XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltFindDocument (xsltTransformContextPtr ctxt,
xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL
xsltFreeDocuments (xsltTransformContextPtr ctxt);
XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltLoadStyleDocument (xsltStylesheetPtr style,
const xmlChar *URI);
XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltNewStyleDocument (xsltStylesheetPtr style,
xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL
xsltFreeStyleDocuments (xsltStylesheetPtr style);
/*
* Hooks for document loading
*/
/**
* xsltLoadType:
*
* Enum defining the kind of loader requirement.
*/
typedef enum {
XSLT_LOAD_START = 0, /* loading for a top stylesheet */
XSLT_LOAD_STYLESHEET = 1, /* loading for a stylesheet include/import */
XSLT_LOAD_DOCUMENT = 2 /* loading document at transformation time */
} xsltLoadType;
/**
* xsltDocLoaderFunc:
* @URI: the URI of the document to load
* @dict: the dictionary to use when parsing that document
* @options: parsing options, a set of xmlParserOption
* @ctxt: the context, either a stylesheet or a transformation context
* @type: the xsltLoadType indicating the kind of loading required
*
* An xsltDocLoaderFunc is a signature for a function which can be
* registered to load document not provided by the compilation or
* transformation API themselve, for example when an xsl:import,
* xsl:include is found at compilation time or when a document()
* call is made at runtime.
*
* Returns the pointer to the document (which will be modified and
* freed by the engine later), or NULL in case of error.
*/
typedef xmlDocPtr (*xsltDocLoaderFunc) (const xmlChar *URI,
xmlDictPtr dict,
int options,
void *ctxt,
xsltLoadType type);
XSLTPUBFUN void XSLTCALL
xsltSetLoaderFunc (xsltDocLoaderFunc f);
/* the loader may be needed by extension libraries so it is exported */
XSLTPUBVAR xsltDocLoaderFunc xsltDocDefaultLoader;
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_DOCUMENTS_H__ */
/*
* Summary: interface for the extension support
* Description: This provide the API needed for simple and module
* extension support.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_EXTENSION_H__
#define __XML_XSLT_EXTENSION_H__
#include <libxml/xpath.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Extension Modules API.
*/
/**
* xsltInitGlobals:
*
* Initialize the global variables for extensions
*
*/
XSLTPUBFUN void XSLTCALL
xsltInitGlobals (void);
/**
* xsltStyleExtInitFunction:
* @ctxt: an XSLT stylesheet
* @URI: the namespace URI for the extension
*
* A function called at initialization time of an XSLT extension module.
*
* Returns a pointer to the module specific data for this transformation.
*/
typedef void * (*xsltStyleExtInitFunction) (xsltStylesheetPtr style,
const xmlChar *URI);
/**
* xsltStyleExtShutdownFunction:
* @ctxt: an XSLT stylesheet
* @URI: the namespace URI for the extension
* @data: the data associated to this module
*
* A function called at shutdown time of an XSLT extension module.
*/
typedef void (*xsltStyleExtShutdownFunction) (xsltStylesheetPtr style,
const xmlChar *URI,
void *data);
/**
* xsltExtInitFunction:
* @ctxt: an XSLT transformation context
* @URI: the namespace URI for the extension
*
* A function called at initialization time of an XSLT extension module.
*
* Returns a pointer to the module specific data for this transformation.
*/
typedef void * (*xsltExtInitFunction) (xsltTransformContextPtr ctxt,
const xmlChar *URI);
/**
* xsltExtShutdownFunction:
* @ctxt: an XSLT transformation context
* @URI: the namespace URI for the extension
* @data: the data associated to this module
*
* A function called at shutdown time of an XSLT extension module.
*/
typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
const xmlChar *URI,
void *data);
XSLTPUBFUN int XSLTCALL
xsltRegisterExtModule (const xmlChar *URI,
xsltExtInitFunction initFunc,
xsltExtShutdownFunction shutdownFunc);
XSLTPUBFUN int XSLTCALL
xsltRegisterExtModuleFull
(const xmlChar * URI,
xsltExtInitFunction initFunc,
xsltExtShutdownFunction shutdownFunc,
xsltStyleExtInitFunction styleInitFunc,
xsltStyleExtShutdownFunction styleShutdownFunc);
XSLTPUBFUN int XSLTCALL
xsltUnregisterExtModule (const xmlChar * URI);
XSLTPUBFUN void * XSLTCALL
xsltGetExtData (xsltTransformContextPtr ctxt,
const xmlChar *URI);
XSLTPUBFUN void * XSLTCALL
xsltStyleGetExtData (xsltStylesheetPtr style,
const xmlChar *URI);
#ifdef XSLT_REFACTORED
XSLTPUBFUN void * XSLTCALL
xsltStyleStylesheetLevelGetExtData(
xsltStylesheetPtr style,
const xmlChar * URI);
#endif
XSLTPUBFUN void XSLTCALL
xsltShutdownCtxtExts (xsltTransformContextPtr ctxt);
XSLTPUBFUN void XSLTCALL
xsltShutdownExts (xsltStylesheetPtr style);
XSLTPUBFUN xsltTransformContextPtr XSLTCALL
xsltXPathGetTransformContext
(xmlXPathParserContextPtr ctxt);
/*
* extension functions
*/
XSLTPUBFUN int XSLTCALL
xsltRegisterExtModuleFunction
(const xmlChar *name,
const xmlChar *URI,
xmlXPathFunction function);
XSLTPUBFUN xmlXPathFunction XSLTCALL
xsltExtModuleFunctionLookup (const xmlChar *name,
const xmlChar *URI);
XSLTPUBFUN int XSLTCALL
xsltUnregisterExtModuleFunction
(const xmlChar *name,
const xmlChar *URI);
/*
* extension elements
*/
typedef xsltElemPreCompPtr (*xsltPreComputeFunction)
(xsltStylesheetPtr style,
xmlNodePtr inst,
xsltTransformFunction function);
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
xsltNewElemPreComp (xsltStylesheetPtr style,
xmlNodePtr inst,
xsltTransformFunction function);
XSLTPUBFUN void XSLTCALL
xsltInitElemPreComp (xsltElemPreCompPtr comp,
xsltStylesheetPtr style,
xmlNodePtr inst,
xsltTransformFunction function,
xsltElemPreCompDeallocator freeFunc);
XSLTPUBFUN int XSLTCALL
xsltRegisterExtModuleElement
(const xmlChar *name,
const xmlChar *URI,
xsltPreComputeFunction precomp,
xsltTransformFunction transform);
XSLTPUBFUN xsltTransformFunction XSLTCALL
xsltExtElementLookup (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *URI);
XSLTPUBFUN xsltTransformFunction XSLTCALL
xsltExtModuleElementLookup
(const xmlChar *name,
const xmlChar *URI);
XSLTPUBFUN xsltPreComputeFunction XSLTCALL
xsltExtModuleElementPreComputeLookup
(const xmlChar *name,
const xmlChar *URI);
XSLTPUBFUN int XSLTCALL
xsltUnregisterExtModuleElement
(const xmlChar *name,
const xmlChar *URI);
/*
* top-level elements
*/
typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style,
xmlNodePtr inst);
XSLTPUBFUN int XSLTCALL
xsltRegisterExtModuleTopLevel
(const xmlChar *name,
const xmlChar *URI,
xsltTopLevelFunction function);
XSLTPUBFUN xsltTopLevelFunction XSLTCALL
xsltExtModuleTopLevelLookup
(const xmlChar *name,
const xmlChar *URI);
XSLTPUBFUN int XSLTCALL
xsltUnregisterExtModuleTopLevel
(const xmlChar *name,
const xmlChar *URI);
/* These 2 functions are deprecated for use within modules. */
XSLTPUBFUN int XSLTCALL
xsltRegisterExtFunction (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *URI,
xmlXPathFunction function);
XSLTPUBFUN int XSLTCALL
xsltRegisterExtElement (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *URI,
xsltTransformFunction function);
/*
* Extension Prefix handling API.
* Those are used by the XSLT (pre)processor.
*/
XSLTPUBFUN int XSLTCALL
xsltRegisterExtPrefix (xsltStylesheetPtr style,
const xmlChar *prefix,
const xmlChar *URI);
XSLTPUBFUN int XSLTCALL
xsltCheckExtPrefix (xsltStylesheetPtr style,
const xmlChar *URI);
XSLTPUBFUN int XSLTCALL
xsltCheckExtURI (xsltStylesheetPtr style,
const xmlChar *URI);
XSLTPUBFUN int XSLTCALL
xsltInitCtxtExts (xsltTransformContextPtr ctxt);
XSLTPUBFUN void XSLTCALL
xsltFreeCtxtExts (xsltTransformContextPtr ctxt);
XSLTPUBFUN void XSLTCALL
xsltFreeExts (xsltStylesheetPtr style);
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
xsltPreComputeExtModuleElement
(xsltStylesheetPtr style,
xmlNodePtr inst);
/*
* Extension Infos access.
* Used by exslt initialisation
*/
XSLTPUBFUN xmlHashTablePtr XSLTCALL
xsltGetExtInfo (xsltStylesheetPtr style,
const xmlChar *URI);
/**
* Test module http://xmlsoft.org/XSLT/
*/
XSLTPUBFUN void XSLTCALL
xsltRegisterTestModule (void);
XSLTPUBFUN void XSLTCALL
xsltDebugDumpExtensions (FILE * output);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_EXTENSION_H__ */
/*
* extra.c: Implementation of non-standard features
*
* Reference:
* Michael Kay "XSLT Programmer's Reference" pp 637-643
* The node-set() extension function
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#define IN_LIBXSLT
#include "libxslt.h"
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/hash.h>
#include <libxml/xmlerror.h>
#include <libxml/parserInternals.h>
#include "xslt.h"
#include "xsltInternals.h"
#include "xsltutils.h"
#include "extensions.h"
#include "variables.h"
#include "transform.h"
#include "extra.h"
#include "preproc.h"
#ifdef WITH_XSLT_DEBUG
#define WITH_XSLT_DEBUG_EXTRA
#endif
/************************************************************************
* *
* Handling of XSLT debugging *
* *
************************************************************************/
/**
* xsltDebug:
* @ctxt: an XSLT processing context
* @node: The current node
* @inst: the instruction in the stylesheet
* @comp: precomputed information
*
* Process an debug node
*/
void
xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
xmlNodePtr inst ATTRIBUTE_UNUSED,
xsltElemPreCompPtr comp ATTRIBUTE_UNUSED)
{
int i, j;
xsltGenericError(xsltGenericErrorContext, "Templates:\n");
for (i = 0, j = ctxt->templNr - 1; ((i < 15) && (j >= 0)); i++, j--) {
xsltGenericError(xsltGenericErrorContext, "#%d ", i);
if (ctxt->templTab[j]->name != NULL)
xsltGenericError(xsltGenericErrorContext, "name %s ",
ctxt->templTab[j]->name);
if (ctxt->templTab[j]->match != NULL)
xsltGenericError(xsltGenericErrorContext, "name %s ",
ctxt->templTab[j]->match);
if (ctxt->templTab[j]->mode != NULL)
xsltGenericError(xsltGenericErrorContext, "name %s ",
ctxt->templTab[j]->mode);
xsltGenericError(xsltGenericErrorContext, "\n");
}
xsltGenericError(xsltGenericErrorContext, "Variables:\n");
for (i = 0, j = ctxt->varsNr - 1; ((i < 15) && (j >= 0)); i++, j--) {
xsltStackElemPtr cur;
if (ctxt->varsTab[j] == NULL)
continue;
xsltGenericError(xsltGenericErrorContext, "#%d\n", i);
cur = ctxt->varsTab[j];
while (cur != NULL) {
if (cur->comp == NULL) {
xsltGenericError(xsltGenericErrorContext,
"corrupted !!!\n");
} else if (cur->comp->type == XSLT_FUNC_PARAM) {
xsltGenericError(xsltGenericErrorContext, "param ");
} else if (cur->comp->type == XSLT_FUNC_VARIABLE) {
xsltGenericError(xsltGenericErrorContext, "var ");
}
if (cur->name != NULL)
xsltGenericError(xsltGenericErrorContext, "%s ",
cur->name);
else
xsltGenericError(xsltGenericErrorContext, "noname !!!!");
#ifdef LIBXML_DEBUG_ENABLED
if (cur->value != NULL) {
if ((xsltGenericDebugContext == stdout) ||
(xsltGenericDebugContext == stderr))
xmlXPathDebugDumpObject((FILE*)xsltGenericDebugContext,
cur->value, 1);
} else {
xsltGenericError(xsltGenericErrorContext, "NULL !!!!");
}
#endif
xsltGenericError(xsltGenericErrorContext, "\n");
cur = cur->next;
}
}
}
/************************************************************************
* *
* Classic extensions as described by M. Kay *
* *
************************************************************************/
/**
* xsltFunctionNodeSet:
* @ctxt: the XPath Parser context
* @nargs: the number of arguments
*
* Implement the node-set() XSLT function
* node-set node-set(result-tree)
*
* This function is available in libxslt, saxon or xt namespace.
*/
void
xsltFunctionNodeSet(xmlXPathParserContextPtr ctxt, int nargs){
if (nargs != 1) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"node-set() : expects one result-tree arg\n");
ctxt->error = XPATH_INVALID_ARITY;
return;
}
if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_XSLT_TREE) &&
(ctxt->value->type != XPATH_NODESET))) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"node-set() invalid arg expecting a result tree\n");
ctxt->error = XPATH_INVALID_TYPE;
return;
}
if (ctxt->value->type == XPATH_XSLT_TREE) {
ctxt->value->type = XPATH_NODESET;
}
}
/**
* xsltRegisterExtras:
* @ctxt: a XSLT process context
*
* Registers the built-in extensions. This function is deprecated, use
* xsltRegisterAllExtras instead.
*/
void
xsltRegisterExtras(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED) {
xsltRegisterAllExtras();
}
/**
* xsltRegisterAllExtras:
*
* Registers the built-in extensions
*/
void
xsltRegisterAllExtras (void) {
xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
XSLT_LIBXSLT_NAMESPACE,
xsltFunctionNodeSet);
xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
XSLT_SAXON_NAMESPACE,
xsltFunctionNodeSet);
xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
XSLT_XT_NAMESPACE,
xsltFunctionNodeSet);
xsltRegisterExtModuleElement((const xmlChar *) "debug",
XSLT_LIBXSLT_NAMESPACE,
NULL,
xsltDebug);
xsltRegisterExtModuleElement((const xmlChar *) "output",
XSLT_SAXON_NAMESPACE,
xsltDocumentComp,
xsltDocumentElem);
xsltRegisterExtModuleElement((const xmlChar *) "write",
XSLT_XALAN_NAMESPACE,
xsltDocumentComp,
xsltDocumentElem);
xsltRegisterExtModuleElement((const xmlChar *) "document",
XSLT_XT_NAMESPACE,
xsltDocumentComp,
xsltDocumentElem);
xsltRegisterExtModuleElement((const xmlChar *) "document",
XSLT_NAMESPACE,
xsltDocumentComp,
xsltDocumentElem);
}
/*
* Summary: interface for the non-standard features
* Description: implement some extension outside the XSLT namespace
* but not EXSLT with is in a different library.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_EXTRA_H__
#define __XML_XSLT_EXTRA_H__
#include <libxml/xpath.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_LIBXSLT_NAMESPACE:
*
* This is the libxslt namespace for specific extensions.
*/
#define XSLT_LIBXSLT_NAMESPACE ((xmlChar *) "http://xmlsoft.org/XSLT/namespace")
/**
* XSLT_SAXON_NAMESPACE:
*
* This is Michael Kay's Saxon processor namespace for extensions.
*/
#define XSLT_SAXON_NAMESPACE ((xmlChar *) "http://icl.com/saxon")
/**
* XSLT_XT_NAMESPACE:
*
* This is James Clark's XT processor namespace for extensions.
*/
#define XSLT_XT_NAMESPACE ((xmlChar *) "http://www.jclark.com/xt")
/**
* XSLT_XALAN_NAMESPACE:
*
* This is the Apache project XALAN processor namespace for extensions.
*/
#define XSLT_XALAN_NAMESPACE ((xmlChar *) \
"org.apache.xalan.xslt.extensions.Redirect")
XSLTPUBFUN void XSLTCALL
xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltDebug (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltRegisterExtras (xsltTransformContextPtr ctxt);
XSLTPUBFUN void XSLTCALL
xsltRegisterAllExtras (void);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_EXTRA_H__ */
/*
* Summary: interface for the XSLT functions not from XPath
* Description: a set of extra functions coming from XSLT but not in XPath
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard and Bjorn Reese <breese@users.sourceforge.net>
*/
#ifndef __XML_XSLT_FUNCTIONS_H__
#define __XML_XSLT_FUNCTIONS_H__
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_REGISTER_FUNCTION_LOOKUP:
*
* Registering macro, not general purpose at all but used in different modules.
*/
#define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \
xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \
xsltXPathFunctionLookup, \
(void *)(ctxt->xpathCtxt));
XSLTPUBFUN xmlXPathFunction XSLTCALL
xsltXPathFunctionLookup (void *vctxt,
const xmlChar *name,
const xmlChar *ns_uri);
/*
* Interfaces for the functions implementations.
*/
XSLTPUBFUN void XSLTCALL
xsltDocumentFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltKeyFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt,
int nargs);
XSLTPUBFUN void XSLTCALL
xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
int nargs);
/*
* And the registration
*/
XSLTPUBFUN void XSLTCALL
xsltRegisterAllFunctions (xmlXPathContextPtr ctxt);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_FUNCTIONS_H__ */
/*
* Summary: interface for the XSLT import support
* Description: macros and fuctions needed to implement and
* access the import tree
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_IMPORTS_H__
#define __XML_XSLT_IMPORTS_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_GET_IMPORT_PTR:
*
* A macro to import pointers from the stylesheet cascading order.
*/
#define XSLT_GET_IMPORT_PTR(res, style, name) { \
xsltStylesheetPtr st = style; \
res = NULL; \
while (st != NULL) { \
if (st->name != NULL) { res = st->name; break; } \
st = xsltNextImport(st); \
}}
/**
* XSLT_GET_IMPORT_INT:
*
* A macro to import intergers from the stylesheet cascading order.
*/
#define XSLT_GET_IMPORT_INT(res, style, name) { \
xsltStylesheetPtr st = style; \
res = -1; \
while (st != NULL) { \
if (st->name != -1) { res = st->name; break; } \
st = xsltNextImport(st); \
}}
/*
* Module interfaces
*/
XSLTPUBFUN int XSLTCALL
xsltParseStylesheetImport(xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN int XSLTCALL
xsltParseStylesheetInclude
(xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltNextImport (xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL
xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL
xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt,
xmlNodePtr node);
XSLTPUBFUN xsltTemplatePtr XSLTCALL
xsltFindTemplate (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *nameURI);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_IMPORTS_H__ */
/*
* Summary: interface for the key matching used in key() and template matches.
* Description: implementation of the key mechanims.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_KEY_H__
#define __XML_XSLT_KEY_H__
#include <libxml/xpath.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* NODE_IS_KEYED:
*
* check for bit 15 set
*/
#define NODE_IS_KEYED (1 >> 15)
XSLTPUBFUN int XSLTCALL
xsltAddKey (xsltStylesheetPtr style,
const xmlChar *name,
const xmlChar *nameURI,
const xmlChar *match,
const xmlChar *use,
xmlNodePtr inst);
XSLTPUBFUN xmlNodeSetPtr XSLTCALL
xsltGetKey (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *nameURI,
const xmlChar *value);
XSLTPUBFUN void XSLTCALL
xsltInitCtxtKeys (xsltTransformContextPtr ctxt,
xsltDocumentPtr doc);
XSLTPUBFUN void XSLTCALL
xsltFreeKeys (xsltStylesheetPtr style);
XSLTPUBFUN void XSLTCALL
xsltFreeDocumentKeys (xsltDocumentPtr doc);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_H__ */
/*
* Summary: internal header only used during the compilation of libxslt
* Description: internal header only used during the compilation of libxslt
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XSLT_LIBXSLT_H__
#define __XSLT_LIBXSLT_H__
#ifdef _WIN32
#include <win32config.h>
#else
#include "config.h"
#endif
#include <libxslt/xsltconfig.h>
#include <libxml/xmlversion.h>
#if !defined LIBXSLT_PUBLIC
#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC
#define LIBXSLT_PUBLIC __declspec(dllimport)
#else
#define LIBXSLT_PUBLIC
#endif
#endif
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#define mkdir(p,m) _mkdir(p)
#endif
#endif /* ! __XSLT_LIBXSLT_H__ */
/*
* Summary: interface for the XSLT namespace handling
* Description: set of function easing the processing and generation
* of namespace nodes in XSLT.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_NAMESPACES_H__
#define __XML_XSLT_NAMESPACES_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Used within nsAliases hashtable when the default namespace is required
* but it's not been explicitly defined
*/
/**
* UNDEFINED_DEFAULT_NS:
*
* Special value for undefined namespace, internal
*/
#define UNDEFINED_DEFAULT_NS (const xmlChar *) -1L
XSLTPUBFUN void XSLTCALL
xsltNamespaceAlias (xsltStylesheetPtr style,
xmlNodePtr node);
XSLTPUBFUN xmlNsPtr XSLTCALL
xsltGetNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr cur,
xmlNsPtr ns,
xmlNodePtr out);
XSLTPUBFUN xmlNsPtr XSLTCALL
xsltGetPlainNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr cur,
xmlNsPtr ns,
xmlNodePtr out);
XSLTPUBFUN xmlNsPtr XSLTCALL
xsltGetSpecialNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr cur,
const xmlChar *URI,
const xmlChar *prefix,
xmlNodePtr out);
XSLTPUBFUN xmlNsPtr XSLTCALL
xsltCopyNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr elem,
xmlNsPtr ns);
XSLTPUBFUN xmlNsPtr XSLTCALL
xsltCopyNamespaceList (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNsPtr cur);
XSLTPUBFUN void XSLTCALL
xsltFreeNamespaceAliasHashes
(xsltStylesheetPtr style);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_NAMESPACES_H__ */
/*
* Summary: Implementation of the XSLT number functions
* Description: Implementation of the XSLT number functions
*
* Copy: See Copyright for the status of this software.
*
* Author: Bjorn Reese <breese@users.sourceforge.net> and Daniel Veillard
*/
#ifndef __XML_XSLT_NUMBERSINTERNALS_H__
#define __XML_XSLT_NUMBERSINTERNALS_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _xsltCompMatch;
/**
* xsltNumberData:
*
* This data structure is just a wrapper to pass xsl:number data in.
*/
typedef struct _xsltNumberData xsltNumberData;
typedef xsltNumberData *xsltNumberDataPtr;
struct _xsltNumberData {
const xmlChar *level;
const xmlChar *count;
const xmlChar *from;
const xmlChar *value;
const xmlChar *format;
int has_format;
int digitsPerGroup;
int groupingCharacter;
int groupingCharacterLen;
xmlDocPtr doc;
xmlNodePtr node;
struct _xsltCompMatch *countPat;
struct _xsltCompMatch *fromPat;
/*
* accelerators
*/
};
/**
* xsltFormatNumberInfo,:
*
* This data structure lists the various parameters needed to format numbers.
*/
typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo;
typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr;
struct _xsltFormatNumberInfo {
int integer_hash; /* Number of '#' in integer part */
int integer_digits; /* Number of '0' in integer part */
int frac_digits; /* Number of '0' in fractional part */
int frac_hash; /* Number of '#' in fractional part */
int group; /* Number of chars per display 'group' */
int multiplier; /* Scaling for percent or permille */
char add_decimal; /* Flag for whether decimal point appears in pattern */
char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */
char is_negative_pattern;/* Flag for processing -ve prefix/suffix */
};
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */
/*
* Summary: interface for the pattern matching used in template matches.
* Description: the implementation of the lookup of the right template
* for a given node must be really fast in order to keep
* decent performances.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_PATTERN_H__
#define __XML_XSLT_PATTERN_H__
#include "xsltInternals.h"
#include "xsltexports.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* xsltCompMatch:
*
* Data structure used for the implementation of patterns.
* It is kept private (in pattern.c).
*/
typedef struct _xsltCompMatch xsltCompMatch;
typedef xsltCompMatch *xsltCompMatchPtr;
/*
* Pattern related interfaces.
*/
XSLTPUBFUN xsltCompMatchPtr XSLTCALL
xsltCompilePattern (const xmlChar *pattern,
xmlDocPtr doc,
xmlNodePtr node,
xsltStylesheetPtr style,
xsltTransformContextPtr runtime);
XSLTPUBFUN void XSLTCALL
xsltFreeCompMatchList (xsltCompMatchPtr comp);
XSLTPUBFUN int XSLTCALL
xsltTestCompMatchList (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xsltCompMatchPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCompMatchClearCache (xsltTransformContextPtr ctxt,
xsltCompMatchPtr comp);
XSLTPUBFUN void XSLTCALL
xsltNormalizeCompSteps (void *payload,
void *data,
const xmlChar *name);
/*
* Template related interfaces.
*/
XSLTPUBFUN int XSLTCALL
xsltAddTemplate (xsltStylesheetPtr style,
xsltTemplatePtr cur,
const xmlChar *mode,
const xmlChar *modeURI);
XSLTPUBFUN xsltTemplatePtr XSLTCALL
xsltGetTemplate (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xsltStylesheetPtr style);
XSLTPUBFUN void XSLTCALL
xsltFreeTemplateHashes (xsltStylesheetPtr style);
XSLTPUBFUN void XSLTCALL
xsltCleanupTemplates (xsltStylesheetPtr style);
#if 0
int xsltMatchPattern (xsltTransformContextPtr ctxt,
xmlNodePtr node,
const xmlChar *pattern,
xmlDocPtr ctxtdoc,
xmlNodePtr ctxtnode);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_PATTERN_H__ */
/*
* Summary: precomputing stylesheets
* Description: this is the compilation phase, where most of the
* stylesheet is "compiled" into faster to use data.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_PRECOMP_H__
#define __XML_XSLT_PRECOMP_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Interfaces
*/
extern const xmlChar *xsltExtMarker;
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
xsltDocumentComp (xsltStylesheetPtr style,
xmlNodePtr inst,
xsltTransformFunction function);
XSLTPUBFUN void XSLTCALL
xsltStylePreCompute (xsltStylesheetPtr style,
xmlNodePtr inst);
XSLTPUBFUN void XSLTCALL
xsltFreeStylePreComps (xsltStylesheetPtr style);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_PRECOMP_H__ */
/*
* Summary: interface for the libxslt security framework
* Description: the libxslt security framework allow to restrict
* the access to new resources (file or URL) from
* the stylesheet at runtime.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_SECURITY_H__
#define __XML_XSLT_SECURITY_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* xsltSecurityPref:
*
* structure to indicate the preferences for security in the XSLT
* transformation.
*/
typedef struct _xsltSecurityPrefs xsltSecurityPrefs;
typedef xsltSecurityPrefs *xsltSecurityPrefsPtr;
/**
* xsltSecurityOption:
*
* the set of option that can be configured
*/
typedef enum {
XSLT_SECPREF_READ_FILE = 1,
XSLT_SECPREF_WRITE_FILE,
XSLT_SECPREF_CREATE_DIRECTORY,
XSLT_SECPREF_READ_NETWORK,
XSLT_SECPREF_WRITE_NETWORK
} xsltSecurityOption;
/**
* xsltSecurityCheck:
*
* User provided function to check the value of a string like a file
* path or an URL ...
*/
typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt,
const char *value);
/*
* Module interfaces
*/
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
xsltNewSecurityPrefs (void);
XSLTPUBFUN void XSLTCALL
xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec);
XSLTPUBFUN int XSLTCALL
xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec,
xsltSecurityOption option,
xsltSecurityCheck func);
XSLTPUBFUN xsltSecurityCheck XSLTCALL
xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec,
xsltSecurityOption option);
XSLTPUBFUN void XSLTCALL
xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec);
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
xsltGetDefaultSecurityPrefs (void);
XSLTPUBFUN int XSLTCALL
xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL
xsltSecurityAllow (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt,
const char *value);
XSLTPUBFUN int XSLTCALL
xsltSecurityForbid (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt,
const char *value);
/*
* internal interfaces
*/
XSLTPUBFUN int XSLTCALL
xsltCheckWrite (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt,
const xmlChar *URL);
XSLTPUBFUN int XSLTCALL
xsltCheckRead (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt,
const xmlChar *URL);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_SECURITY_H__ */
/*
* Summary: interface for the template processing
* Description: This set of routine encapsulates XPath calls
* and Attribute Value Templates evaluation.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_TEMPLATES_H__
#define __XML_XSLT_TEMPLATES_H__
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
XSLTPUBFUN int XSLTCALL
xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
xmlXPathCompExprPtr comp,
xmlNsPtr *nsList,
int nsNr);
XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalTemplateString (xsltTransformContextPtr ctxt,
xmlNodePtr contextNode,
xmlNodePtr inst);
XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
xmlNodePtr node,
const xmlChar *name,
const xmlChar *ns);
XSLTPUBFUN const xmlChar * XSLTCALL
xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
xmlNodePtr node,
const xmlChar *name,
const xmlChar *ns,
int *found);
/* TODO: this is obviously broken ... the namespaces should be passed too ! */
XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalXPathString (xsltTransformContextPtr ctxt,
xmlXPathCompExprPtr comp);
XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
xmlXPathCompExprPtr comp,
int nsNr,
xmlNsPtr *nsList);
XSLTPUBFUN xmlNodePtr * XSLTCALL
xsltTemplateProcess (xsltTransformContextPtr ctxt,
xmlNodePtr node);
XSLTPUBFUN xmlAttrPtr XSLTCALL
xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
xmlNodePtr target,
xmlAttrPtr cur);
XSLTPUBFUN xmlAttrPtr XSLTCALL
xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
xmlNodePtr target,
xmlAttrPtr attr);
XSLTPUBFUN xmlChar * XSLTCALL
xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
const xmlChar* attr);
XSLTPUBFUN xmlChar * XSLTCALL
xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
const xmlChar* str,
xmlNodePtr node);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_TEMPLATES_H__ */
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* Summary: the XSLT engine transformation part.
* Description: This module implements the bulk of the actual
* transformation processing. Most of the xsl: element
* constructs are implemented in this module.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_TRANSFORM_H__
#define __XML_XSLT_TRANSFORM_H__
#include <libxml/parser.h>
#include <libxml/xmlIO.h>
#include "xsltexports.h"
#include <libxslt/xsltInternals.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* XInclude default processing.
*/
XSLTPUBFUN void XSLTCALL
xsltSetXIncludeDefault (int xinclude);
XSLTPUBFUN int XSLTCALL
xsltGetXIncludeDefault (void);
/**
* Export context to users.
*/
XSLTPUBFUN xsltTransformContextPtr XSLTCALL
xsltNewTransformContext (xsltStylesheetPtr style,
xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL
xsltFreeTransformContext(xsltTransformContextPtr ctxt);
XSLTPUBFUN xmlDocPtr XSLTCALL
xsltApplyStylesheetUser (xsltStylesheetPtr style,
xmlDocPtr doc,
const char **params,
const char *output,
FILE * profile,
xsltTransformContextPtr userCtxt);
XSLTPUBFUN void XSLTCALL
xsltProcessOneNode (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xsltStackElemPtr params);
/**
* Private Interfaces.
*/
XSLTPUBFUN void XSLTCALL
xsltApplyStripSpaces (xsltTransformContextPtr ctxt,
xmlNodePtr node);
XSLTPUBFUN xmlDocPtr XSLTCALL
xsltApplyStylesheet (xsltStylesheetPtr style,
xmlDocPtr doc,
const char **params);
XSLTPUBFUN xmlDocPtr XSLTCALL
xsltProfileStylesheet (xsltStylesheetPtr style,
xmlDocPtr doc,
const char **params,
FILE * output);
XSLTPUBFUN int XSLTCALL
xsltRunStylesheet (xsltStylesheetPtr style,
xmlDocPtr doc,
const char **params,
const char *output,
xmlSAXHandlerPtr SAX,
xmlOutputBufferPtr IObuf);
XSLTPUBFUN int XSLTCALL
xsltRunStylesheetUser (xsltStylesheetPtr style,
xmlDocPtr doc,
const char **params,
const char *output,
xmlSAXHandlerPtr SAX,
xmlOutputBufferPtr IObuf,
FILE * profile,
xsltTransformContextPtr userCtxt);
XSLTPUBFUN void XSLTCALL
xsltApplyOneTemplate (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr list,
xsltTemplatePtr templ,
xsltStackElemPtr params);
XSLTPUBFUN void XSLTCALL
xsltDocumentElem (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltSort (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCopy (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltText (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltElement (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltComment (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltAttribute (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltProcessingInstruction(xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCopyOf (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltValueOf (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltNumber (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltApplyImports (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltCallTemplate (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltApplyTemplates (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltChoose (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltIf (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltForEach (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst,
xsltElemPreCompPtr comp);
XSLTPUBFUN void XSLTCALL
xsltRegisterAllElement (xsltTransformContextPtr ctxt);
XSLTPUBFUN xmlNodePtr XSLTCALL
xsltCopyTextString (xsltTransformContextPtr ctxt,
xmlNodePtr target,
const xmlChar *string,
int noescape);
/* Following 2 functions needed for libexslt/functions.c */
XSLTPUBFUN void XSLTCALL
xsltLocalVariablePop (xsltTransformContextPtr ctxt,
int limitNr,
int level);
XSLTPUBFUN int XSLTCALL
xsltLocalVariablePush (xsltTransformContextPtr ctxt,
xsltStackElemPtr variable,
int level);
/*
* Hook for the debugger if activated.
*/
XSLTPUBFUN void XSLTCALL
xslHandleDebugger (xmlNodePtr cur,
xmlNodePtr node,
xsltTemplatePtr templ,
xsltTransformContextPtr ctxt);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_TRANSFORM_H__ */
/*************************************************************************
*
* $Id$
*
* Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
*************************************************************************
*
* http://ctrio.sourceforge.net/
*
************************************************************************/
#ifndef TRIO_TRIO_H
#define TRIO_TRIO_H
#if !defined(WITHOUT_TRIO)
/*
* Use autoconf defines if present. Packages using trio must define
* HAVE_CONFIG_H as a compiler option themselves.
*/
#if defined(HAVE_CONFIG_H)
# include <config.h>
#endif
#include "triodef.h"
#include <stdio.h>
#include <stdlib.h>
#if defined(TRIO_COMPILER_ANCIENT)
# include <varargs.h>
#else
# include <stdarg.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Error codes.
*
* Remember to add a textual description to trio_strerror.
*/
enum {
TRIO_EOF = 1,
TRIO_EINVAL = 2,
TRIO_ETOOMANY = 3,
TRIO_EDBLREF = 4,
TRIO_EGAP = 5,
TRIO_ENOMEM = 6,
TRIO_ERANGE = 7,
TRIO_ERRNO = 8,
TRIO_ECUSTOM = 9
};
/* Error macros */
#define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF)
#define TRIO_ERROR_POSITION(x) ((-(x)) >> 8)
#define TRIO_ERROR_NAME(x) trio_strerror(x)
typedef int (*trio_outstream_t) TRIO_PROTO((trio_pointer_t, int));
typedef int (*trio_instream_t) TRIO_PROTO((trio_pointer_t));
TRIO_CONST char *trio_strerror TRIO_PROTO((int));
/*************************************************************************
* Print Functions
*/
int trio_printf TRIO_PROTO((TRIO_CONST char *format, ...));
int trio_vprintf TRIO_PROTO((TRIO_CONST char *format, va_list args));
int trio_printfv TRIO_PROTO((TRIO_CONST char *format, void **args));
int trio_fprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...));
int trio_vfprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args));
int trio_fprintfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args));
int trio_dprintf TRIO_PROTO((int fd, TRIO_CONST char *format, ...));
int trio_vdprintf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args));
int trio_dprintfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args));
int trio_cprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,
TRIO_CONST char *format, ...));
int trio_vcprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,
TRIO_CONST char *format, va_list args));
int trio_cprintfv TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,
TRIO_CONST char *format, void **args));
int trio_sprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, ...));
int trio_vsprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, va_list args));
int trio_sprintfv TRIO_PROTO((char *buffer, TRIO_CONST char *format, void **args));
int trio_snprintf TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...));
int trio_vsnprintf TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,
va_list args));
int trio_snprintfv TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,
void **args));
int trio_snprintfcat TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...));
int trio_vsnprintfcat TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,
va_list args));
char *trio_aprintf TRIO_PROTO((TRIO_CONST char *format, ...));
char *trio_vaprintf TRIO_PROTO((TRIO_CONST char *format, va_list args));
int trio_asprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, ...));
int trio_vasprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, va_list args));
/*************************************************************************
* Scan Functions
*/
int trio_scanf TRIO_PROTO((TRIO_CONST char *format, ...));
int trio_vscanf TRIO_PROTO((TRIO_CONST char *format, va_list args));
int trio_scanfv TRIO_PROTO((TRIO_CONST char *format, void **args));
int trio_fscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...));
int trio_vfscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args));
int trio_fscanfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args));
int trio_dscanf TRIO_PROTO((int fd, TRIO_CONST char *format, ...));
int trio_vdscanf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args));
int trio_dscanfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args));
int trio_cscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,
TRIO_CONST char *format, ...));
int trio_vcscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,
TRIO_CONST char *format, va_list args));
int trio_cscanfv TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,
TRIO_CONST char *format, void **args));
int trio_sscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, ...));
int trio_vsscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, va_list args));
int trio_sscanfv TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, void **args));
/*************************************************************************
* Locale Functions
*/
void trio_locale_set_decimal_point TRIO_PROTO((char *decimalPoint));
void trio_locale_set_thousand_separator TRIO_PROTO((char *thousandSeparator));
void trio_locale_set_grouping TRIO_PROTO((char *grouping));
/*************************************************************************
* Renaming
*/
#ifdef TRIO_REPLACE_STDIO
/* Replace the <stdio.h> functions */
#ifndef HAVE_PRINTF
# define printf trio_printf
#endif
#ifndef HAVE_VPRINTF
# define vprintf trio_vprintf
#endif
#ifndef HAVE_FPRINTF
# define fprintf trio_fprintf
#endif
#ifndef HAVE_VFPRINTF
# define vfprintf trio_vfprintf
#endif
#ifndef HAVE_SPRINTF
# define sprintf trio_sprintf
#endif
#ifndef HAVE_VSPRINTF
# define vsprintf trio_vsprintf
#endif
#ifndef HAVE_SNPRINTF
# define snprintf trio_snprintf
#endif
#ifndef HAVE_VSNPRINTF
# define vsnprintf trio_vsnprintf
#endif
#ifndef HAVE_SCANF
# define scanf trio_scanf
#endif
#ifndef HAVE_VSCANF
# define vscanf trio_vscanf
#endif
#ifndef HAVE_FSCANF
# define fscanf trio_fscanf
#endif
#ifndef HAVE_VFSCANF
# define vfscanf trio_vfscanf
#endif
#ifndef HAVE_SSCANF
# define sscanf trio_sscanf
#endif
#ifndef HAVE_VSSCANF
# define vsscanf trio_vsscanf
#endif
/* These aren't stdio functions, but we make them look similar */
#define dprintf trio_dprintf
#define vdprintf trio_vdprintf
#define aprintf trio_aprintf
#define vaprintf trio_vaprintf
#define asprintf trio_asprintf
#define vasprintf trio_vasprintf
#define dscanf trio_dscanf
#define vdscanf trio_vdscanf
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WITHOUT_TRIO */
#endif /* TRIO_TRIO_H */
/*************************************************************************
*
* $Id$
*
* Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
#ifndef TRIO_TRIODEF_H
#define TRIO_TRIODEF_H
/*************************************************************************
* Platform and compiler support detection
*/
#if defined(__GNUC__)
# define TRIO_COMPILER_GCC
#elif defined(__SUNPRO_C)
# define TRIO_COMPILER_SUNPRO
#elif defined(__SUNPRO_CC)
# define TRIO_COMPILER_SUNPRO
# define __SUNPRO_C __SUNPRO_CC
#elif defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)
# define TRIO_COMPILER_XLC
#elif defined(_AIX) && !defined(__GNUC__)
# define TRIO_COMPILER_XLC /* Workaround for old xlc */
#elif defined(__DECC) || defined(__DECCXX)
# define TRIO_COMPILER_DECC
#elif defined(__osf__) && defined(__LANGUAGE_C__)
# define TRIO_COMPILER_DECC /* Workaround for old DEC C compilers */
#elif defined(_MSC_VER)
# define TRIO_COMPILER_MSVC
#elif defined(__BORLANDC__)
# define TRIO_COMPILER_BCB
#endif
#if defined(VMS) || defined(__VMS)
/*
* VMS is placed first to avoid identifying the platform as Unix
* based on the DECC compiler later on.
*/
# define TRIO_PLATFORM_VMS
#elif defined(unix) || defined(__unix) || defined(__unix__)
# define TRIO_PLATFORM_UNIX
#elif defined(TRIO_COMPILER_XLC) || defined(_AIX)
# define TRIO_PLATFORM_UNIX
#elif defined(TRIO_COMPILER_DECC) || defined(__osf___)
# define TRIO_PLATFORM_UNIX
#elif defined(__NetBSD__)
# define TRIO_PLATFORM_UNIX
#elif defined(__QNX__)
# define TRIO_PLATFORM_UNIX
# define TRIO_PLATFORM_QNX
#elif defined(__CYGWIN__)
# define TRIO_PLATFORM_UNIX
#elif defined(AMIGA) && defined(TRIO_COMPILER_GCC)
# define TRIO_PLATFORM_UNIX
#elif defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32)
# define TRIO_PLATFORM_WIN32
#elif defined(mpeix) || defined(__mpexl)
# define TRIO_PLATFORM_MPEIX
#endif
#if defined(_AIX)
# define TRIO_PLATFORM_AIX
#elif defined(__hpux)
# define TRIO_PLATFORM_HPUX
#elif defined(sun) || defined(__sun__)
# if defined(__SVR4) || defined(__svr4__)
# define TRIO_PLATFORM_SOLARIS
# else
# define TRIO_PLATFORM_SUNOS
# endif
#endif
#if defined(__STDC__) || defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB)
# define TRIO_COMPILER_SUPPORTS_C89
# if defined(__STDC_VERSION__)
# define TRIO_COMPILER_SUPPORTS_C90
# if (__STDC_VERSION__ >= 199409L)
# define TRIO_COMPILER_SUPPORTS_C94
# endif
# if (__STDC_VERSION__ >= 199901L)
# define TRIO_COMPILER_SUPPORTS_C99
# endif
# elif defined(TRIO_COMPILER_SUNPRO)
# if (__SUNPRO_C >= 0x420)
# define TRIO_COMPILER_SUPPORTS_C94
# endif
# endif
#endif
#if defined(_XOPEN_SOURCE)
# if defined(_XOPEN_SOURCE_EXTENDED)
# define TRIO_COMPILER_SUPPORTS_UNIX95
# endif
# if (_XOPEN_VERSION >= 500)
# define TRIO_COMPILER_SUPPORTS_UNIX98
# endif
# if (_XOPEN_VERSION >= 600)
# define TRIO_COMPILER_SUPPORTS_UNIX01
# endif
#endif
/*************************************************************************
* Generic defines
*/
#if !defined(TRIO_PUBLIC)
# define TRIO_PUBLIC
#endif
#if !defined(TRIO_PRIVATE)
# define TRIO_PRIVATE static
#endif
#if !(defined(TRIO_COMPILER_SUPPORTS_C89) || defined(__cplusplus))
# define TRIO_COMPILER_ANCIENT
#endif
#if defined(TRIO_COMPILER_ANCIENT)
# define TRIO_CONST
# define TRIO_VOLATILE
# define TRIO_SIGNED
typedef double trio_long_double_t;
typedef char * trio_pointer_t;
# define TRIO_SUFFIX_LONG(x) x
# define TRIO_PROTO(x) ()
# define TRIO_NOARGS
# define TRIO_ARGS1(list,a1) list a1;
# define TRIO_ARGS2(list,a1,a2) list a1; a2;
# define TRIO_ARGS3(list,a1,a2,a3) list a1; a2; a3;
# define TRIO_ARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4;
# define TRIO_ARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5;
# define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) list a1; a2; a3; a4; a5; a6;
# define TRIO_VARGS2(list,a1,a2) list a1; a2
# define TRIO_VARGS3(list,a1,a2,a3) list a1; a2; a3
# define TRIO_VARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4
# define TRIO_VARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5
# define TRIO_VA_DECL va_dcl
# define TRIO_VA_START(x,y) va_start(x)
# define TRIO_VA_END(x) va_end(x)
#else /* ANSI C */
# define TRIO_CONST const
# define TRIO_VOLATILE volatile
# define TRIO_SIGNED signed
typedef long double trio_long_double_t;
typedef void * trio_pointer_t;
# define TRIO_SUFFIX_LONG(x) x ## L
# define TRIO_PROTO(x) x
# define TRIO_NOARGS void
# define TRIO_ARGS1(list,a1) (a1)
# define TRIO_ARGS2(list,a1,a2) (a1,a2)
# define TRIO_ARGS3(list,a1,a2,a3) (a1,a2,a3)
# define TRIO_ARGS4(list,a1,a2,a3,a4) (a1,a2,a3,a4)
# define TRIO_ARGS5(list,a1,a2,a3,a4,a5) (a1,a2,a3,a4,a5)
# define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) (a1,a2,a3,a4,a5,a6)
# define TRIO_VARGS2 TRIO_ARGS2
# define TRIO_VARGS3 TRIO_ARGS3
# define TRIO_VARGS4 TRIO_ARGS4
# define TRIO_VARGS5 TRIO_ARGS5
# define TRIO_VA_DECL ...
# define TRIO_VA_START(x,y) va_start(x,y)
# define TRIO_VA_END(x) va_end(x)
#endif
#if defined(TRIO_COMPILER_SUPPORTS_C99) || defined(__cplusplus)
# define TRIO_INLINE inline
#elif defined(TRIO_COMPILER_GCC)
# define TRIO_INLINE __inline__
#elif defined(TRIO_COMPILER_MSVC)
# define TRIO_INLINE _inline
#elif defined(TRIO_COMPILER_BCB)
# define TRIO_INLINE __inline
#else
# define TRIO_INLINE
#endif
/*************************************************************************
* Workarounds
*/
#if defined(TRIO_PLATFORM_VMS)
/*
* Computations done with constants at compile time can trigger these
* even when compiling with IEEE enabled.
*/
# pragma message disable (UNDERFLOW, FLOATOVERFL)
# if (__CRTL_VER < 80000000)
/*
* Although the compiler supports C99 language constructs, the C
* run-time library does not contain all C99 functions.
*
* This was the case for 70300022. Update the 80000000 value when
* it has been accurately determined what version of the library
* supports C99.
*/
# if defined(TRIO_COMPILER_SUPPORTS_C99)
# undef TRIO_COMPILER_SUPPORTS_C99
# endif
# endif
#endif
/*
* Not all preprocessors supports the LL token.
*/
#if defined(TRIO_COMPILER_BCB)
#else
# define TRIO_COMPILER_SUPPORTS_LL
#endif
#endif /* TRIO_TRIODEF_H */
/*
* Summary: interface for the variable matching and lookup.
* Description: interface for the variable matching and lookup.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_VARIABLES_H__
#define __XML_XSLT_VARIABLES_H__
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#include "functions.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_REGISTER_VARIABLE_LOOKUP:
*
* Registering macro, not general purpose at all but used in different modules.
*/
#define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt) \
xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt, \
xsltXPathVariableLookup, (void *)(ctxt)); \
xsltRegisterAllFunctions((ctxt)->xpathCtxt); \
xsltRegisterAllElement(ctxt); \
(ctxt)->xpathCtxt->extra = ctxt
/*
* Flags for memory management of RVTs
*/
/**
* XSLT_RVT_LOCAL:
*
* RVT is destroyed after the current instructions ends.
*/
#define XSLT_RVT_LOCAL ((void *)1)
/**
* XSLT_RVT_FUNC_RESULT:
*
* RVT is part of results returned with func:result. The RVT won't be
* destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
* XSLT_RVT_VARIABLE in the template that receives the return value.
*/
#define XSLT_RVT_FUNC_RESULT ((void *)2)
/**
* XSLT_RVT_GLOBAL:
*
* RVT is part of a global variable.
*/
#define XSLT_RVT_GLOBAL ((void *)3)
/*
* Interfaces for the variable module.
*/
XSLTPUBFUN int XSLTCALL
xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL
xsltEvalUserParams (xsltTransformContextPtr ctxt,
const char **params);
XSLTPUBFUN int XSLTCALL
xsltQuoteUserParams (xsltTransformContextPtr ctxt,
const char **params);
XSLTPUBFUN int XSLTCALL
xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
const xmlChar * name,
const xmlChar * value);
XSLTPUBFUN int XSLTCALL
xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
const xmlChar * name,
const xmlChar * value);
XSLTPUBFUN void XSLTCALL
xsltParseGlobalVariable (xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL
xsltParseGlobalParam (xsltStylesheetPtr style,
xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL
xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL
xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
xmlNodePtr cur);
XSLTPUBFUN xsltStackElemPtr XSLTCALL
xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
xmlNodePtr cur);
XSLTPUBFUN int XSLTCALL
xsltAddStackElemList (xsltTransformContextPtr ctxt,
xsltStackElemPtr elems);
XSLTPUBFUN void XSLTCALL
xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
xsltVariableLookup (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
xsltXPathVariableLookup (void *ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_VARIABLES_H__ */
/*
* Summary: Windows configuration header
* Description: Windows configuration header
*
* Copy: See Copyright for the status of this software.
*
* Author: Igor Zlatkovic
*/
#ifndef __LIBXSLT_WIN32_CONFIG__
#define __LIBXSLT_WIN32_CONFIG__
#define HAVE_CTYPE_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_TIME_H 1
#define HAVE_LOCALTIME 1
#define HAVE_GMTIME 1
#define HAVE_TIME 1
#define HAVE_MATH_H 1
#define HAVE_FCNTL_H 1
#include <io.h>
#define HAVE_ISINF
#define HAVE_ISNAN
#include <math.h>
#ifdef _WIN32
/* MS C-runtime has functions which can be used in order to determine if
a given floating-point variable contains NaN, (+-)INF. These are
preferred, because floating-point technology is considered propriatary
by MS and we can assume that their functions know more about their
oddities than we do. */
#include <float.h>
/* Bjorn Reese figured a quite nice construct for isinf() using the
_fpclass() function. */
#ifndef isinf
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
#endif
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
#ifndef isnan
#define isnan(d) (_isnan(d))
#endif
#else /* _MSC_VER */
static int isinf (double d) {
int expon = 0;
double val = frexp (d, &expon);
if (expon == 1025) {
if (val == 0.5) {
return 1;
} else if (val == -0.5) {
return -1;
} else {
return 0;
}
} else {
return 0;
}
}
static int isnan (double d) {
int expon = 0;
double val = frexp (d, &expon);
if (expon == 1025) {
if (val == 0.5) {
return 0;
} else if (val == -0.5) {
return 0;
} else {
return 1;
}
} else {
return 0;
}
}
#endif /* _MSC_VER */
#include <direct.h>
/* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */
#if defined(_MSC_VER) && _MSC_VER < 1900
#include <stdarg.h>
#include <stdio.h>
#define snprintf c99_snprintf
#define vsnprintf c99_vsnprintf
__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
{
int count = -1;
if (size != 0)
count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
if (count == -1)
count = _vscprintf(format, ap);
return count;
}
__inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
{
int count;
va_list ap;
va_start(ap, format);
count = c99_vsnprintf(outBuf, size, format, ap);
va_end(ap);
return count;
}
#endif /* defined(_MSC_VER) && _MSC_VER < 1900 */
#define HAVE_SYS_STAT_H
#define HAVE_STAT
#define HAVE_STRING_H
#include <libxml/xmlversion.h>
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED
#endif
#define _WINSOCKAPI_
#endif /* __LIBXSLT_WIN32_CONFIG__ */
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* Summary: Interfaces, constants and types related to the XSLT engine
* Description: Interfaces, constants and types related to the XSLT engine
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLT_H__
#define __XML_XSLT_H__
#include <libxml/tree.h>
#include "xsltexports.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_DEFAULT_VERSION:
*
* The default version of XSLT supported.
*/
#define XSLT_DEFAULT_VERSION "1.0"
/**
* XSLT_DEFAULT_VENDOR:
*
* The XSLT "vendor" string for this processor.
*/
#define XSLT_DEFAULT_VENDOR "libxslt"
/**
* XSLT_DEFAULT_URL:
*
* The XSLT "vendor" URL for this processor.
*/
#define XSLT_DEFAULT_URL "http://xmlsoft.org/XSLT/"
/**
* XSLT_NAMESPACE:
*
* The XSLT specification namespace.
*/
#define XSLT_NAMESPACE ((const xmlChar *)"http://www.w3.org/1999/XSL/Transform")
/**
* XSLT_PARSE_OPTIONS:
*
* The set of options to pass to an xmlReadxxx when loading files for
* XSLT consumption.
*/
#define XSLT_PARSE_OPTIONS \
XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_NOCDATA
/**
* xsltMaxDepth:
*
* This value is used to detect templates loops.
*/
XSLTPUBVAR int xsltMaxDepth;
/**
* * xsltMaxVars:
* *
* * This value is used to detect templates loops.
* */
XSLTPUBVAR int xsltMaxVars;
/**
* xsltEngineVersion:
*
* The version string for libxslt.
*/
XSLTPUBVAR const char *xsltEngineVersion;
/**
* xsltLibxsltVersion:
*
* The version of libxslt compiled.
*/
XSLTPUBVAR const int xsltLibxsltVersion;
/**
* xsltLibxmlVersion:
*
* The version of libxml libxslt was compiled against.
*/
XSLTPUBVAR const int xsltLibxmlVersion;
/*
* Global initialization function.
*/
XSLTPUBFUN void XSLTCALL
xsltInit (void);
/*
* Global cleanup function.
*/
XSLTPUBFUN void XSLTCALL
xsltCleanupGlobals (void);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLT_H__ */
/*
* Summary: compile-time version information for the XSLT engine
* Description: compile-time version information for the XSLT engine
* this module is autogenerated.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLTCONFIG_H__
#define __XML_XSLTCONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif
/**
* LIBXSLT_DOTTED_VERSION:
*
* the version string like "1.2.3"
*/
#define LIBXSLT_DOTTED_VERSION "1.1.34"
/**
* LIBXSLT_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXSLT_VERSION 10134
/**
* LIBXSLT_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXSLT_VERSION_STRING "10134"
/**
* LIBXSLT_VERSION_EXTRA:
*
* extra version information, used to show a CVS compilation
*/
#define LIBXSLT_VERSION_EXTRA ""
/**
* WITH_XSLT_DEBUG:
*
* Activate the compilation of the debug reporting. Speed penalty
* is insignifiant and being able to run xsltpoc -v is useful. On
* by default unless --without-debug is passed to configure
*/
#if 0
#define WITH_XSLT_DEBUG
#endif
#if 0
/**
* DEBUG_MEMORY:
*
* should be activated only when debugging libxslt. It replaces the
* allocator with a collect and debug shell to the libc allocator.
* Use configure --with-mem-debug to activate it on both library
*/
#define DEBUG_MEMORY
/**
* DEBUG_MEMORY_LOCATION:
*
* should be activated only when debugging libxslt.
* DEBUG_MEMORY_LOCATION should be activated only when libxml has
* been configured with --with-debug-mem too
*/
#define DEBUG_MEMORY_LOCATION
#endif
/**
* XSLT_NEED_TRIO:
*
* should be activated if the existing libc library lacks some of the
* string formatting function, in that case reuse the Trio ones already
* compiled in the libxml2 library.
*/
#if 0
#define XSLT_NEED_TRIO
#endif
#ifdef __VMS
#define HAVE_MATH_H 1
#define HAVE_SYS_STAT_H 1
#ifndef XSLT_NEED_TRIO
#define XSLT_NEED_TRIO
#endif
#endif
#ifdef XSLT_NEED_TRIO
#define TRIO_REPLACE_STDIO
#endif
/**
* WITH_XSLT_DEBUGGER:
*
* Activate the compilation of the debugger support. Speed penalty
* is insignifiant.
* On by default unless --without-debugger is passed to configure
*/
#if 0
#ifndef WITH_DEBUGGER
#define WITH_DEBUGGER
#endif
#endif
/**
* WITH_PROFILER:
*
* Activate the compilation of the profiler. Speed penalty
* is insignifiant.
* On by default unless --without-profiler is passed to configure
*/
#if 0
#ifndef WITH_PROFILER
#define WITH_PROFILER
#endif
#endif
/**
* WITH_MODULES:
*
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/usr/local/lib/libxslt-plugins"
#endif
/**
* ATTRIBUTE_UNUSED:
*
* This macro is used to flag unused function parameters to GCC
*/
#ifdef __GNUC__
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((unused))
#endif
#else
#define ATTRIBUTE_UNUSED
#endif
/**
* LIBXSLT_ATTR_FORMAT:
*
* This macro is used to indicate to GCC the parameters are printf-like
*/
#ifdef __GNUC__
#define LIBXSLT_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
#else
#define LIBXSLT_ATTR_FORMAT(fmt,args)
#endif
/**
* LIBXSLT_PUBLIC:
*
* This macro is used to declare PUBLIC variables for Cygwin and for MSC on Windows
*/
#if !defined LIBXSLT_PUBLIC
#if (defined(__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC
#define LIBXSLT_PUBLIC __declspec(dllimport)
#else
#define LIBXSLT_PUBLIC
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLTCONFIG_H__ */
/*
* Summary: macros for marking symbols as exportable/importable.
* Description: macros for marking symbols as exportable/importable.
*
* Copy: See Copyright for the status of this software.
*
* Author: Igor Zlatkovic <igor@zlatkovic.com>
*/
#ifndef __XSLT_EXPORTS_H__
#define __XSLT_EXPORTS_H__
/**
* XSLTPUBFUN:
* XSLTPUBFUN, XSLTPUBVAR, XSLTCALL
*
* Macros which declare an exportable function, an exportable variable and
* the calling convention used for functions.
*
* Please use an extra block for every platform/compiler combination when
* modifying this, rather than overlong #ifdef lines. This helps
* readability as well as the fact that different compilers on the same
* platform might need different definitions.
*/
/**
* XSLTPUBFUN:
*
* Macros which declare an exportable function
*/
#define XSLTPUBFUN
/**
* XSLTPUBVAR:
*
* Macros which declare an exportable variable
*/
#define XSLTPUBVAR extern
/**
* XSLTCALL:
*
* Macros which declare the called convention for exported functions
*/
#define XSLTCALL
/** DOC_DISABLE */
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
/*
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
*/
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Cygwin platform (does not define _WIN32), GNU compiler */
#if defined(__CYGWIN__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#endif
/* Compatibility */
#if !defined(LIBXSLT_PUBLIC)
#define LIBXSLT_PUBLIC XSLTPUBVAR
#endif
#endif /* __XSLT_EXPORTS_H__ */
/*
* Summary: Locale handling
* Description: Interfaces for locale handling. Needed for language dependent
* sorting.
*
* Copy: See Copyright for the status of this software.
*
* Author: Nick Wellnhofer
*/
#ifndef __XML_XSLTLOCALE_H__
#define __XML_XSLTLOCALE_H__
#include <libxml/xmlstring.h>
#include "xsltexports.h"
#ifdef HAVE_STRXFRM_L
/*
* XSLT_LOCALE_POSIX:
* Macro indicating to use POSIX locale extensions
*/
#define XSLT_LOCALE_POSIX
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif
typedef locale_t xsltLocale;
typedef xmlChar xsltLocaleChar;
#elif defined(_WIN32) && !defined(__CYGWIN__)
/*
* XSLT_LOCALE_WINAPI:
* Macro indicating to use WinAPI for extended locale support
*/
#define XSLT_LOCALE_WINAPI
#include <windows.h>
#include <winnls.h>
typedef LCID xsltLocale;
typedef wchar_t xsltLocaleChar;
#else
/*
* XSLT_LOCALE_NONE:
* Macro indicating that there's no extended locale support
*/
#define XSLT_LOCALE_NONE
typedef void *xsltLocale;
typedef xmlChar xsltLocaleChar;
#endif
XSLTPUBFUN xsltLocale XSLTCALL
xsltNewLocale (const xmlChar *langName);
XSLTPUBFUN void XSLTCALL
xsltFreeLocale (xsltLocale locale);
XSLTPUBFUN xsltLocaleChar * XSLTCALL
xsltStrxfrm (xsltLocale locale,
const xmlChar *string);
XSLTPUBFUN int XSLTCALL
xsltLocaleStrcmp (xsltLocale locale,
const xsltLocaleChar *str1,
const xsltLocaleChar *str2);
XSLTPUBFUN void XSLTCALL
xsltFreeLocales (void);
#endif /* __XML_XSLTLOCALE_H__ */
/*
* Summary: set of utilities for the XSLT engine
* Description: interfaces for the utilities module of the XSLT engine.
* things like message handling, profiling, and other
* generally useful routines.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_XSLTUTILS_H__
#define __XML_XSLTUTILS_H__
#include <libxslt/xsltconfig.h>
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include <libxml/xpath.h>
#include <libxml/dict.h>
#include <libxml/xmlerror.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* XSLT_TODO:
*
* Macro to flag unimplemented blocks.
*/
#define XSLT_TODO \
xsltGenericError(xsltGenericErrorContext, \
"Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);
/**
* XSLT_STRANGE:
*
* Macro to flag that a problem was detected internally.
*/
#define XSLT_STRANGE \
xsltGenericError(xsltGenericErrorContext, \
"Internal error at %s:%d\n", \
__FILE__, __LINE__);
/**
* IS_XSLT_ELEM:
*
* Checks that the element pertains to XSLT namespace.
*/
#define IS_XSLT_ELEM(n) \
(((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) && \
((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
/**
* IS_XSLT_NAME:
*
* Checks the value of an element in XSLT namespace.
*/
#define IS_XSLT_NAME(n, val) \
(xmlStrEqual((n)->name, (const xmlChar *) (val)))
/**
* IS_XSLT_REAL_NODE:
*
* Check that a node is a 'real' one: document, element, text or attribute.
*/
#define IS_XSLT_REAL_NODE(n) \
(((n) != NULL) && \
(((n)->type == XML_ELEMENT_NODE) || \
((n)->type == XML_TEXT_NODE) || \
((n)->type == XML_CDATA_SECTION_NODE) || \
((n)->type == XML_ATTRIBUTE_NODE) || \
((n)->type == XML_DOCUMENT_NODE) || \
((n)->type == XML_HTML_DOCUMENT_NODE) || \
((n)->type == XML_COMMENT_NODE) || \
((n)->type == XML_PI_NODE)))
/*
* Our own version of namespaced attributes lookup.
*/
XSLTPUBFUN xmlChar * XSLTCALL
xsltGetNsProp (xmlNodePtr node,
const xmlChar *name,
const xmlChar *nameSpace);
XSLTPUBFUN const xmlChar * XSLTCALL
xsltGetCNsProp (xsltStylesheetPtr style,
xmlNodePtr node,
const xmlChar *name,
const xmlChar *nameSpace);
XSLTPUBFUN int XSLTCALL
xsltGetUTF8Char (const unsigned char *utf,
int *len);
/*
* XSLT Debug Tracing Tracing Types
*/
typedef enum {
XSLT_TRACE_ALL = -1,
XSLT_TRACE_NONE = 0,
XSLT_TRACE_COPY_TEXT = 1<<0,
XSLT_TRACE_PROCESS_NODE = 1<<1,
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
XSLT_TRACE_COPY = 1<<3,
XSLT_TRACE_COMMENT = 1<<4,
XSLT_TRACE_PI = 1<<5,
XSLT_TRACE_COPY_OF = 1<<6,
XSLT_TRACE_VALUE_OF = 1<<7,
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
XSLT_TRACE_CHOOSE = 1<<10,
XSLT_TRACE_IF = 1<<11,
XSLT_TRACE_FOR_EACH = 1<<12,
XSLT_TRACE_STRIP_SPACES = 1<<13,
XSLT_TRACE_TEMPLATES = 1<<14,
XSLT_TRACE_KEYS = 1<<15,
XSLT_TRACE_VARIABLES = 1<<16
} xsltDebugTraceCodes;
/**
* XSLT_TRACE:
*
* Control the type of xsl debugtrace messages emitted.
*/
#define XSLT_TRACE(ctxt,code,call) \
if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
call
XSLTPUBFUN void XSLTCALL
xsltDebugSetDefaultTrace(xsltDebugTraceCodes val);
XSLTPUBFUN xsltDebugTraceCodes XSLTCALL
xsltDebugGetDefaultTrace(void);
/*
* XSLT specific error and debug reporting functions.
*/
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError;
XSLTPUBVAR void *xsltGenericErrorContext;
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug;
XSLTPUBVAR void *xsltGenericDebugContext;
XSLTPUBFUN void XSLTCALL
xsltPrintErrorContext (xsltTransformContextPtr ctxt,
xsltStylesheetPtr style,
xmlNodePtr node);
XSLTPUBFUN void XSLTCALL
xsltMessage (xsltTransformContextPtr ctxt,
xmlNodePtr node,
xmlNodePtr inst);
XSLTPUBFUN void XSLTCALL
xsltSetGenericErrorFunc (void *ctx,
xmlGenericErrorFunc handler);
XSLTPUBFUN void XSLTCALL
xsltSetGenericDebugFunc (void *ctx,
xmlGenericErrorFunc handler);
XSLTPUBFUN void XSLTCALL
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
void *ctx,
xmlGenericErrorFunc handler);
XSLTPUBFUN void WINAPIV
xsltTransformError (xsltTransformContextPtr ctxt,
xsltStylesheetPtr style,
xmlNodePtr node,
const char *msg,
...) LIBXSLT_ATTR_FORMAT(4,5);
XSLTPUBFUN int XSLTCALL
xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt,
int options);
/*
* Sorting.
*/
XSLTPUBFUN void XSLTCALL
xsltDocumentSortFunction (xmlNodeSetPtr list);
XSLTPUBFUN void XSLTCALL
xsltSetSortFunc (xsltSortFunc handler);
XSLTPUBFUN void XSLTCALL
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
xsltSortFunc handler);
XSLTPUBFUN void XSLTCALL
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
xmlNodePtr *sorts,
int nbsorts);
XSLTPUBFUN void XSLTCALL
xsltDoSortFunction (xsltTransformContextPtr ctxt,
xmlNodePtr * sorts,
int nbsorts);
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
xsltComputeSortResult (xsltTransformContextPtr ctxt,
xmlNodePtr sort);
/*
* QNames handling.
*/
XSLTPUBFUN const xmlChar * XSLTCALL
xsltSplitQName (xmlDictPtr dict,
const xmlChar *name,
const xmlChar **prefix);
XSLTPUBFUN const xmlChar * XSLTCALL
xsltGetQNameURI (xmlNodePtr node,
xmlChar **name);
XSLTPUBFUN const xmlChar * XSLTCALL
xsltGetQNameURI2 (xsltStylesheetPtr style,
xmlNodePtr node,
const xmlChar **name);
/*
* Output, reuse libxml I/O buffers.
*/
XSLTPUBFUN int XSLTCALL
xsltSaveResultTo (xmlOutputBufferPtr buf,
xmlDocPtr result,
xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL
xsltSaveResultToFilename (const char *URI,
xmlDocPtr result,
xsltStylesheetPtr style,
int compression);
XSLTPUBFUN int XSLTCALL
xsltSaveResultToFile (FILE *file,
xmlDocPtr result,
xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL
xsltSaveResultToFd (int fd,
xmlDocPtr result,
xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL
xsltSaveResultToString (xmlChar **doc_txt_ptr,
int * doc_txt_len,
xmlDocPtr result,
xsltStylesheetPtr style);
/*
* XPath interface
*/
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
xsltXPathCompile (xsltStylesheetPtr style,
const xmlChar *str);
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
xsltXPathCompileFlags (xsltStylesheetPtr style,
const xmlChar *str,
int flags);
/*
* Profiling.
*/
XSLTPUBFUN void XSLTCALL
xsltSaveProfiling (xsltTransformContextPtr ctxt,
FILE *output);
XSLTPUBFUN xmlDocPtr XSLTCALL
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
XSLTPUBFUN long XSLTCALL
xsltTimestamp (void);
XSLTPUBFUN void XSLTCALL
xsltCalibrateAdjust (long delta);
/**
* XSLT_TIMESTAMP_TICS_PER_SEC:
*
* Sampling precision for profiling
*/
#define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
/*
* Hooks for the debugger.
*/
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;
XSLTPUBVAR int xslDebugStatus;
typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node,
xsltTemplatePtr templ, xsltTransformContextPtr ctxt);
typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source);
typedef void (*xsltDropCallCallback) (void);
XSLTPUBFUN void XSLTCALL
xsltSetDebuggerStatus (int value);
XSLTPUBFUN int XSLTCALL
xsltGetDebuggerStatus (void);
XSLTPUBFUN int XSLTCALL
xsltSetDebuggerCallbacks (int no, void *block);
XSLTPUBFUN int XSLTCALL
xslAddCall (xsltTemplatePtr templ,
xmlNodePtr source);
XSLTPUBFUN void XSLTCALL
xslDropCall (void);
#ifdef __cplusplus
}
#endif
#endif /* __XML_XSLTUTILS_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment