[LIBXSLT]

- Trim trailing whitespace. Remove spaces before tabs. No code changes.

svn path=/trunk/; revision=58297
This commit is contained in:
Thomas Faber 2013-02-09 11:40:29 +00:00
parent 61979ebc0f
commit e53c550e55
34 changed files with 1024 additions and 1024 deletions

View file

@ -140,7 +140,7 @@ xsltFreeAttrElem(xsltAttrElemPtr attr) {
static void static void
xsltFreeAttrElemList(xsltAttrElemPtr list) { xsltFreeAttrElemList(xsltAttrElemPtr list) {
xsltAttrElemPtr next; xsltAttrElemPtr next;
while (list != NULL) { while (list != NULL) {
next = list->next; next = list->next;
xsltFreeAttrElem(list); xsltFreeAttrElem(list);
@ -171,7 +171,7 @@ xsltAddAttrElemList(xsltAttrElemPtr list, xmlNodePtr attr) {
if (list == NULL) if (list == NULL)
return(xsltNewAttrElem(attr)); return(xsltNewAttrElem(attr));
cur = list; cur = list;
while (cur != NULL) { while (cur != NULL) {
next = cur->next; next = cur->next;
if (cur->attr == attr) if (cur->attr == attr)
return(cur); return(cur);
@ -375,7 +375,7 @@ xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) {
attrItems = curAttr; attrItems = curAttr;
goto next_child; goto next_child;
} }
if (curAttr->next == NULL) if (curAttr->next == NULL)
curAttr->next = xsltNewAttrElem(child); curAttr->next = xsltNewAttrElem(child);
curAttr = nextAttr; curAttr = nextAttr;
} }
@ -405,7 +405,7 @@ next_child:
/* /*
* Process attribue "use-attribute-sets". * Process attribue "use-attribute-sets".
*/ */
/* TODO check recursion */ /* TODO check recursion */
value = xmlGetNsProp(cur, (const xmlChar *)"use-attribute-sets", value = xmlGetNsProp(cur, (const xmlChar *)"use-attribute-sets",
NULL); NULL);
if (value != NULL) { if (value != NULL) {
@ -422,7 +422,7 @@ next_child:
const xmlChar *ncname2 = NULL; const xmlChar *ncname2 = NULL;
const xmlChar *prefix2 = NULL; const xmlChar *prefix2 = NULL;
xsltAttrElemPtr refAttrItems; xsltAttrElemPtr refAttrItems;
#ifdef WITH_XSLT_DEBUG_ATTRIBUTES #ifdef WITH_XSLT_DEBUG_ATTRIBUTES
xsltGenericDebug(xsltGenericDebugContext, xsltGenericDebug(xsltGenericDebugContext,
"xsl:attribute-set : %s adds use %s\n", ncname, curval); "xsl:attribute-set : %s adds use %s\n", ncname, curval);
@ -605,7 +605,7 @@ xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style) {
#endif #endif
style->attributeSets = xmlHashCreate(10); style->attributeSets = xmlHashCreate(10);
} }
xmlHashScanFull(cur->attributeSets, xmlHashScanFull(cur->attributeSets,
(xmlHashScannerFull) xsltMergeSASCallback, style); (xmlHashScannerFull) xsltMergeSASCallback, style);
/* /*
* the attribute lists have either been migrated to style * the attribute lists have either been migrated to style
@ -621,7 +621,7 @@ xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style) {
* Then resolve all the references and computes the resulting sets * Then resolve all the references and computes the resulting sets
*/ */
if (style->attributeSets != NULL) { if (style->attributeSets != NULL) {
xmlHashScanFull(style->attributeSets, xmlHashScanFull(style->attributeSets,
(xmlHashScannerFull) xsltResolveSASCallback, style); (xmlHashScannerFull) xsltResolveSASCallback, style);
} }
} }
@ -645,21 +645,21 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
{ {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
xsltStyleItemAttributePtr comp = xsltStyleItemAttributePtr comp =
(xsltStyleItemAttributePtr) castedComp; (xsltStyleItemAttributePtr) castedComp;
#else #else
xsltStylePreCompPtr comp = castedComp; xsltStylePreCompPtr comp = castedComp;
#endif #endif
xmlNodePtr targetElem; xmlNodePtr targetElem;
xmlChar *prop = NULL; xmlChar *prop = NULL;
const xmlChar *name = NULL, *prefix = NULL, *nsName = NULL; const xmlChar *name = NULL, *prefix = NULL, *nsName = NULL;
xmlChar *value = NULL; xmlChar *value = NULL;
xmlNsPtr ns = NULL; xmlNsPtr ns = NULL;
xmlAttrPtr attr; xmlAttrPtr attr;
if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL)) if ((ctxt == NULL) || (contextNode == NULL) || (inst == NULL))
return; return;
/* /*
* A comp->has_name == 0 indicates that we need to skip this instruction, * A comp->has_name == 0 indicates that we need to skip this instruction,
* since it was evaluated to be invalid already during compilation. * since it was evaluated to be invalid already during compilation.
*/ */
@ -689,7 +689,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
* So report an internal error? * So report an internal error?
*/ */
if (ctxt->insert == NULL) if (ctxt->insert == NULL)
return; return;
/* /*
* SPEC XSLT 1.0: * SPEC XSLT 1.0:
* "Adding an attribute to a node that is not an element; * "Adding an attribute to a node that is not an element;
@ -701,7 +701,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
targetElem = ctxt->insert; targetElem = ctxt->insert;
if (targetElem->type != XML_ELEMENT_NODE) if (targetElem->type != XML_ELEMENT_NODE)
return; return;
/* /*
* SPEC XSLT 1.0: * SPEC XSLT 1.0:
* "Adding an attribute to an element after children have been added * "Adding an attribute to an element after children have been added
@ -727,7 +727,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
/* /*
* Process the name * Process the name
* ---------------- * ----------------
*/ */
#ifdef WITH_DEBUGGER #ifdef WITH_DEBUGGER
if (ctxt->debugStatus != XSLT_DEBUG_NONE) if (ctxt->debugStatus != XSLT_DEBUG_NONE)
@ -785,7 +785,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
name = xsltSplitQName(ctxt->dict, comp->name, &prefix); name = xsltSplitQName(ctxt->dict, comp->name, &prefix);
#endif #endif
} }
/* /*
* Process namespace semantics * Process namespace semantics
* --------------------------- * ---------------------------
@ -809,9 +809,9 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
*/ */
/* TODO: check attr acquisition wrt to the XSLT namespace */ /* TODO: check attr acquisition wrt to the XSLT namespace */
tmpNsName = xsltEvalAttrValueTemplate(ctxt, inst, tmpNsName = xsltEvalAttrValueTemplate(ctxt, inst,
(const xmlChar *) "namespace", XSLT_NAMESPACE); (const xmlChar *) "namespace", XSLT_NAMESPACE);
/* /*
* This fixes bug #302020: The AVT might also evaluate to the * This fixes bug #302020: The AVT might also evaluate to the
* empty string; this means that the empty string also indicates * empty string; this means that the empty string also indicates
* "no namespace". * "no namespace".
* SPEC XSLT 1.0: * SPEC XSLT 1.0:
@ -820,8 +820,8 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
*/ */
if ((tmpNsName != NULL) && (tmpNsName[0] != 0)) if ((tmpNsName != NULL) && (tmpNsName[0] != 0))
nsName = xmlDictLookup(ctxt->dict, BAD_CAST tmpNsName, -1); nsName = xmlDictLookup(ctxt->dict, BAD_CAST tmpNsName, -1);
xmlFree(tmpNsName); xmlFree(tmpNsName);
}; };
} else if (prefix != NULL) { } else if (prefix != NULL) {
/* /*
* SPEC XSLT 1.0: * SPEC XSLT 1.0:
@ -829,7 +829,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
* expanded into an expanded-name using the namespace declarations * expanded into an expanded-name using the namespace declarations
* in effect for the xsl:attribute element, *not* including any * in effect for the xsl:attribute element, *not* including any
* default namespace declaration." * default namespace declaration."
*/ */
ns = xmlSearchNs(inst->doc, inst, prefix); ns = xmlSearchNs(inst->doc, inst, prefix);
if (ns == NULL) { if (ns == NULL) {
/* /*
@ -842,7 +842,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
"this is an error, since the namespace was not " "this is an error, since the namespace was not "
"specified by the instruction itself.\n", prefix, name); "specified by the instruction itself.\n", prefix, name);
} else } else
nsName = ns->href; nsName = ns->href;
} }
if (fromAttributeSet) { if (fromAttributeSet) {
@ -862,9 +862,9 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
* Find/create a matching ns-decl in the result tree. * Find/create a matching ns-decl in the result tree.
*/ */
ns = NULL; ns = NULL;
#if 0 #if 0
if (0) { if (0) {
/* /*
* OPTIMIZE TODO: How do we know if we are adding to a * OPTIMIZE TODO: How do we know if we are adding to a
* fragment or to the result tree? * fragment or to the result tree?
@ -883,7 +883,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
} }
#endif #endif
if (nsName != NULL) { if (nsName != NULL) {
/* /*
* Something about ns-prefixes: * Something about ns-prefixes:
* SPEC XSLT 1.0: * SPEC XSLT 1.0:
@ -925,12 +925,12 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
* TODO: Do we need to put the empty string in ? * TODO: Do we need to put the empty string in ?
*/ */
attr = xmlSetNsProp(ctxt->insert, ns, name, (const xmlChar *) ""); attr = xmlSetNsProp(ctxt->insert, ns, name, (const xmlChar *) "");
} else if ((inst->children->next == NULL) && } else if ((inst->children->next == NULL) &&
((inst->children->type == XML_TEXT_NODE) || ((inst->children->type == XML_TEXT_NODE) ||
(inst->children->type == XML_CDATA_SECTION_NODE))) (inst->children->type == XML_CDATA_SECTION_NODE)))
{ {
xmlNodePtr copyTxt; xmlNodePtr copyTxt;
/* /*
* xmlSetNsProp() will take care of duplicates. * xmlSetNsProp() will take care of duplicates.
*/ */
@ -965,7 +965,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
*/ */
copyTxt = xmlNewText(inst->children->content); copyTxt = xmlNewText(inst->children->content);
if (copyTxt == NULL) /* TODO: report error */ if (copyTxt == NULL) /* TODO: report error */
goto error; goto error;
} }
attr->children = attr->last = copyTxt; attr->children = attr->last = copyTxt;
copyTxt->parent = (xmlNodePtr) attr; copyTxt->parent = (xmlNodePtr) attr;
@ -976,7 +976,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
* anyway? * anyway?
*/ */
if (inst->children->name == xmlStringTextNoenc) if (inst->children->name == xmlStringTextNoenc)
copyTxt->name = xmlStringTextNoenc; copyTxt->name = xmlStringTextNoenc;
/* /*
* since we create the attribute without content IDness must be * since we create the attribute without content IDness must be
@ -1005,7 +1005,7 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt,
} }
error: error:
return; return;
} }
/** /**
@ -1041,10 +1041,10 @@ xsltApplyAttributeSet(xsltTransformContextPtr ctxt, xmlNodePtr node,
const xmlChar *attrSets) const xmlChar *attrSets)
{ {
const xmlChar *ncname = NULL; const xmlChar *ncname = NULL;
const xmlChar *prefix = NULL; const xmlChar *prefix = NULL;
const xmlChar *curstr, *endstr; const xmlChar *curstr, *endstr;
xsltAttrElemPtr attrs; xsltAttrElemPtr attrs;
xsltStylesheetPtr style; xsltStylesheetPtr style;
if (attrSets == NULL) { if (attrSets == NULL) {
if (inst == NULL) if (inst == NULL)
@ -1056,7 +1056,7 @@ xsltApplyAttributeSet(xsltTransformContextPtr ctxt, xmlNodePtr node,
if (inst->type == XML_ATTRIBUTE_NODE) { if (inst->type == XML_ATTRIBUTE_NODE) {
if ( ((xmlAttrPtr) inst)->children != NULL) if ( ((xmlAttrPtr) inst)->children != NULL)
attrSets = ((xmlAttrPtr) inst)->children->content; attrSets = ((xmlAttrPtr) inst)->children->content;
} }
if (attrSets == NULL) { if (attrSets == NULL) {
/* /*

View file

@ -21,14 +21,14 @@ extern "C" {
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseStylesheetAttributeSet (xsltStylesheetPtr style, xsltParseStylesheetAttributeSet (xsltStylesheetPtr style,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeAttributeSetsHashes (xsltStylesheetPtr style); xsltFreeAttributeSetsHashes (xsltStylesheetPtr style);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltApplyAttributeSet (xsltTransformContextPtr ctxt, xsltApplyAttributeSet (xsltTransformContextPtr ctxt,
xmlNodePtr node, xmlNodePtr node,
xmlNodePtr inst, xmlNodePtr inst,
const xmlChar *attributes); const xmlChar *attributes);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style); xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -147,7 +147,7 @@ static xsltAttrVTPtr
xsltSetAttrVTsegment(xsltAttrVTPtr avt, void *val) { xsltSetAttrVTsegment(xsltAttrVTPtr avt, void *val) {
if (avt->nb_seg >= avt->max_seg) { if (avt->nb_seg >= avt->max_seg) {
avt = (xsltAttrVTPtr) xmlRealloc(avt, sizeof(xsltAttrVT) + avt = (xsltAttrVTPtr) xmlRealloc(avt, sizeof(xsltAttrVT) +
avt->max_seg * sizeof(void *)); avt->max_seg * sizeof(void *));
if (avt == NULL) { if (avt == NULL) {
return NULL; return NULL;
} }
@ -178,7 +178,7 @@ xsltCompileAttr(xsltStylesheetPtr style, xmlAttrPtr attr) {
if ((style == NULL) || (attr == NULL) || (attr->children == NULL)) if ((style == NULL) || (attr == NULL) || (attr->children == NULL))
return; return;
if ((attr->children->type != XML_TEXT_NODE) || if ((attr->children->type != XML_TEXT_NODE) ||
(attr->children->next != NULL)) { (attr->children->next != NULL)) {
xsltTransformError(NULL, style, attr->parent, xsltTransformError(NULL, style, attr->parent,
"Attribute '%s': The content is expected to be a single text " "Attribute '%s': The content is expected to be a single text "
@ -248,7 +248,7 @@ xsltCompileAttr(xsltStylesheetPtr style, xmlAttrPtr attr) {
/* Need to check for literal (bug539741) */ /* Need to check for literal (bug539741) */
if ((*cur == '\'') || (*cur == '"')) { if ((*cur == '\'') || (*cur == '"')) {
char delim = *(cur++); char delim = *(cur++);
while ((*cur != 0) && (*cur != delim)) while ((*cur != 0) && (*cur != delim))
cur++; cur++;
if (*cur != 0) if (*cur != 0)
cur++; /* skip the ending delimiter */ cur++; /* skip the ending delimiter */

View file

@ -36,9 +36,9 @@
#endif #endif
/************************************************************************ /************************************************************************
* * * *
* Hooks for the document loader * * Hooks for the document loader *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -116,7 +116,7 @@ xsltDocLoaderFunc xsltDocDefaultLoader = xsltDocDefaultLoaderFunc;
* Set the new function to load document, if NULL it resets it to the * Set the new function to load document, if NULL it resets it to the
* default function. * default function.
*/ */
void void
xsltSetLoaderFunc(xsltDocLoaderFunc f) { xsltSetLoaderFunc(xsltDocLoaderFunc f) {
if (f == NULL) if (f == NULL)
@ -140,7 +140,7 @@ xsltSetLoaderFunc(xsltDocLoaderFunc f) {
* *
* Returns a handler to the document * Returns a handler to the document
*/ */
xsltDocumentPtr xsltDocumentPtr
xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) { xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
xsltDocumentPtr cur; xsltDocumentPtr cur;
@ -179,7 +179,7 @@ xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
* *
* Returns a handler to the document * Returns a handler to the document
*/ */
xsltDocumentPtr xsltDocumentPtr
xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) { xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
xsltDocumentPtr cur; xsltDocumentPtr cur;
@ -204,15 +204,15 @@ xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
* *
* Frees the node-trees (and xsltDocument structures) of all * Frees the node-trees (and xsltDocument structures) of all
* stylesheet-modules of the stylesheet-level represented by * stylesheet-modules of the stylesheet-level represented by
* the given @style. * the given @style.
*/ */
void void
xsltFreeStyleDocuments(xsltStylesheetPtr style) { xsltFreeStyleDocuments(xsltStylesheetPtr style) {
xsltDocumentPtr doc, cur; xsltDocumentPtr doc, cur;
#ifdef XSLT_REFACTORED_XSLT_NSCOMP #ifdef XSLT_REFACTORED_XSLT_NSCOMP
xsltNsMapPtr nsMap; xsltNsMapPtr nsMap;
#endif #endif
if (style == NULL) if (style == NULL)
return; return;
@ -220,8 +220,8 @@ xsltFreeStyleDocuments(xsltStylesheetPtr style) {
if (XSLT_HAS_INTERNAL_NSMAP(style)) if (XSLT_HAS_INTERNAL_NSMAP(style))
nsMap = XSLT_GET_INTERNAL_NSMAP(style); nsMap = XSLT_GET_INTERNAL_NSMAP(style);
else else
nsMap = NULL; nsMap = NULL;
#endif #endif
cur = style->docList; cur = style->docList;
while (cur != NULL) { while (cur != NULL) {
@ -247,7 +247,7 @@ xsltFreeStyleDocuments(xsltStylesheetPtr style) {
* *
* Free up all the space used by the loaded documents * Free up all the space used by the loaded documents
*/ */
void void
xsltFreeDocuments(xsltTransformContextPtr ctxt) { xsltFreeDocuments(xsltTransformContextPtr ctxt) {
xsltDocumentPtr doc, cur; xsltDocumentPtr doc, cur;
@ -281,7 +281,7 @@ xsltFreeDocuments(xsltTransformContextPtr ctxt) {
* *
* Returns the new xsltDocumentPtr or NULL in case of error * Returns the new xsltDocumentPtr or NULL in case of error
*/ */
xsltDocumentPtr xsltDocumentPtr
xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) { xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
xsltDocumentPtr ret; xsltDocumentPtr ret;
xmlDocPtr doc; xmlDocPtr doc;
@ -294,7 +294,7 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
*/ */
if (ctxt->sec != NULL) { if (ctxt->sec != NULL) {
int res; int res;
res = xsltCheckRead(ctxt->sec, ctxt, URI); res = xsltCheckRead(ctxt->sec, ctxt, URI);
if (res == 0) { if (res == 0) {
xsltTransformError(ctxt, NULL, NULL, xsltTransformError(ctxt, NULL, NULL,
@ -355,7 +355,7 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
* *
* Returns the new xsltDocumentPtr or NULL in case of error * Returns the new xsltDocumentPtr or NULL in case of error
*/ */
xsltDocumentPtr xsltDocumentPtr
xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) { xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) {
xsltDocumentPtr ret; xsltDocumentPtr ret;
xmlDocPtr doc; xmlDocPtr doc;

View file

@ -20,26 +20,26 @@
extern "C" { extern "C" {
#endif #endif
XSLTPUBFUN xsltDocumentPtr XSLTCALL XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltNewDocument (xsltTransformContextPtr ctxt, xsltNewDocument (xsltTransformContextPtr ctxt,
xmlDocPtr doc); xmlDocPtr doc);
XSLTPUBFUN xsltDocumentPtr XSLTCALL XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltLoadDocument (xsltTransformContextPtr ctxt, xsltLoadDocument (xsltTransformContextPtr ctxt,
const xmlChar *URI); const xmlChar *URI);
XSLTPUBFUN xsltDocumentPtr XSLTCALL XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltFindDocument (xsltTransformContextPtr ctxt, xsltFindDocument (xsltTransformContextPtr ctxt,
xmlDocPtr doc); xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeDocuments (xsltTransformContextPtr ctxt); xsltFreeDocuments (xsltTransformContextPtr ctxt);
XSLTPUBFUN xsltDocumentPtr XSLTCALL XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltLoadStyleDocument (xsltStylesheetPtr style, xsltLoadStyleDocument (xsltStylesheetPtr style,
const xmlChar *URI); const xmlChar *URI);
XSLTPUBFUN xsltDocumentPtr XSLTCALL XSLTPUBFUN xsltDocumentPtr XSLTCALL
xsltNewStyleDocument (xsltStylesheetPtr style, xsltNewStyleDocument (xsltStylesheetPtr style,
xmlDocPtr doc); xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeStyleDocuments (xsltStylesheetPtr style); xsltFreeStyleDocuments (xsltStylesheetPtr style);
/* /*
* Hooks for document loading * Hooks for document loading

View file

@ -44,9 +44,9 @@
#endif #endif
/************************************************************************ /************************************************************************
* * * *
* Private Types and Globals * * Private Types and Globals *
* * * *
************************************************************************/ ************************************************************************/
typedef struct _xsltExtDef xsltExtDef; typedef struct _xsltExtDef xsltExtDef;
@ -89,9 +89,9 @@ static xmlHashTablePtr xsltModuleHash = NULL;
static xmlMutexPtr xsltExtMutex = NULL; static xmlMutexPtr xsltExtMutex = NULL;
/************************************************************************ /************************************************************************
* * * *
* Type functions * * Type functions *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -302,18 +302,18 @@ typedef void (*exsltRegisterFunction) (void);
* @URI: the function or element namespace URI * @URI: the function or element namespace URI
* *
* Dynamically loads an extension plugin when available. * Dynamically loads an extension plugin when available.
* *
* The plugin name is derived from the URI by removing the * The plugin name is derived from the URI by removing the
* initial protocol designation, e.g. "http://", then converting * initial protocol designation, e.g. "http://", then converting
* the characters ".", "-", "/", and "\" into "_", the removing * the characters ".", "-", "/", and "\" into "_", the removing
* any trailing "/", then concatenating LIBXML_MODULE_EXTENSION. * any trailing "/", then concatenating LIBXML_MODULE_EXTENSION.
* *
* Plugins are loaded from the directory specified by the * Plugins are loaded from the directory specified by the
* environment variable LIBXSLT_PLUGINS_PATH, or if NULL, * environment variable LIBXSLT_PLUGINS_PATH, or if NULL,
* by LIBXSLT_DEFAULT_PLUGINS_PATH() which is determined at * by LIBXSLT_DEFAULT_PLUGINS_PATH() which is determined at
* compile time. * compile time.
* *
* Returns 0 if successful, -1 in case of error. * Returns 0 if successful, -1 in case of error.
*/ */
static int static int
@ -391,7 +391,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
#ifdef WITH_XSLT_DEBUG_EXTENSIONS #ifdef WITH_XSLT_DEBUG_EXTENSIONS
xsltGenericDebug(xsltGenericDebugContext, xsltGenericDebug(xsltGenericDebugContext,
"Attempting to load plugin: %s for URI: %s\n", "Attempting to load plugin: %s for URI: %s\n",
module_filename, URI); module_filename, URI);
#endif #endif
@ -442,7 +442,7 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
#ifdef WITH_XSLT_DEBUG_EXTENSIONS #ifdef WITH_XSLT_DEBUG_EXTENSIONS
xsltGenericDebug(xsltGenericDebugContext, xsltGenericDebug(xsltGenericDebugContext,
"xmlModuleSymbol failed for plugin: %s, regfunc: %s\n", "xmlModuleSymbol failed for plugin: %s, regfunc: %s\n",
module_filename, regfunc_name); module_filename, regfunc_name);
#endif #endif
@ -463,9 +463,9 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI ATTRIBUTE_UNUSED)
#endif #endif
/************************************************************************ /************************************************************************
* * * *
* The stylesheet extension prefixes handling * * The stylesheet extension prefixes handling *
* * * *
************************************************************************/ ************************************************************************/
@ -487,7 +487,7 @@ xsltFreeExts(xsltStylesheetPtr style)
* @style: an XSLT stylesheet * @style: an XSLT stylesheet
* @prefix: the prefix used (optional) * @prefix: the prefix used (optional)
* @URI: the URI associated to the extension * @URI: the URI associated to the extension
* *
* Registers an extension namespace * Registers an extension namespace
* This is called from xslt.c during compile-time. * This is called from xslt.c during compile-time.
* The given prefix is not needed. * The given prefix is not needed.
@ -567,9 +567,9 @@ xsltRegisterExtPrefix(xsltStylesheetPtr style,
} }
/************************************************************************ /************************************************************************
* * * *
* The extensions modules interfaces * * The extensions modules interfaces *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -577,7 +577,7 @@ xsltRegisterExtPrefix(xsltStylesheetPtr style,
* @ctxt: an XSLT transformation context * @ctxt: an XSLT transformation context
* @name: the name of the element * @name: the name of the element
* @URI: the URI associated to the element * @URI: the URI associated to the element
* @function: the actual implementation which should be called * @function: the actual implementation which should be called
* *
* Registers an extension function * Registers an extension function
* *
@ -611,7 +611,7 @@ xsltRegisterExtFunction(xsltTransformContextPtr ctxt, const xmlChar * name,
* @ctxt: an XSLT transformation context * @ctxt: an XSLT transformation context
* @name: the name of the element * @name: the name of the element
* @URI: the URI associated to the element * @URI: the URI associated to the element
* @function: the actual implementation which should be called * @function: the actual implementation which should be called
* *
* Registers an extension element * Registers an extension element
* *
@ -666,8 +666,8 @@ xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style,
xsltExtDataPtr dataContainer; xsltExtDataPtr dataContainer;
void *userData = NULL; void *userData = NULL;
xsltExtModulePtr module; xsltExtModulePtr module;
if ((style == NULL) || (URI == NULL)) if ((style == NULL) || (URI == NULL))
return(NULL); return(NULL);
if (xsltExtensionsHash == NULL) { if (xsltExtensionsHash == NULL) {
@ -716,7 +716,7 @@ xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style,
* Fire the initialization callback. * Fire the initialization callback.
*/ */
userData = module->styleInitFunc(style, URI); userData = module->styleInitFunc(style, URI);
} }
/* /*
* Store the user-data in the context of the given stylesheet. * Store the user-data in the context of the given stylesheet.
*/ */
@ -727,7 +727,7 @@ xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style,
if (xmlHashAddEntry(style->extInfos, URI, if (xmlHashAddEntry(style->extInfos, URI,
(void *) dataContainer) < 0) (void *) dataContainer) < 0)
{ {
xsltTransformError(NULL, style, NULL, xsltTransformError(NULL, style, NULL,
"Failed to register module '%s'.\n", URI); "Failed to register module '%s'.\n", URI);
style->errors++; style->errors++;
if (module->styleShutdownFunc) if (module->styleShutdownFunc)
@ -762,7 +762,7 @@ xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI)
(xsltExtensionsHash == NULL)) (xsltExtensionsHash == NULL))
return (NULL); return (NULL);
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
/* /*
* This is intended for global storage, so only the main * This is intended for global storage, so only the main
@ -838,7 +838,7 @@ xsltStyleStylesheetLevelGetExtData(xsltStylesheetPtr style,
*/ */
if (dataContainer) if (dataContainer)
return(dataContainer->extData); return(dataContainer->extData);
} }
dataContainer = dataContainer =
xsltStyleInitializeStylesheetModule(style, URI); xsltStyleInitializeStylesheetModule(style, URI);
@ -1120,7 +1120,7 @@ xsltShutdownExt(xsltExtDataPtr data, xsltStylesheetPtr style,
* *
* xmlHashRemoveEntry(style->extInfos, URI, * xmlHashRemoveEntry(style->extInfos, URI,
* (xmlHashDeallocator) xsltFreeExtData); * (xmlHashDeallocator) xsltFreeExtData);
*/ */
} }
/** /**
@ -1156,12 +1156,12 @@ xsltShutdownExts(xsltStylesheetPtr style)
*/ */
int int
xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar * URI) xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar * URI)
{ {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
if ((style == NULL) || (style->compCtxt == NULL) || if ((style == NULL) || (style->compCtxt == NULL) ||
(XSLT_CCTXT(style)->inode == NULL) || (XSLT_CCTXT(style)->inode == NULL) ||
(XSLT_CCTXT(style)->inode->extElemNs == NULL)) (XSLT_CCTXT(style)->inode->extElemNs == NULL))
return (0); return (0);
/* /*
* Lookup the extension namespaces registered * Lookup the extension namespaces registered
* at the current node in the stylesheet's tree. * at the current node in the stylesheet's tree.
@ -1175,7 +1175,7 @@ xsltCheckExtPrefix(xsltStylesheetPtr style, const xmlChar * URI)
URI)) URI))
{ {
return(1); return(1);
} }
} }
} }
#else #else
@ -1950,15 +1950,15 @@ xsltGetExtInfo(xsltStylesheetPtr style, const xmlChar * URI)
} }
/************************************************************************ /************************************************************************
* * * *
* Test module http://xmlsoft.org/XSLT/ * * Test module http://xmlsoft.org/XSLT/ *
* * * *
************************************************************************/ ************************************************************************/
/************************************************************************ /************************************************************************
* * * *
* Test of the extension module API * * Test of the extension module API *
* * * *
************************************************************************/ ************************************************************************/
static xmlChar *testData = NULL; static xmlChar *testData = NULL;

View file

@ -40,9 +40,9 @@
#endif #endif
/************************************************************************ /************************************************************************
* * * *
* Handling of XSLT debugging * * Handling of XSLT debugging *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -112,9 +112,9 @@ xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
} }
/************************************************************************ /************************************************************************
* * * *
* Classic extensions as described by M. Kay * * Classic extensions as described by M. Kay *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -178,14 +178,14 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) {
time_t gmt, lmt; time_t gmt, lmt;
struct tm gmt_tm; struct tm gmt_tm;
struct tm *local_tm; struct tm *local_tm;
if (nargs != 1) { if (nargs != 1) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL, xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"localTime() : invalid number of args %d\n", nargs); "localTime() : invalid number of args %d\n", nargs);
ctxt->error = XPATH_INVALID_ARITY; ctxt->error = XPATH_INVALID_ARITY;
return; return;
} }
obj = valuePop(ctxt); obj = valuePop(ctxt);
if (obj->type != XPATH_STRING) { if (obj->type != XPATH_STRING) {
@ -195,7 +195,7 @@ xsltFunctionLocalTime(xmlXPathParserContextPtr ctxt, int nargs) {
valuePush(ctxt, xmlXPathNewString((const xmlChar *)"")); valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
return; return;
} }
str = (char *) obj->stringval; str = (char *) obj->stringval;
/* str = "$Date$" */ /* str = "$Date$" */

View file

@ -60,16 +60,16 @@ extern "C" {
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt, xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltDebug (xsltTransformContextPtr ctxt, xsltDebug (xsltTransformContextPtr ctxt,
xmlNodePtr node, xmlNodePtr node,
xmlNodePtr inst, xmlNodePtr inst,
xsltStylePreCompPtr comp); xsltStylePreCompPtr comp);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltRegisterExtras (xsltTransformContextPtr ctxt); xsltRegisterExtras (xsltTransformContextPtr ctxt);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltRegisterAllExtras (void); xsltRegisterAllExtras (void);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -118,16 +118,16 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
"document() : internal error tctxt == NULL\n"); "document() : internal error tctxt == NULL\n");
valuePush(ctxt, xmlXPathNewNodeSet(NULL)); valuePush(ctxt, xmlXPathNewNodeSet(NULL));
return; return;
} }
uri = xmlParseURI((const char *) URI); uri = xmlParseURI((const char *) URI);
if (uri == NULL) { if (uri == NULL) {
xsltTransformError(tctxt, NULL, NULL, xsltTransformError(tctxt, NULL, NULL,
"document() : failed to parse URI\n"); "document() : failed to parse URI\n");
valuePush(ctxt, xmlXPathNewNodeSet(NULL)); valuePush(ctxt, xmlXPathNewNodeSet(NULL));
return; return;
} }
/* /*
* check for and remove fragment identifier * check for and remove fragment identifier
*/ */
@ -141,12 +141,12 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
} else } else
idoc = xsltLoadDocument(tctxt, URI); idoc = xsltLoadDocument(tctxt, URI);
xmlFreeURI(uri); xmlFreeURI(uri);
if (idoc == NULL) { if (idoc == NULL) {
if ((URI == NULL) || if ((URI == NULL) ||
(URI[0] == '#') || (URI[0] == '#') ||
((tctxt->style->doc != NULL) && ((tctxt->style->doc != NULL) &&
(xmlStrEqual(tctxt->style->doc->URL, URI)))) (xmlStrEqual(tctxt->style->doc->URL, URI))))
{ {
/* /*
* This selects the stylesheet's doc itself. * This selects the stylesheet's doc itself.
@ -167,7 +167,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
valuePush(ctxt, xmlXPathNewNodeSet((xmlNodePtr) doc)); valuePush(ctxt, xmlXPathNewNodeSet((xmlNodePtr) doc));
return; return;
} }
/* use XPointer of HTML location for fragment ID */ /* use XPointer of HTML location for fragment ID */
#ifdef LIBXML_XPTR_ENABLED #ifdef LIBXML_XPTR_ENABLED
xptrctxt = xmlXPtrNewContext(doc, NULL, NULL); xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
@ -180,11 +180,11 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
resObj = xmlXPtrEval(fragment, xptrctxt); resObj = xmlXPtrEval(fragment, xptrctxt);
xmlXPathFreeContext(xptrctxt); xmlXPathFreeContext(xptrctxt);
#endif #endif
xmlFree(fragment); xmlFree(fragment);
if (resObj == NULL) if (resObj == NULL)
goto out_fragment; goto out_fragment;
switch (resObj->type) { switch (resObj->type) {
case XPATH_NODESET: case XPATH_NODESET:
break; break;
@ -198,11 +198,11 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
case XPATH_RANGE: case XPATH_RANGE:
case XPATH_LOCATIONSET: case XPATH_LOCATIONSET:
xsltTransformError(tctxt, NULL, NULL, xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n", "document() : XPointer does not select a node set: #%s\n",
fragment); fragment);
goto out_object; goto out_object;
} }
valuePush(ctxt, resObj); valuePush(ctxt, resObj);
return; return;
@ -349,15 +349,15 @@ xsltDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs)
* node-set key(string, object) * node-set key(string, object)
*/ */
void void
xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlXPathObjectPtr obj1, obj2; xmlXPathObjectPtr obj1, obj2;
if (nargs != 2) { if (nargs != 2) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL, xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"key() : expects two arguments\n"); "key() : expects two arguments\n");
ctxt->error = XPATH_INVALID_ARITY; ctxt->error = XPATH_INVALID_ARITY;
return; return;
} }
/* /*
* Get the key's value. * Get the key's value.
@ -376,7 +376,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
/* /*
* Get the key's name. * Get the key's name.
*/ */
obj1 = valuePop(ctxt); obj1 = valuePop(ctxt);
if ((obj2->type == XPATH_NODESET) || (obj2->type == XPATH_XSLT_TREE)) { if ((obj2->type == XPATH_NODESET) || (obj2->type == XPATH_XSLT_TREE)) {
int i; int i;
@ -402,7 +402,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlNodeSetPtr nodelist = NULL; xmlNodeSetPtr nodelist = NULL;
xmlChar *key = NULL, *value; xmlChar *key = NULL, *value;
const xmlChar *keyURI; const xmlChar *keyURI;
xsltTransformContextPtr tctxt; xsltTransformContextPtr tctxt;
xmlChar *qname, *prefix; xmlChar *qname, *prefix;
xmlXPathContextPtr xpctxt = ctxt->context; xmlXPathContextPtr xpctxt = ctxt->context;
xmlNodePtr tmpNode = NULL; xmlNodePtr tmpNode = NULL;
@ -418,7 +418,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
"The context node is not set on the XPath context.\n"); "The context node is not set on the XPath context.\n");
tctxt->state = XSLT_STATE_STOPPED; tctxt->state = XSLT_STATE_STOPPED;
goto error; goto error;
} }
/* /*
* Get the associated namespace URI if qualified name * Get the associated namespace URI if qualified name
*/ */
@ -458,7 +458,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
} }
obj2 = valuePop(ctxt); obj2 = valuePop(ctxt);
value = obj2->stringval; value = obj2->stringval;
/* /*
* We need to ensure that ctxt->document is available for * We need to ensure that ctxt->document is available for
* xsltGetKey(). * xsltGetKey().
@ -468,7 +468,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
* or the doc might be a Result Tree Fragment. * or the doc might be a Result Tree Fragment.
* FUTURE INFO: In XSLT 2.0 the key() function takes an additional * FUTURE INFO: In XSLT 2.0 the key() function takes an additional
* argument indicating the doc to use. * argument indicating the doc to use.
*/ */
if (xpctxt->node->type == XML_NAMESPACE_DECL) { if (xpctxt->node->type == XML_NAMESPACE_DECL) {
/* /*
* REVISIT: This is a libxml hack! Check xpath.c for details. * REVISIT: This is a libxml hack! Check xpath.c for details.
@ -492,7 +492,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
if ((tctxt->document == NULL) || if ((tctxt->document == NULL) ||
(tctxt->document->doc != tmpNode->doc)) (tctxt->document->doc != tmpNode->doc))
{ {
if (tmpNode->doc->name && (tmpNode->doc->name[0] == ' ')) { if (tmpNode->doc->name && (tmpNode->doc->name[0] == ' ')) {
/* /*
* This is a Result Tree Fragment. * This is a Result Tree Fragment.
@ -502,7 +502,7 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
if (tmpNode->doc->_private == NULL) if (tmpNode->doc->_private == NULL)
goto error; goto error;
} }
tctxt->document = (xsltDocumentPtr) tmpNode->doc->_private; tctxt->document = (xsltDocumentPtr) tmpNode->doc->_private;
} else { } else {
/* /*
* May be the initial source doc or a doc acquired via the * May be the initial source doc or a doc acquired via the
@ -523,18 +523,18 @@ xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
*/ */
nodelist = xsltGetKey(tctxt, key, keyURI, value); nodelist = xsltGetKey(tctxt, key, keyURI, value);
error: error:
tctxt->document = oldDocInfo; tctxt->document = oldDocInfo;
valuePush(ctxt, xmlXPathWrapNodeSet( valuePush(ctxt, xmlXPathWrapNodeSet(
xmlXPathNodeSetMerge(NULL, nodelist))); xmlXPathNodeSetMerge(NULL, nodelist)));
if (key != NULL) if (key != NULL)
xmlFree(key); xmlFree(key);
} }
if (obj1 != NULL) if (obj1 != NULL)
xmlXPathFreeObject(obj1); xmlXPathFreeObject(obj1);
if (obj2 != NULL) if (obj2 != NULL)
xmlXPathFreeObject(obj2); xmlXPathFreeObject(obj2);
} }
/** /**
@ -606,7 +606,7 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
if (sheet == NULL) if (sheet == NULL)
return; return;
formatValues = sheet->decimalFormat; formatValues = sheet->decimalFormat;
switch (nargs) { switch (nargs) {
case 3: case 3:
CAST_TO_STRING; CAST_TO_STRING;
@ -614,7 +614,7 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
formatValues = xsltDecimalFormatGetByName(sheet, decimalObj->stringval); formatValues = xsltDecimalFormatGetByName(sheet, decimalObj->stringval);
if (formatValues == NULL) { if (formatValues == NULL) {
xsltTransformError(tctxt, NULL, NULL, xsltTransformError(tctxt, NULL, NULL,
"format-number() : undeclared decimal format '%s'\n", "format-number() : undeclared decimal format '%s'\n",
decimalObj->stringval); decimalObj->stringval);
} }
/* Intentional fall-through */ /* Intentional fall-through */
@ -941,9 +941,9 @@ xsltCurrentFunction(xmlXPathParserContextPtr ctxt, int nargs){
} }
/************************************************************************ /************************************************************************
* * * *
* Registration of XSLT and libxslt functions * * Registration of XSLT and libxslt functions *
* * * *
************************************************************************/ ************************************************************************/
/** /**

View file

@ -38,28 +38,28 @@ XSLTPUBFUN xmlXPathFunction XSLTCALL
* Interfaces for the functions implementations. * Interfaces for the functions implementations.
*/ */
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltDocumentFunction (xmlXPathParserContextPtr ctxt, xsltDocumentFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltKeyFunction (xmlXPathParserContextPtr ctxt, xsltKeyFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt, xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt, xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt, xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt, xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt, xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt, xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
int nargs); int nargs);
@ -67,7 +67,7 @@ XSLTPUBFUN void XSLTCALL
* And the registration * And the registration
*/ */
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltRegisterAllFunctions (xmlXPathContextPtr ctxt); xsltRegisterAllFunctions (xmlXPathContextPtr ctxt);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -59,10 +59,10 @@
* @style: the stylesheet being imported by the master * @style: the stylesheet being imported by the master
* *
* normalize the comp steps for the stylesheet being imported * normalize the comp steps for the stylesheet being imported
* by the master, together with any imports within that. * by the master, together with any imports within that.
* *
*/ */
static void xsltFixImportedCompSteps(xsltStylesheetPtr master, static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
xsltStylesheetPtr style) { xsltStylesheetPtr style) {
xsltStylesheetPtr res; xsltStylesheetPtr res;
xmlHashScan(style->templatesHash, xmlHashScan(style->templatesHash,
@ -230,7 +230,7 @@ xsltParseStylesheetInclude(xsltStylesheetPtr style, xmlNodePtr cur) {
"xsl:include : unable to load %s\n", URI); "xsl:include : unable to load %s\n", URI);
goto error; goto error;
} }
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
if (IS_XSLT_ELEM_FAST(cur) && (cur->psvi != NULL)) { if (IS_XSLT_ELEM_FAST(cur) && (cur->psvi != NULL)) {
((xsltStyleItemIncludePtr) cur->psvi)->include = include; ((xsltStyleItemIncludePtr) cur->psvi)->include = include;
} else { } else {

View file

@ -48,21 +48,21 @@ extern "C" {
/* /*
* Module interfaces * Module interfaces
*/ */
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltParseStylesheetImport(xsltStylesheetPtr style, xsltParseStylesheetImport(xsltStylesheetPtr style,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltParseStylesheetInclude xsltParseStylesheetInclude
(xsltStylesheetPtr style, (xsltStylesheetPtr style,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltNextImport (xsltStylesheetPtr style); xsltNextImport (xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt); xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt,
xmlNodePtr node); xmlNodePtr node);
XSLTPUBFUN xsltTemplatePtr XSLTCALL XSLTPUBFUN xsltTemplatePtr XSLTCALL
xsltFindTemplate (xsltTransformContextPtr ctxt, xsltFindTemplate (xsltTransformContextPtr ctxt,
const xmlChar *name, const xmlChar *name,
const xmlChar *nameURI); const xmlChar *nameURI);

View file

@ -37,9 +37,9 @@ xsltInitDocKeyTable(xsltTransformContextPtr ctxt, const xmlChar *name,
const xmlChar *nameURI); const xmlChar *nameURI);
/************************************************************************ /************************************************************************
* * * *
* Type functions * * Type functions *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -158,7 +158,7 @@ xsltFreeKeyTable(xsltKeyTablePtr keyt) {
if (keyt->nameURI != NULL) if (keyt->nameURI != NULL)
xmlFree(keyt->nameURI); xmlFree(keyt->nameURI);
if (keyt->keys != NULL) if (keyt->keys != NULL)
xmlHashFree(keyt->keys, xmlHashFree(keyt->keys,
(xmlHashDeallocator) xmlXPathFreeNodeSet); (xmlHashDeallocator) xmlXPathFreeNodeSet);
memset(keyt, -1, sizeof(xsltKeyTable)); memset(keyt, -1, sizeof(xsltKeyTable));
xmlFree(keyt); xmlFree(keyt);
@ -182,9 +182,9 @@ xsltFreeKeyTableList(xsltKeyTablePtr keyt) {
} }
/************************************************************************ /************************************************************************
* * * *
* The interpreter for the precompiled patterns * * The interpreter for the precompiled patterns *
* * * *
************************************************************************/ ************************************************************************/
@ -311,8 +311,8 @@ xsltAddKey(xsltStylesheetPtr style, const xmlChar *name,
end = skipPredicate(match, end); end = skipPredicate(match, end);
if (end <= 0) { if (end <= 0) {
xsltTransformError(NULL, style, inst, xsltTransformError(NULL, style, inst,
"key pattern is malformed: %s", "key pattern is malformed: %s",
key->match); key->match);
if (style != NULL) style->errors++; if (style != NULL) style->errors++;
goto error; goto error;
} }

View file

@ -32,17 +32,17 @@ XSLTPUBFUN int XSLTCALL
const xmlChar *match, const xmlChar *match,
const xmlChar *use, const xmlChar *use,
xmlNodePtr inst); xmlNodePtr inst);
XSLTPUBFUN xmlNodeSetPtr XSLTCALL XSLTPUBFUN xmlNodeSetPtr XSLTCALL
xsltGetKey (xsltTransformContextPtr ctxt, xsltGetKey (xsltTransformContextPtr ctxt,
const xmlChar *name, const xmlChar *name,
const xmlChar *nameURI, const xmlChar *nameURI,
const xmlChar *value); const xmlChar *value);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltInitCtxtKeys (xsltTransformContextPtr ctxt, xsltInitCtxtKeys (xsltTransformContextPtr ctxt,
xsltDocumentPtr doc); xsltDocumentPtr doc);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeKeys (xsltStylesheetPtr style); xsltFreeKeys (xsltStylesheetPtr style);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeDocumentKeys (xsltDocumentPtr doc); xsltFreeDocumentKeys (xsltDocumentPtr doc);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -55,7 +55,7 @@
* * * *
************************************************************************/ ************************************************************************/
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
static xsltNsAliasPtr static xsltNsAliasPtr
xsltNewNsAlias(xsltCompilerCtxtPtr cctxt) xsltNewNsAlias(xsltCompilerCtxtPtr cctxt)
{ {
@ -71,12 +71,12 @@ xsltNewNsAlias(xsltCompilerCtxtPtr cctxt)
cctxt->style->errors++; cctxt->style->errors++;
return(NULL); return(NULL);
} }
memset(ret, 0, sizeof(xsltNsAlias)); memset(ret, 0, sizeof(xsltNsAlias));
/* /*
* TODO: Store the item at current stylesheet-level. * TODO: Store the item at current stylesheet-level.
*/ */
ret->next = cctxt->nsAliases; ret->next = cctxt->nsAliases;
cctxt->nsAliases = ret; cctxt->nsAliases = ret;
return(ret); return(ret);
} }
@ -96,8 +96,8 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
xmlChar *stylePrefix = NULL; xmlChar *stylePrefix = NULL;
xmlNsPtr literalNs = NULL; xmlNsPtr literalNs = NULL;
xmlNsPtr targetNs = NULL; xmlNsPtr targetNs = NULL;
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
xsltNsAliasPtr alias; xsltNsAliasPtr alias;
if ((style == NULL) || (node == NULL)) if ((style == NULL) || (node == NULL))
@ -118,9 +118,9 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
/* /*
* NOTE that the XSLT 2.0 also *does* use the NULL namespace if * NOTE that the XSLT 2.0 also *does* use the NULL namespace if
* "#default" is used and there's no default namespace is scope. * "#default" is used and there's no default namespace is scope.
* I.e., this is *not* an error. * I.e., this is *not* an error.
* Most XSLT 1.0 implementations work this way. * Most XSLT 1.0 implementations work this way.
* The XSLT 1.0 spec has nothing to say on the subject. * The XSLT 1.0 spec has nothing to say on the subject.
*/ */
/* /*
* Attribute "stylesheet-prefix". * Attribute "stylesheet-prefix".
@ -132,7 +132,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
return; return;
} }
if (xmlStrEqual(stylePrefix, (const xmlChar *)"#default")) if (xmlStrEqual(stylePrefix, (const xmlChar *)"#default"))
literalNs = xmlSearchNs(node->doc, node, NULL); literalNs = xmlSearchNs(node->doc, node, NULL);
else { else {
literalNs = xmlSearchNs(node->doc, node, stylePrefix); literalNs = xmlSearchNs(node->doc, node, stylePrefix);
if (literalNs == NULL) { if (literalNs == NULL) {
@ -151,7 +151,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
xsltTransformError(NULL, style, node, xsltTransformError(NULL, style, node,
"The attribute 'result-prefix' is missing.\n"); "The attribute 'result-prefix' is missing.\n");
goto error; goto error;
} }
if (xmlStrEqual(resultPrefix, (const xmlChar *)"#default")) if (xmlStrEqual(resultPrefix, (const xmlChar *)"#default"))
targetNs = xmlSearchNs(node->doc, node, NULL); targetNs = xmlSearchNs(node->doc, node, NULL);
else { else {
@ -197,8 +197,8 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
* result-prefix="foo"/> * result-prefix="foo"/>
* From no namespace to namespace. * From no namespace to namespace.
*/ */
/* /*
* Store the ns-node in the alias-object. * Store the ns-node in the alias-object.
*/ */
@ -213,7 +213,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
#else /* XSLT_REFACTORED */ #else /* XSLT_REFACTORED */
const xmlChar *literalNsName; const xmlChar *literalNsName;
const xmlChar *targetNsName; const xmlChar *targetNsName;
if ((style == NULL) || (node == NULL)) if ((style == NULL) || (node == NULL))
return; return;
@ -230,7 +230,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
"namespace-alias: result-prefix attribute missing\n"); "namespace-alias: result-prefix attribute missing\n");
goto error; goto error;
} }
if (xmlStrEqual(stylePrefix, (const xmlChar *)"#default")) { if (xmlStrEqual(stylePrefix, (const xmlChar *)"#default")) {
literalNs = xmlSearchNs(node->doc, node, NULL); literalNs = xmlSearchNs(node->doc, node, NULL);
if (literalNs == NULL) { if (literalNs == NULL) {
@ -239,7 +239,7 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
literalNsName = literalNs->href; /* Yes - set for nsAlias table */ literalNsName = literalNs->href; /* Yes - set for nsAlias table */
} else { } else {
literalNs = xmlSearchNs(node->doc, node, stylePrefix); literalNs = xmlSearchNs(node->doc, node, stylePrefix);
if ((literalNs == NULL) || (literalNs->href == NULL)) { if ((literalNs == NULL) || (literalNs->href == NULL)) {
xsltTransformError(NULL, style, node, xsltTransformError(NULL, style, node,
"namespace-alias: prefix %s not bound to any namespace\n", "namespace-alias: prefix %s not bound to any namespace\n",
@ -275,13 +275,13 @@ xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
* Special case: if #default is used for * Special case: if #default is used for
* the stylesheet-prefix (literal namespace) and there's no default * the stylesheet-prefix (literal namespace) and there's no default
* namespace in scope, we'll use style->defaultAlias for this. * namespace in scope, we'll use style->defaultAlias for this.
*/ */
if (literalNsName == NULL) { if (literalNsName == NULL) {
if (targetNs != NULL) { if (targetNs != NULL) {
/* /*
* BUG TODO: Is it not sufficient to have only 1 field for * BUG TODO: Is it not sufficient to have only 1 field for
* this, since subsequently alias declarations will * this, since subsequently alias declarations will
* overwrite this. * overwrite this.
* Example: * Example:
* <xsl:namespace-alias result-prefix="foo" * <xsl:namespace-alias result-prefix="foo"
* stylesheet-prefix="#default"/> * stylesheet-prefix="#default"/>
@ -358,7 +358,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
/* /*
* OPTIMIZE TODO: This all could be optimized by keeping track of * OPTIMIZE TODO: This all could be optimized by keeping track of
* the ns-decls currently in-scope via a specialized context. * the ns-decls currently in-scope via a specialized context.
*/ */
if ((nsPrefix == NULL) && ((nsName == NULL) || (nsName[0] == 0))) { if ((nsPrefix == NULL) && ((nsName == NULL) || (nsName[0] == 0))) {
/* /*
* NOTE: the "undeclaration" of the default namespace was * NOTE: the "undeclaration" of the default namespace was
@ -398,7 +398,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
} }
ns = ns->next; ns = ns->next;
} while (ns != NULL); } while (ns != NULL);
} }
if ((target->parent != NULL) && if ((target->parent != NULL) &&
(target->parent->type == XML_ELEMENT_NODE)) (target->parent->type == XML_ELEMENT_NODE))
{ {
@ -408,7 +408,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
*/ */
if (target->parent->ns == NULL) if (target->parent->ns == NULL)
return(NULL); return(NULL);
ns = xmlSearchNs(target->doc, target->parent, ns = xmlSearchNs(target->doc, target->parent,
NULL); NULL);
/* /*
@ -417,12 +417,12 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
*/ */
if ((ns == NULL) || (ns->href == NULL) || (ns->href[0] == 0)) if ((ns == NULL) || (ns->href == NULL) || (ns->href[0] == 0))
return(NULL); return(NULL);
/* /*
* Undeclare the default namespace. * Undeclare the default namespace.
*/ */
xmlNewNs(target, BAD_CAST "", NULL); xmlNewNs(target, BAD_CAST "", NULL);
/* TODO: Check result */ /* TODO: Check result */
return(NULL); return(NULL);
} }
return(NULL); return(NULL);
@ -464,7 +464,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
* If the ns-prefix is occupied by an other ns-decl on the * If the ns-prefix is occupied by an other ns-decl on the
* result element, then this means: * result element, then this means:
* 1) The desired prefix is shadowed * 1) The desired prefix is shadowed
* 2) There's no way around changing the prefix * 2) There's no way around changing the prefix
* *
* Try a desperate search for an in-scope ns-decl * Try a desperate search for an in-scope ns-decl
* with a matching ns-name before we use the last option, * with a matching ns-name before we use the last option,
@ -476,7 +476,7 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
/* /*
* Fallback to changing the prefix. * Fallback to changing the prefix.
*/ */
} else if ((target->parent != NULL) && } else if ((target->parent != NULL) &&
(target->parent->type == XML_ELEMENT_NODE)) (target->parent->type == XML_ELEMENT_NODE))
{ {
@ -485,12 +485,12 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
* *
* Check the common case: The parent element of the current * Check the common case: The parent element of the current
* result element is in the same namespace (with an equal ns-prefix). * result element is in the same namespace (with an equal ns-prefix).
*/ */
if ((target->parent->ns != NULL) && if ((target->parent->ns != NULL) &&
((target->parent->ns->prefix != NULL) == (nsPrefix != NULL))) ((target->parent->ns->prefix != NULL) == (nsPrefix != NULL)))
{ {
ns = target->parent->ns; ns = target->parent->ns;
if (nsPrefix == NULL) { if (nsPrefix == NULL) {
if (xmlStrEqual(ns->href, nsName)) if (xmlStrEqual(ns->href, nsName))
return(ns); return(ns);
@ -502,11 +502,11 @@ xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode,
} }
/* /*
* Lookup the remaining in-scope namespaces. * Lookup the remaining in-scope namespaces.
*/ */
ns = xmlSearchNs(target->doc, target->parent, nsPrefix); ns = xmlSearchNs(target->doc, target->parent, nsPrefix);
if (ns != NULL) { if (ns != NULL) {
if (xmlStrEqual(ns->href, nsName)) if (xmlStrEqual(ns->href, nsName))
return(ns); return(ns);
/* /*
* Now check for a nasty case: We need to ensure that the new * Now check for a nasty case: We need to ensure that the new
* ns-decl won't shadow a prefix in-use by an existing attribute. * ns-decl won't shadow a prefix in-use by an existing attribute.
@ -633,8 +633,8 @@ declare_new_prefix:
xmlNsPtr xmlNsPtr
xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns, xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
xmlNodePtr out) xmlNodePtr out)
{ {
if (ns == NULL) if (ns == NULL)
return(NULL); return(NULL);
@ -657,15 +657,15 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
style = ctxt->style; style = ctxt->style;
while (style != NULL) { while (style != NULL) {
if (style->nsAliases != NULL) if (style->nsAliases != NULL)
URI = (const xmlChar *) URI = (const xmlChar *)
xmlHashLookup(style->nsAliases, ns->href); xmlHashLookup(style->nsAliases, ns->href);
if (URI != NULL) if (URI != NULL)
break; break;
style = xsltNextImport(style); style = xsltNextImport(style);
} }
if (URI == UNDEFINED_DEFAULT_NS) { if (URI == UNDEFINED_DEFAULT_NS) {
return(xsltGetSpecialNamespace(ctxt, cur, NULL, NULL, out)); return(xsltGetSpecialNamespace(ctxt, cur, NULL, NULL, out));
#if 0 #if 0
@ -674,7 +674,7 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
* namespace in the stylesheet then this must resolve to * namespace in the stylesheet then this must resolve to
* the NULL namespace. * the NULL namespace.
*/ */
xmlNsPtr dflt; xmlNsPtr dflt;
dflt = xmlSearchNs(cur->doc, cur, NULL); dflt = xmlSearchNs(cur->doc, cur, NULL);
if (dflt != NULL) if (dflt != NULL)
URI = dflt->href; URI = dflt->href;
@ -696,9 +696,9 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
* @ns: the namespace * @ns: the namespace
* @out: the result element * @out: the result element
* *
* Obsolete. * Obsolete.
* *Not* called by any Libxslt/Libexslt function. * *Not* called by any Libxslt/Libexslt function.
* Exaclty the same as xsltGetNamespace(). * Exaclty the same as xsltGetNamespace().
* *
* Returns a namespace declaration or NULL in case of * Returns a namespace declaration or NULL in case of
* namespace fixup failures or API or internal errors. * namespace fixup failures or API or internal errors.
@ -706,7 +706,7 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns,
xmlNsPtr xmlNsPtr
xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur,
xmlNsPtr ns, xmlNodePtr out) xmlNsPtr ns, xmlNodePtr out)
{ {
return(xsltGetNamespace(ctxt, cur, ns, out)); return(xsltGetNamespace(ctxt, cur, ns, out));
} }
@ -722,7 +722,7 @@ xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur,
* This function is intended only for *internal* use at * This function is intended only for *internal* use at
* transformation-time for copying ns-declarations of Literal * transformation-time for copying ns-declarations of Literal
* Result Elements. * Result Elements.
* *
* Called by: * Called by:
* xsltCopyTreeInternal() (transform.c) * xsltCopyTreeInternal() (transform.c)
* xsltShallowCopyElem() (transform.c) * xsltShallowCopyElem() (transform.c)
@ -735,7 +735,7 @@ xmlNsPtr
xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node, xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNsPtr cur) { xmlNsPtr cur) {
xmlNsPtr ret = NULL, tmp; xmlNsPtr ret = NULL, tmp;
xmlNsPtr p = NULL,q; xmlNsPtr p = NULL,q;
if (cur == NULL) if (cur == NULL)
return(NULL); return(NULL);
@ -759,7 +759,7 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
if (node != NULL) { if (node != NULL) {
if ((node->ns != NULL) && if ((node->ns != NULL) &&
(xmlStrEqual(node->ns->prefix, cur->prefix)) && (xmlStrEqual(node->ns->prefix, cur->prefix)) &&
(xmlStrEqual(node->ns->href, cur->href))) { (xmlStrEqual(node->ns->href, cur->href))) {
cur = cur->next; cur = cur->next;
continue; continue;
} }
@ -824,7 +824,7 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
xmlNsPtr xmlNsPtr
xsltCopyNamespace(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, xsltCopyNamespace(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
xmlNodePtr elem, xmlNsPtr ns) xmlNodePtr elem, xmlNsPtr ns)
{ {
if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
return(NULL); return(NULL);
/* /*

View file

@ -32,31 +32,31 @@ extern "C" {
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltNamespaceAlias (xsltStylesheetPtr style, xsltNamespaceAlias (xsltStylesheetPtr style,
xmlNodePtr node); xmlNodePtr node);
XSLTPUBFUN xmlNsPtr XSLTCALL XSLTPUBFUN xmlNsPtr XSLTCALL
xsltGetNamespace (xsltTransformContextPtr ctxt, xsltGetNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr cur, xmlNodePtr cur,
xmlNsPtr ns, xmlNsPtr ns,
xmlNodePtr out); xmlNodePtr out);
XSLTPUBFUN xmlNsPtr XSLTCALL XSLTPUBFUN xmlNsPtr XSLTCALL
xsltGetPlainNamespace (xsltTransformContextPtr ctxt, xsltGetPlainNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr cur, xmlNodePtr cur,
xmlNsPtr ns, xmlNsPtr ns,
xmlNodePtr out); xmlNodePtr out);
XSLTPUBFUN xmlNsPtr XSLTCALL XSLTPUBFUN xmlNsPtr XSLTCALL
xsltGetSpecialNamespace (xsltTransformContextPtr ctxt, xsltGetSpecialNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr cur, xmlNodePtr cur,
const xmlChar *URI, const xmlChar *URI,
const xmlChar *prefix, const xmlChar *prefix,
xmlNodePtr out); xmlNodePtr out);
XSLTPUBFUN xmlNsPtr XSLTCALL XSLTPUBFUN xmlNsPtr XSLTCALL
xsltCopyNamespace (xsltTransformContextPtr ctxt, xsltCopyNamespace (xsltTransformContextPtr ctxt,
xmlNodePtr elem, xmlNodePtr elem,
xmlNsPtr ns); xmlNsPtr ns);
XSLTPUBFUN xmlNsPtr XSLTCALL XSLTPUBFUN xmlNsPtr XSLTCALL
xsltCopyNamespaceList (xsltTransformContextPtr ctxt, xsltCopyNamespaceList (xsltTransformContextPtr ctxt,
xmlNodePtr node, xmlNodePtr node,
xmlNsPtr cur); xmlNsPtr cur);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeNamespaceAliasHashes xsltFreeNamespaceAliasHashes
(xsltStylesheetPtr style); (xsltStylesheetPtr style);

View file

@ -193,7 +193,7 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
pointer -= groupingCharacterLen; pointer -= groupingCharacterLen;
xmlCopyCharMultiByte(pointer, groupingCharacter); xmlCopyCharMultiByte(pointer, groupingCharacter);
} }
val = digit_zero + (int)fmod(number, 10.0); val = digit_zero + (int)fmod(number, 10.0);
if (val < 0x80) { /* shortcut if ASCII */ if (val < 0x80) { /* shortcut if ASCII */
if (pointer <= temp_string) { /* Check enough room */ if (pointer <= temp_string) { /* Check enough room */
@ -203,7 +203,7 @@ xsltNumberFormatDecimal(xmlBufferPtr buffer,
*(--pointer) = val; *(--pointer) = val;
} }
else { else {
/* /*
* Here we have a multibyte character. It's a little messy, * Here we have a multibyte character. It's a little messy,
* because until we generate the char we don't know how long * because until we generate the char we don't know how long
* it is. So, we generate it into the buffer temp_char, then * it is. So, we generate it into the buffer temp_char, then
@ -241,7 +241,7 @@ xsltNumberFormatAlpha(xmlBufferPtr buffer,
pointer = &temp_string[sizeof(temp_string)]; pointer = &temp_string[sizeof(temp_string)];
*(--pointer) = 0; *(--pointer) = 0;
alpha_list = (is_upper) ? alpha_upper_list : alpha_lower_list; alpha_list = (is_upper) ? alpha_upper_list : alpha_lower_list;
for (i = 1; i < (int)sizeof(temp_string); i++) { for (i = 1; i < (int)sizeof(temp_string); i++) {
number--; number--;
*(--pointer) = alpha_list[((int)fmod(number, alpha_size))]; *(--pointer) = alpha_list[((int)fmod(number, alpha_size))];
@ -337,7 +337,7 @@ xsltNumberFormatTokenize(const xmlChar *format,
* There is always such a token in the list, even if NULL * There is always such a token in the list, even if NULL
*/ */
while (! (IS_LETTER(val=xmlStringCurrentChar(NULL, format+ix, &len)) || while (! (IS_LETTER(val=xmlStringCurrentChar(NULL, format+ix, &len)) ||
IS_DIGIT(val)) ) { IS_DIGIT(val)) ) {
if (format[ix] == 0) /* if end of format string */ if (format[ix] == 0) /* if end of format string */
break; /* while */ break; /* while */
ix += len; ix += len;
@ -550,7 +550,7 @@ xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context,
countPat = xsltCompilePattern(count, doc, elem, NULL, context); countPat = xsltCompilePattern(count, doc, elem, NULL, context);
if (from != NULL) if (from != NULL)
fromPat = xsltCompilePattern(from, doc, elem, NULL, context); fromPat = xsltCompilePattern(from, doc, elem, NULL, context);
/* select the starting node */ /* select the starting node */
switch (node->type) { switch (node->type) {
case XML_ELEMENT_NODE: case XML_ELEMENT_NODE:
@ -653,19 +653,19 @@ xsltNumberFormatGetMultipleLevel(xsltTransformContextPtr context,
for (ancestor = node; for (ancestor = node;
(ancestor != NULL) && (ancestor->type != XML_DOCUMENT_NODE); (ancestor != NULL) && (ancestor->type != XML_DOCUMENT_NODE);
ancestor = xmlXPathNextAncestor(parser, ancestor)) { ancestor = xmlXPathNextAncestor(parser, ancestor)) {
if ((from != NULL) && if ((from != NULL) &&
xsltTestCompMatchList(context, ancestor, fromPat)) xsltTestCompMatchList(context, ancestor, fromPat))
break; /* for */ break; /* for */
if ((count == NULL && node->type == ancestor->type && if ((count == NULL && node->type == ancestor->type &&
xmlStrEqual(node->name, ancestor->name)) || xmlStrEqual(node->name, ancestor->name)) ||
xsltTestCompMatchList(context, ancestor, countPat)) { xsltTestCompMatchList(context, ancestor, countPat)) {
/* count(preceding-sibling::*) */ /* count(preceding-sibling::*) */
cnt = 0; cnt = 0;
for (preceding = ancestor; for (preceding = ancestor;
preceding != NULL; preceding != NULL;
preceding = preceding =
xmlXPathNextPrecedingSibling(parser, preceding)) { xmlXPathNextPrecedingSibling(parser, preceding)) {
if (count == NULL) { if (count == NULL) {
if ((preceding->type == ancestor->type) && if ((preceding->type == ancestor->type) &&
@ -704,7 +704,7 @@ xsltNumberFormatGetValue(xmlXPathContextPtr context,
int amount = 0; int amount = 0;
xmlBufferPtr pattern; xmlBufferPtr pattern;
xmlXPathObjectPtr obj; xmlXPathObjectPtr obj;
pattern = xmlBufferCreate(); pattern = xmlBufferCreate();
if (pattern != NULL) { if (pattern != NULL) {
xmlBufferCCat(pattern, "number("); xmlBufferCCat(pattern, "number(");
@ -773,9 +773,9 @@ xsltNumberFormat(xsltTransformContextPtr ctxt,
&tokens, &tokens,
output); output);
} }
} else if (data->level) { } else if (data->level) {
if (xmlStrEqual(data->level, (const xmlChar *) "single")) { if (xmlStrEqual(data->level, (const xmlChar *) "single")) {
amount = xsltNumberFormatGetMultipleLevel(ctxt, amount = xsltNumberFormatGetMultipleLevel(ctxt,
node, node,
@ -815,7 +815,7 @@ xsltNumberFormat(xsltTransformContextPtr ctxt,
node, node,
data->count, data->count,
data->from, data->from,
&number, &number,
data->doc, data->doc,
data->node); data->node);
if (amount > 0) { if (amount > 0) {
@ -838,7 +838,7 @@ xsltNumberFormat(xsltTransformContextPtr ctxt,
if (tokens.tokens[i].separator != NULL) if (tokens.tokens[i].separator != NULL)
xmlFree(tokens.tokens[i].separator); xmlFree(tokens.tokens[i].separator);
} }
XSLT_NUMBER_FORMAT_END: XSLT_NUMBER_FORMAT_END:
if (tempformat == 1) { if (tempformat == 1) {
/* The format need to be recomputed each time */ /* The format need to be recomputed each time */
@ -855,9 +855,9 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
int len; int len;
while (1) { while (1) {
/* /*
* prefix / suffix ends at end of string or at * prefix / suffix ends at end of string or at
* first 'special' character * first 'special' character
*/ */
if (**format == 0) if (**format == 0)
return count; return count;
@ -870,12 +870,12 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
return count; return count;
/* /*
* else treat percent/per-mille as special cases, * else treat percent/per-mille as special cases,
* depending on whether +ve or -ve * depending on whether +ve or -ve
*/ */
else { else {
/* /*
* for +ve prefix/suffix, allow only a * for +ve prefix/suffix, allow only a
* single occurence of either * single occurence of either
*/ */
if (xsltUTF8Charcmp(*format, self->percent) == 0) { if (xsltUTF8Charcmp(*format, self->percent) == 0) {
if (info->is_multiplier_set) if (info->is_multiplier_set)
@ -889,14 +889,14 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
info->is_multiplier_set = TRUE; info->is_multiplier_set = TRUE;
} }
} }
if ((len=xsltUTF8Size(*format)) < 1) if ((len=xsltUTF8Size(*format)) < 1)
return -1; return -1;
count += len; count += len;
*format += len; *format += len;
} }
} }
/** /**
* xsltFormatNumberConversion: * xsltFormatNumberConversion:
* @self: the decimal format * @self: the decimal format
@ -955,9 +955,9 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
int j, len; int j, len;
int self_grouping_len; int self_grouping_len;
xsltFormatNumberInfo format_info; xsltFormatNumberInfo format_info;
/* /*
* delayed_multiplier allows a 'trailing' percent or * delayed_multiplier allows a 'trailing' percent or
* permille to be treated as suffix * permille to be treated as suffix
*/ */
int delayed_multiplier = 0; int delayed_multiplier = 0;
/* flag to show no -ve format present for -ve number */ /* flag to show no -ve format present for -ve number */
@ -1013,7 +1013,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
/* /*
* First we process the +ve pattern to get percent / permille, * First we process the +ve pattern to get percent / permille,
* as well as main format * as well as main format
*/ */
prefix = the_format; prefix = the_format;
prefix_length = xsltFormatNumberPreSuffix(self, &the_format, &format_info); prefix_length = xsltFormatNumberPreSuffix(self, &the_format, &format_info);
@ -1022,18 +1022,18 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
goto OUTPUT_NUMBER; goto OUTPUT_NUMBER;
} }
/* /*
* Here we process the "number" part of the format. It gets * Here we process the "number" part of the format. It gets
* a little messy because of the percent/per-mille - if that * a little messy because of the percent/per-mille - if that
* appears at the end, it may be part of the suffix instead * appears at the end, it may be part of the suffix instead
* of part of the number, so the variable delayed_multiplier * of part of the number, so the variable delayed_multiplier
* is used to handle it * is used to handle it
*/ */
self_grouping_len = xmlStrlen(self->grouping); self_grouping_len = xmlStrlen(self->grouping);
while ((*the_format != 0) && while ((*the_format != 0) &&
(xsltUTF8Charcmp(the_format, self->decimalPoint) != 0) && (xsltUTF8Charcmp(the_format, self->decimalPoint) != 0) &&
(xsltUTF8Charcmp(the_format, self->patternSeparator) != 0)) { (xsltUTF8Charcmp(the_format, self->patternSeparator) != 0)) {
if (delayed_multiplier != 0) { if (delayed_multiplier != 0) {
format_info.multiplier = delayed_multiplier; format_info.multiplier = delayed_multiplier;
format_info.is_multiplier_set = TRUE; format_info.is_multiplier_set = TRUE;
@ -1071,7 +1071,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
delayed_multiplier = 1000; delayed_multiplier = 1000;
} else } else
break; /* while */ break; /* while */
if ((len=xsltUTF8Size(the_format)) < 1) { if ((len=xsltUTF8Size(the_format)) < 1) {
found_error = 1; found_error = 1;
goto OUTPUT_NUMBER; goto OUTPUT_NUMBER;
@ -1085,9 +1085,9 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
format_info.add_decimal = TRUE; format_info.add_decimal = TRUE;
the_format += xsltUTF8Size(the_format); /* Skip over the decimal */ the_format += xsltUTF8Size(the_format); /* Skip over the decimal */
} }
while (*the_format != 0) { while (*the_format != 0) {
if (xsltUTF8Charcmp(the_format, self->zeroDigit) == 0) { if (xsltUTF8Charcmp(the_format, self->zeroDigit) == 0) {
if (format_info.frac_hash != 0) { if (format_info.frac_hash != 0) {
found_error = 1; found_error = 1;
@ -1135,9 +1135,9 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
} }
} }
/* /*
* If delayed_multiplier is set after processing the * If delayed_multiplier is set after processing the
* "number" part, should be in suffix * "number" part, should be in suffix
*/ */
if (delayed_multiplier != 0) { if (delayed_multiplier != 0) {
the_format -= len; the_format -= len;
@ -1147,7 +1147,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
suffix = the_format; suffix = the_format;
suffix_length = xsltFormatNumberPreSuffix(self, &the_format, &format_info); suffix_length = xsltFormatNumberPreSuffix(self, &the_format, &format_info);
if ( (suffix_length < 0) || if ( (suffix_length < 0) ||
((*the_format != 0) && ((*the_format != 0) &&
(xsltUTF8Charcmp(the_format, self->patternSeparator) != 0)) ) { (xsltUTF8Charcmp(the_format, self->patternSeparator) != 0)) ) {
found_error = 1; found_error = 1;
goto OUTPUT_NUMBER; goto OUTPUT_NUMBER;
@ -1170,17 +1170,17 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
else { else {
/* Skip over pattern separator (accounting for UTF8) */ /* Skip over pattern separator (accounting for UTF8) */
the_format = (xmlChar *)xmlUTF8Strpos(format, j + 1); the_format = (xmlChar *)xmlUTF8Strpos(format, j + 1);
/* /*
* Flag changes interpretation of percent/permille * Flag changes interpretation of percent/permille
* in -ve pattern * in -ve pattern
*/ */
format_info.is_negative_pattern = TRUE; format_info.is_negative_pattern = TRUE;
format_info.is_multiplier_set = FALSE; format_info.is_multiplier_set = FALSE;
/* First do the -ve prefix */ /* First do the -ve prefix */
nprefix = the_format; nprefix = the_format;
nprefix_length = xsltFormatNumberPreSuffix(self, nprefix_length = xsltFormatNumberPreSuffix(self,
&the_format, &format_info); &the_format, &format_info);
if (nprefix_length<0) { if (nprefix_length<0) {
found_error = 1; found_error = 1;
goto OUTPUT_NUMBER; goto OUTPUT_NUMBER;
@ -1214,7 +1214,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
/* Finally do the -ve suffix */ /* Finally do the -ve suffix */
if (*the_format != 0) { if (*the_format != 0) {
nsuffix = the_format; nsuffix = the_format;
nsuffix_length = xsltFormatNumberPreSuffix(self, nsuffix_length = xsltFormatNumberPreSuffix(self,
&the_format, &format_info); &the_format, &format_info);
if (nsuffix_length < 0) { if (nsuffix_length < 0) {
found_error = 1; found_error = 1;
@ -1232,12 +1232,12 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
* if -ve prefix/suffix == +ve ones, discard & use default * if -ve prefix/suffix == +ve ones, discard & use default
*/ */
if ((nprefix_length != prefix_length) || if ((nprefix_length != prefix_length) ||
(nsuffix_length != suffix_length) || (nsuffix_length != suffix_length) ||
((nprefix_length > 0) && ((nprefix_length > 0) &&
(xmlStrncmp(nprefix, prefix, prefix_length) !=0 )) || (xmlStrncmp(nprefix, prefix, prefix_length) !=0 )) ||
((nsuffix_length > 0) && ((nsuffix_length > 0) &&
(xmlStrncmp(nsuffix, suffix, suffix_length) !=0 ))) { (xmlStrncmp(nsuffix, suffix, suffix_length) !=0 ))) {
prefix = nprefix; prefix = nprefix;
prefix_length = nprefix_length; prefix_length = nprefix_length;
suffix = nsuffix; suffix = nsuffix;
suffix_length = nsuffix_length; suffix_length = nsuffix_length;
@ -1283,9 +1283,9 @@ OUTPUT_NUMBER:
number = fabs(number) * (double)format_info.multiplier; number = fabs(number) * (double)format_info.multiplier;
scale = pow(10.0, (double)(format_info.frac_digits + format_info.frac_hash)); scale = pow(10.0, (double)(format_info.frac_digits + format_info.frac_hash));
number = floor((scale * number + 0.5)) / scale; number = floor((scale * number + 0.5)) / scale;
if ((self->grouping != NULL) && if ((self->grouping != NULL) &&
(self->grouping[0] != 0)) { (self->grouping[0] != 0)) {
len = xmlStrlen(self->grouping); len = xmlStrlen(self->grouping);
pchar = xsltGetUTF8Char(self->grouping, &len); pchar = xsltGetUTF8Char(self->grouping, &len);
xsltNumberFormatDecimal(buffer, floor(number), self->zeroDigit[0], xsltNumberFormatDecimal(buffer, floor(number), self->zeroDigit[0],
@ -1314,14 +1314,14 @@ OUTPUT_NUMBER:
/* Next the fractional part, if required */ /* Next the fractional part, if required */
if (format_info.frac_digits + format_info.frac_hash == 0) { if (format_info.frac_digits + format_info.frac_hash == 0) {
if (format_info.add_decimal) if (format_info.add_decimal)
xmlBufferAdd(buffer, self->decimalPoint, xmlBufferAdd(buffer, self->decimalPoint,
xsltUTF8Size(self->decimalPoint)); xsltUTF8Size(self->decimalPoint));
} }
else { else {
number -= floor(number); number -= floor(number);
if ((number != 0) || (format_info.frac_digits != 0)) { if ((number != 0) || (format_info.frac_digits != 0)) {
xmlBufferAdd(buffer, self->decimalPoint, xmlBufferAdd(buffer, self->decimalPoint,
xsltUTF8Size(self->decimalPoint)); xsltUTF8Size(self->decimalPoint));
number = floor(scale * number + 0.5); number = floor(scale * number + 0.5);
for (j = format_info.frac_hash; j > 0; j--) { for (j = format_info.frac_hash; j > 0; j--) {
if (fmod(number, 10.0) >= 1.0) if (fmod(number, 10.0) >= 1.0)

View file

@ -127,9 +127,9 @@ struct _xsltParserContext {
}; };
/************************************************************************ /************************************************************************
* * * *
* Type functions * * Type functions *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -368,7 +368,7 @@ xsltSwapTopCompMatch(xsltCompMatchPtr comp) {
if (j > 0) { if (j > 0) {
register xmlChar *tmp; register xmlChar *tmp;
register xsltOp op; register xsltOp op;
register xmlXPathCompExprPtr expr; register xmlXPathCompExprPtr expr;
register int t; register int t;
i = j - 1; i = j - 1;
tmp = comp->steps[i].value; tmp = comp->steps[i].value;
@ -469,9 +469,9 @@ xsltReverseCompMatch(xsltParserContextPtr ctxt, xsltCompMatchPtr comp) {
} }
/************************************************************************ /************************************************************************
* * * *
* The interpreter for the precompiled patterns * * The interpreter for the precompiled patterns *
* * * *
************************************************************************/ ************************************************************************/
static int static int
@ -540,7 +540,7 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
ix = XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra, ival); ix = XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra, ival);
list = (xmlXPathObjectPtr) list = (xmlXPathObjectPtr)
XSLT_RUNTIME_EXTRA_LST(ctxt, sel->lenExtra); XSLT_RUNTIME_EXTRA_LST(ctxt, sel->lenExtra);
if ((list == NULL) || (prevdoc != doc)) { if ((list == NULL) || (prevdoc != doc)) {
xmlXPathObjectPtr newlist; xmlXPathObjectPtr newlist;
xmlNodePtr parent = node->parent; xmlNodePtr parent = node->parent;
@ -572,7 +572,7 @@ xsltTestCompMatchDirect(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
if ((parent == NULL) || (node->doc == NULL) || isRVT) if ((parent == NULL) || (node->doc == NULL) || isRVT)
nocache = 1; nocache = 1;
if (nocache == 0) { if (nocache == 0) {
if (list != NULL) if (list != NULL)
xmlXPathFreeObject(list); xmlXPathFreeObject(list);
@ -754,8 +754,8 @@ restart:
if (step->op == XSLT_OP_ROOT) if (step->op == XSLT_OP_ROOT)
goto found; goto found;
/* added NS, ID and KEY as a result of bug 168208 */ /* added NS, ID and KEY as a result of bug 168208 */
if ((step->op != XSLT_OP_ELEM) && if ((step->op != XSLT_OP_ELEM) &&
(step->op != XSLT_OP_ALL) && (step->op != XSLT_OP_ALL) &&
(step->op != XSLT_OP_NS) && (step->op != XSLT_OP_NS) &&
(step->op != XSLT_OP_ID) && (step->op != XSLT_OP_ID) &&
(step->op != XSLT_OP_KEY)) (step->op != XSLT_OP_KEY))
@ -863,7 +863,7 @@ restart:
xmlFree(states.states); xmlFree(states.states);
} }
return(xsltTestCompMatchDirect(ctxt, comp, node, return(xsltTestCompMatchDirect(ctxt, comp, node,
comp->nsList, comp->nsNr)); comp->nsList, comp->nsNr));
} }
doc = node->doc; doc = node->doc;
@ -939,7 +939,7 @@ restart:
} }
} }
if (sibling != NULL) { if (sibling != NULL) {
pos = ix + indx; pos = ix + indx;
/* /*
* If the node is in a Value Tree we need to * If the node is in a Value Tree we need to
* save len, but cannot cache the node! * save len, but cannot cache the node!
@ -1227,17 +1227,17 @@ xsltTestCompMatchList(xsltTransformContextPtr ctxt, xmlNodePtr node,
#define NXT(val) ctxt->cur[(val)] #define NXT(val) ctxt->cur[(val)]
#define CUR_PTR ctxt->cur #define CUR_PTR ctxt->cur
#define SKIP_BLANKS \ #define SKIP_BLANKS \
while (IS_BLANK_CH(CUR)) NEXT while (IS_BLANK_CH(CUR)) NEXT
#define CURRENT (*ctxt->cur) #define CURRENT (*ctxt->cur)
#define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur) #define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
#define PUSH(op, val, val2, novar) \ #define PUSH(op, val, val2, novar) \
if (xsltCompMatchAdd(ctxt, ctxt->comp, (op), (val), (val2), (novar))) goto error; if (xsltCompMatchAdd(ctxt, ctxt->comp, (op), (val), (val2), (novar))) goto error;
#define SWAP() \ #define SWAP() \
xsltSwapTopCompMatch(ctxt->comp); xsltSwapTopCompMatch(ctxt->comp);
#define XSLT_ERROR(X) \ #define XSLT_ERROR(X) \
@ -1506,7 +1506,7 @@ error:
* Compile the XSLT StepPattern and generates a precompiled * Compile the XSLT StepPattern and generates a precompiled
* form suitable for fast matching. * form suitable for fast matching.
* *
* [5] StepPattern ::= ChildOrAttributeAxisSpecifier NodeTest Predicate* * [5] StepPattern ::= ChildOrAttributeAxisSpecifier NodeTest Predicate*
* [6] ChildOrAttributeAxisSpecifier ::= AbbreviatedAxisSpecifier * [6] ChildOrAttributeAxisSpecifier ::= AbbreviatedAxisSpecifier
* | ('child' | 'attribute') '::' * | ('child' | 'attribute') '::'
* from XPath * from XPath
@ -2040,12 +2040,12 @@ xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur,
pat = xsltCompilePatternInternal(cur->match, style->doc, cur->elem, pat = xsltCompilePatternInternal(cur->match, style->doc, cur->elem,
style, NULL, 1); style, NULL, 1);
if (pat == NULL) if (pat == NULL)
return(-1); return(-1);
while (pat) { while (pat) {
next = pat->next; next = pat->next;
pat->next = NULL; pat->next = NULL;
name = NULL; name = NULL;
pat->template = cur; pat->template = cur;
if (mode != NULL) if (mode != NULL)
pat->mode = xmlDictLookup(style->dict, mode, -1); pat->mode = xmlDictLookup(style->dict, mode, -1);
@ -2432,7 +2432,7 @@ keyed_match:
goto error; goto error;
switch (node->type) { switch (node->type) {
case XML_ELEMENT_NODE: case XML_ELEMENT_NODE:
if (node->psvi != NULL) keyed = 1; if (node->psvi != NULL) keyed = 1;
break; break;
case XML_ATTRIBUTE_NODE: case XML_ATTRIBUTE_NODE:
@ -2441,13 +2441,13 @@ keyed_match:
case XML_TEXT_NODE: case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE: case XML_CDATA_SECTION_NODE:
case XML_COMMENT_NODE: case XML_COMMENT_NODE:
case XML_PI_NODE: case XML_PI_NODE:
if (node->psvi != NULL) keyed = 1; if (node->psvi != NULL) keyed = 1;
break; break;
case XML_DOCUMENT_NODE: case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE: case XML_HTML_DOCUMENT_NODE:
if (((xmlDocPtr) node)->psvi != NULL) keyed = 1; if (((xmlDocPtr) node)->psvi != NULL) keyed = 1;
break; break;
default: default:
break; break;
} }

View file

@ -72,7 +72,7 @@ xsltCheckTopLevelElement(xsltStylesheetPtr style, xmlNodePtr inst, int err) {
xmlNodePtr parent; xmlNodePtr parent;
if ((style == NULL) || (inst == NULL) || (inst->ns == NULL)) if ((style == NULL) || (inst == NULL) || (inst->ns == NULL))
return(-1); return(-1);
parent = inst->parent; parent = inst->parent;
if (parent == NULL) { if (parent == NULL) {
if (err) { if (err) {
@ -115,7 +115,7 @@ xsltCheckInstructionElement(xsltStylesheetPtr style, xmlNodePtr inst) {
return; return;
has_ext = (style->extInfos != NULL); has_ext = (style->extInfos != NULL);
parent = inst->parent; parent = inst->parent;
if (parent == NULL) { if (parent == NULL) {
xsltTransformError(NULL, style, inst, xsltTransformError(NULL, style, inst,
@ -141,7 +141,7 @@ xsltCheckInstructionElement(xsltStylesheetPtr style, xmlNodePtr inst) {
if ((has_ext) && (parent->ns != NULL) && if ((has_ext) && (parent->ns != NULL) &&
(xmlHashLookup(style->extInfos, parent->ns->href) != NULL)) (xmlHashLookup(style->extInfos, parent->ns->href) != NULL))
return; return;
parent = parent->parent; parent = parent->parent;
} }
xsltTransformError(NULL, style, inst, xsltTransformError(NULL, style, inst,
@ -193,7 +193,7 @@ xsltCheckParentElement(xsltStylesheetPtr style, xmlNodePtr inst,
if ((parent->ns != NULL) && if ((parent->ns != NULL) &&
(xmlHashLookup(style->extInfos, parent->ns->href) != NULL)) (xmlHashLookup(style->extInfos, parent->ns->href) != NULL))
return; return;
parent = parent->parent; parent = parent->parent;
} }
} }
@ -229,7 +229,7 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
if (style == NULL) if (style == NULL)
return(NULL); return(NULL);
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
/* /*
* URGENT TODO: Use specialized factory functions in order * URGENT TODO: Use specialized factory functions in order
@ -280,7 +280,7 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
size = sizeof(xsltStyleItemWhen); break; size = sizeof(xsltStyleItemWhen); break;
case XSLT_FUNC_OTHERWISE: case XSLT_FUNC_OTHERWISE:
size = sizeof(xsltStyleItemOtherwise); break; size = sizeof(xsltStyleItemOtherwise); break;
default: default:
xsltTransformError(NULL, style, NULL, xsltTransformError(NULL, style, NULL,
"xsltNewStylePreComp : invalid type %d\n", type); "xsltNewStylePreComp : invalid type %d\n", type);
style->errors++; style->errors++;
@ -353,8 +353,8 @@ xsltNewStylePreComp(xsltStylesheetPtr style, xsltStyleType type) {
case XSLT_FUNC_DOCUMENT: case XSLT_FUNC_DOCUMENT:
cur->func = (xsltTransformFunction) xsltDocumentElem;break; cur->func = (xsltTransformFunction) xsltDocumentElem;break;
case XSLT_FUNC_WITHPARAM: case XSLT_FUNC_WITHPARAM:
case XSLT_FUNC_PARAM: case XSLT_FUNC_PARAM:
case XSLT_FUNC_VARIABLE: case XSLT_FUNC_VARIABLE:
case XSLT_FUNC_WHEN: case XSLT_FUNC_WHEN:
break; break;
default: default:
@ -477,18 +477,18 @@ xsltFreeStylePreComp(xsltStylePreCompPtr comp) {
xmlXPathFreeCompExpr(item->comp); xmlXPathFreeCompExpr(item->comp);
} }
break; break;
case XSLT_FUNC_OTHERWISE: case XSLT_FUNC_OTHERWISE:
case XSLT_FUNC_FALLBACK: case XSLT_FUNC_FALLBACK:
case XSLT_FUNC_MESSAGE: case XSLT_FUNC_MESSAGE:
case XSLT_FUNC_INCLUDE: case XSLT_FUNC_INCLUDE:
case XSLT_FUNC_ATTRSET: case XSLT_FUNC_ATTRSET:
break; break;
default: default:
/* TODO: Raise error. */ /* TODO: Raise error. */
break; break;
} }
#else #else
if (comp->locale != (xsltLocale)0) if (comp->locale != (xsltLocale)0)
xsltFreeLocale(comp->locale); xsltFreeLocale(comp->locale);
if (comp->comp != NULL) if (comp->comp != NULL)
@ -545,7 +545,7 @@ xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,
#else #else
comp = xsltNewStylePreComp(style, XSLT_FUNC_DOCUMENT); comp = xsltNewStylePreComp(style, XSLT_FUNC_DOCUMENT);
#endif #endif
if (comp == NULL) if (comp == NULL)
return (NULL); return (NULL);
comp->inst = inst; comp->inst = inst;
@ -592,8 +592,8 @@ xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,
#ifdef WITH_XSLT_DEBUG_EXTRA #ifdef WITH_XSLT_DEBUG_EXTRA
xsltGenericDebug(xsltGenericDebugContext, xsltGenericDebug(xsltGenericDebugContext,
"Found xslt11:document construct\n"); "Found xslt11:document construct\n");
#endif #endif
} else { } else {
if (xmlStrEqual(inst->ns->href, if (xmlStrEqual(inst->ns->href,
(const xmlChar *)"http://exslt.org/common")) { (const xmlChar *)"http://exslt.org/common")) {
/* EXSLT. */ /* EXSLT. */
@ -634,12 +634,12 @@ xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,
* 3) XSLT_XT_NAMESPACE (http://www.jclark.com/xt) * 3) XSLT_XT_NAMESPACE (http://www.jclark.com/xt)
* Example: <xt:document method="xml" href="myFile.xml"> * Example: <xt:document method="xml" href="myFile.xml">
* TODO: is @href is an AVT? * TODO: is @href is an AVT?
* *
* In all cases @href is in no namespace. * In all cases @href is in no namespace.
*/ */
filename = xsltEvalStaticAttrValueTemplate(style, inst, filename = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"href", NULL, &comp->has_filename); (const xmlChar *)"href", NULL, &comp->has_filename);
} }
if (!comp->has_filename) { if (!comp->has_filename) {
goto error; goto error;
} }
@ -677,7 +677,7 @@ xsltSortComp(xsltStylesheetPtr style, xmlNodePtr inst) {
#else #else
comp = xsltNewStylePreComp(style, XSLT_FUNC_SORT); comp = xsltNewStylePreComp(style, XSLT_FUNC_SORT);
#endif #endif
if (comp == NULL) if (comp == NULL)
return; return;
inst->psvi = comp; inst->psvi = comp;
@ -784,7 +784,7 @@ xsltCopyComp(xsltStylesheetPtr style, xmlNodePtr inst) {
#else #else
comp = xsltNewStylePreComp(style, XSLT_FUNC_COPY); comp = xsltNewStylePreComp(style, XSLT_FUNC_COPY);
#endif #endif
if (comp == NULL) if (comp == NULL)
return; return;
inst->psvi = comp; inst->psvi = comp;
@ -828,7 +828,7 @@ xsltTextComp(xsltStylesheetPtr style, xmlNodePtr inst) {
comp = (xsltStyleItemTextPtr) xsltNewStylePreComp(style, XSLT_FUNC_TEXT); comp = (xsltStyleItemTextPtr) xsltNewStylePreComp(style, XSLT_FUNC_TEXT);
#else #else
comp = xsltNewStylePreComp(style, XSLT_FUNC_TEXT); comp = xsltNewStylePreComp(style, XSLT_FUNC_TEXT);
#endif #endif
if (comp == NULL) if (comp == NULL)
return; return;
inst->psvi = comp; inst->psvi = comp;
@ -910,8 +910,8 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
*/ */
comp->ns = xsltEvalStaticAttrValueTemplate(style, inst, comp->ns = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"namespace", NULL, &comp->has_ns); (const xmlChar *)"namespace", NULL, &comp->has_ns);
if (comp->name != NULL) { if (comp->name != NULL) {
if (xmlValidateQName(comp->name, 0)) { if (xmlValidateQName(comp->name, 0)) {
xsltTransformError(NULL, style, inst, xsltTransformError(NULL, style, inst,
"xsl:element: The value '%s' of the attribute 'name' is " "xsl:element: The value '%s' of the attribute 'name' is "
@ -921,7 +921,7 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
const xmlChar *prefix = NULL, *name; const xmlChar *prefix = NULL, *name;
name = xsltSplitQName(style->dict, comp->name, &prefix); name = xsltSplitQName(style->dict, comp->name, &prefix);
if (comp->has_ns == 0) { if (comp->has_ns == 0) {
xmlNsPtr ns; xmlNsPtr ns;
/* /*
@ -930,7 +930,7 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
* expanded into an expanded-name using the namespace declarations * expanded into an expanded-name using the namespace declarations
* in effect for the xsl:element element, including any default * in effect for the xsl:element element, including any default
* namespace declaration. * namespace declaration.
*/ */
ns = xmlSearchNs(inst->doc, inst, prefix); ns = xmlSearchNs(inst->doc, inst, prefix);
if (ns != NULL) { if (ns != NULL) {
comp->ns = xmlDictLookup(style->dict, ns->href, -1); comp->ns = xmlDictLookup(style->dict, ns->href, -1);
@ -947,17 +947,17 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
"not specified by the instruction itself.\n", comp->name); "not specified by the instruction itself.\n", comp->name);
style->errors++; style->errors++;
} }
} }
if ((prefix != NULL) && if ((prefix != NULL) &&
(!xmlStrncasecmp(prefix, (xmlChar *)"xml", 3))) (!xmlStrncasecmp(prefix, (xmlChar *)"xml", 3)))
{ {
/* /*
* Mark is to be skipped. * Mark is to be skipped.
*/ */
comp->has_name = 0; comp->has_name = 0;
} }
} }
} }
/* /*
* Attribute "use-attribute-sets", * Attribute "use-attribute-sets",
*/ */
@ -965,7 +965,7 @@ xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
(const xmlChar *)"use-attribute-sets", (const xmlChar *)"use-attribute-sets",
NULL, &comp->has_use); NULL, &comp->has_use);
error: error:
return; return;
} }
@ -1000,7 +1000,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
#else #else
comp = xsltNewStylePreComp(style, XSLT_FUNC_ATTRIBUTE); comp = xsltNewStylePreComp(style, XSLT_FUNC_ATTRIBUTE);
#endif #endif
if (comp == NULL) if (comp == NULL)
return; return;
inst->psvi = comp; inst->psvi = comp;
@ -1020,7 +1020,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
"XSLT-attribute: The attribute 'name' is missing.\n"); "XSLT-attribute: The attribute 'name' is missing.\n");
style->errors++; style->errors++;
return; return;
} }
/* /*
* Attribute "namespace". * Attribute "namespace".
*/ */
@ -1051,7 +1051,7 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
* QName is expanded into an expanded-name using the * QName is expanded into an expanded-name using the
* namespace declarations in effect for the xsl:element * namespace declarations in effect for the xsl:element
* element, including any default namespace declaration. * element, including any default namespace declaration.
*/ */
ns = xmlSearchNs(inst->doc, inst, prefix); ns = xmlSearchNs(inst->doc, inst, prefix);
if (ns != NULL) { if (ns != NULL) {
comp->ns = xmlDictLookup(style->dict, ns->href, -1); comp->ns = xmlDictLookup(style->dict, ns->href, -1);
@ -1083,16 +1083,16 @@ xsltAttributeComp(xsltStylesheetPtr style, xmlNodePtr inst) {
* Reject a prefix of "xmlns". Mark to be skipped. * Reject a prefix of "xmlns". Mark to be skipped.
*/ */
comp->has_name = 0; comp->has_name = 0;
#ifdef WITH_XSLT_DEBUG_PARSING #ifdef WITH_XSLT_DEBUG_PARSING
xsltGenericDebug(xsltGenericDebugContext, xsltGenericDebug(xsltGenericDebugContext,
"xsltAttribute: xmlns prefix forbidden\n"); "xsltAttribute: xmlns prefix forbidden\n");
#endif #endif
return; return;
} }
} }
} }
} }
} }
@ -1426,7 +1426,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
comp->numdata.node = cur; comp->numdata.node = cur;
comp->numdata.value = xsltGetCNsProp(style, cur, (const xmlChar *)"value", comp->numdata.value = xsltGetCNsProp(style, cur, (const xmlChar *)"value",
XSLT_NAMESPACE); XSLT_NAMESPACE);
prop = xsltEvalStaticAttrValueTemplate(style, cur, prop = xsltEvalStaticAttrValueTemplate(style, cur,
(const xmlChar *)"format", (const xmlChar *)"format",
XSLT_NAMESPACE, &comp->numdata.has_format); XSLT_NAMESPACE, &comp->numdata.has_format);
@ -1440,7 +1440,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
XSLT_NAMESPACE); XSLT_NAMESPACE);
comp->numdata.from = xsltGetCNsProp(style, cur, (const xmlChar *)"from", comp->numdata.from = xsltGetCNsProp(style, cur, (const xmlChar *)"from",
XSLT_NAMESPACE); XSLT_NAMESPACE);
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"level", XSLT_NAMESPACE); prop = xsltGetCNsProp(style, cur, (const xmlChar *)"level", XSLT_NAMESPACE);
if (prop != NULL) { if (prop != NULL) {
if (xmlStrEqual(prop, BAD_CAST("single")) || if (xmlStrEqual(prop, BAD_CAST("single")) ||
@ -1453,14 +1453,14 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
if (style != NULL) style->warnings++; if (style != NULL) style->warnings++;
} }
} }
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"lang", XSLT_NAMESPACE); prop = xsltGetCNsProp(style, cur, (const xmlChar *)"lang", XSLT_NAMESPACE);
if (prop != NULL) { if (prop != NULL) {
xsltTransformError(NULL, style, cur, xsltTransformError(NULL, style, cur,
"xsl:number : lang attribute not implemented\n"); "xsl:number : lang attribute not implemented\n");
XSLT_TODO; /* xsl:number lang attribute */ XSLT_TODO; /* xsl:number lang attribute */
} }
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"letter-value", XSLT_NAMESPACE); prop = xsltGetCNsProp(style, cur, (const xmlChar *)"letter-value", XSLT_NAMESPACE);
if (prop != NULL) { if (prop != NULL) {
if (xmlStrEqual(prop, BAD_CAST("alphabetic"))) { if (xmlStrEqual(prop, BAD_CAST("alphabetic"))) {
@ -1479,7 +1479,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
if (style != NULL) style->warnings++; if (style != NULL) style->warnings++;
} }
} }
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-separator", prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-separator",
XSLT_NAMESPACE); XSLT_NAMESPACE);
if (prop != NULL) { if (prop != NULL) {
@ -1487,7 +1487,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
comp->numdata.groupingCharacter = comp->numdata.groupingCharacter =
xsltGetUTF8Char(prop, &(comp->numdata.groupingCharacterLen)); xsltGetUTF8Char(prop, &(comp->numdata.groupingCharacterLen));
} }
prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-size", XSLT_NAMESPACE); prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-size", XSLT_NAMESPACE);
if (prop != NULL) { if (prop != NULL) {
sscanf((char *)prop, "%d", &comp->numdata.digitsPerGroup); sscanf((char *)prop, "%d", &comp->numdata.digitsPerGroup);
@ -1502,7 +1502,7 @@ xsltNumberComp(xsltStylesheetPtr style, xmlNodePtr cur) {
BAD_CAST"single", 6); BAD_CAST"single", 6);
} }
} }
} }
/** /**
@ -1837,7 +1837,7 @@ xsltVariableComp(xsltStylesheetPtr style, xmlNodePtr inst) {
xsltGetQNameProperty(style, inst, BAD_CAST "name", xsltGetQNameProperty(style, inst, BAD_CAST "name",
1, &(comp->has_name), &(comp->ns), &(comp->name)); 1, &(comp->has_name), &(comp->ns), &(comp->name));
if (comp->ns) if (comp->ns)
comp->has_ns = 1; comp->has_ns = 1;
/* /*
* Attribute "select". * Attribute "select".
*/ */
@ -1936,11 +1936,11 @@ xsltFreeStylePreComps(xsltStylesheetPtr style) {
xsltElemPreCompPtr cur, next; xsltElemPreCompPtr cur, next;
if (style == NULL) if (style == NULL)
return; return;
cur = style->preComps; cur = style->preComps;
while (cur != NULL) { while (cur != NULL) {
next = cur->next; next = cur->next;
if (cur->type == XSLT_FUNC_EXTENSION) if (cur->type == XSLT_FUNC_EXTENSION)
cur->free(cur); cur->free(cur);
else else
@ -1962,7 +1962,7 @@ xsltFreeStylePreComps(xsltStylesheetPtr style) {
*/ */
void void
xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) { xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
/* /*
* The xsltXSLTElemMarker marker was set beforehand by * The xsltXSLTElemMarker marker was set beforehand by
* the parsing mechanism for all elements in the XSLT namespace. * the parsing mechanism for all elements in the XSLT namespace.
*/ */
@ -1982,67 +1982,67 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
case XSLT_FUNC_APPLYTEMPLATES: case XSLT_FUNC_APPLYTEMPLATES:
xsltApplyTemplatesComp(style, node); xsltApplyTemplatesComp(style, node);
break; break;
case XSLT_FUNC_WITHPARAM: case XSLT_FUNC_WITHPARAM:
xsltWithParamComp(style, node); xsltWithParamComp(style, node);
break; break;
case XSLT_FUNC_VALUEOF: case XSLT_FUNC_VALUEOF:
xsltValueOfComp(style, node); xsltValueOfComp(style, node);
break; break;
case XSLT_FUNC_COPY: case XSLT_FUNC_COPY:
xsltCopyComp(style, node); xsltCopyComp(style, node);
break; break;
case XSLT_FUNC_COPYOF: case XSLT_FUNC_COPYOF:
xsltCopyOfComp(style, node); xsltCopyOfComp(style, node);
break; break;
case XSLT_FUNC_IF: case XSLT_FUNC_IF:
xsltIfComp(style, node); xsltIfComp(style, node);
break; break;
case XSLT_FUNC_CHOOSE: case XSLT_FUNC_CHOOSE:
xsltChooseComp(style, node); xsltChooseComp(style, node);
break; break;
case XSLT_FUNC_WHEN: case XSLT_FUNC_WHEN:
xsltWhenComp(style, node); xsltWhenComp(style, node);
break; break;
case XSLT_FUNC_OTHERWISE: case XSLT_FUNC_OTHERWISE:
/* NOP yet */ /* NOP yet */
return; return;
case XSLT_FUNC_FOREACH: case XSLT_FUNC_FOREACH:
xsltForEachComp(style, node); xsltForEachComp(style, node);
break; break;
case XSLT_FUNC_APPLYIMPORTS: case XSLT_FUNC_APPLYIMPORTS:
xsltApplyImportsComp(style, node); xsltApplyImportsComp(style, node);
break; break;
case XSLT_FUNC_ATTRIBUTE: case XSLT_FUNC_ATTRIBUTE:
xsltAttributeComp(style, node); xsltAttributeComp(style, node);
break; break;
case XSLT_FUNC_ELEMENT: case XSLT_FUNC_ELEMENT:
xsltElementComp(style, node); xsltElementComp(style, node);
break; break;
case XSLT_FUNC_SORT: case XSLT_FUNC_SORT:
xsltSortComp(style, node); xsltSortComp(style, node);
break; break;
case XSLT_FUNC_COMMENT: case XSLT_FUNC_COMMENT:
xsltCommentComp(style, node); xsltCommentComp(style, node);
break; break;
case XSLT_FUNC_NUMBER: case XSLT_FUNC_NUMBER:
xsltNumberComp(style, node); xsltNumberComp(style, node);
break; break;
case XSLT_FUNC_PI: case XSLT_FUNC_PI:
xsltProcessingInstructionComp(style, node); xsltProcessingInstructionComp(style, node);
break; break;
case XSLT_FUNC_CALLTEMPLATE: case XSLT_FUNC_CALLTEMPLATE:
xsltCallTemplateComp(style, node); xsltCallTemplateComp(style, node);
break; break;
case XSLT_FUNC_PARAM: case XSLT_FUNC_PARAM:
xsltParamComp(style, node); xsltParamComp(style, node);
break; break;
case XSLT_FUNC_VARIABLE: case XSLT_FUNC_VARIABLE:
xsltVariableComp(style, node); xsltVariableComp(style, node);
break; break;
case XSLT_FUNC_FALLBACK: case XSLT_FUNC_FALLBACK:
/* NOP yet */ /* NOP yet */
return; return;
case XSLT_FUNC_DOCUMENT: case XSLT_FUNC_DOCUMENT:
/* The extra one */ /* The extra one */
node->psvi = (void *) xsltDocumentComp(style, node, node->psvi = (void *) xsltDocumentComp(style, node,
(xsltTransformFunction) xsltDocumentElem); (xsltTransformFunction) xsltDocumentElem);
@ -2065,7 +2065,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
} else { } else {
/* /*
* Fallback to string comparison. * Fallback to string comparison.
*/ */
if (IS_XSLT_NAME(node, "apply-templates")) { if (IS_XSLT_NAME(node, "apply-templates")) {
xsltApplyTemplatesComp(style, node); xsltApplyTemplatesComp(style, node);
} else if (IS_XSLT_NAME(node, "with-param")) { } else if (IS_XSLT_NAME(node, "with-param")) {
@ -2081,7 +2081,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
} else if (IS_XSLT_NAME(node, "choose")) { } else if (IS_XSLT_NAME(node, "choose")) {
xsltChooseComp(style, node); xsltChooseComp(style, node);
} else if (IS_XSLT_NAME(node, "when")) { } else if (IS_XSLT_NAME(node, "when")) {
xsltWhenComp(style, node); xsltWhenComp(style, node);
} else if (IS_XSLT_NAME(node, "otherwise")) { } else if (IS_XSLT_NAME(node, "otherwise")) {
/* NOP yet */ /* NOP yet */
return; return;
@ -2113,7 +2113,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
} else if (IS_XSLT_NAME(node, "document")) { } else if (IS_XSLT_NAME(node, "document")) {
/* The extra one */ /* The extra one */
node->psvi = (void *) xsltDocumentComp(style, node, node->psvi = (void *) xsltDocumentComp(style, node,
(xsltTransformFunction) xsltDocumentElem); (xsltTransformFunction) xsltDocumentElem);
} else if (IS_XSLT_NAME(node, "output")) { } else if (IS_XSLT_NAME(node, "output")) {
/* Top-level */ /* Top-level */
return; return;
@ -2122,7 +2122,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
return; return;
} else if (IS_XSLT_NAME(node, "strip-space")) { } else if (IS_XSLT_NAME(node, "strip-space")) {
/* Top-level */ /* Top-level */
return; return;
} else if (IS_XSLT_NAME(node, "key")) { } else if (IS_XSLT_NAME(node, "key")) {
/* Top-level */ /* Top-level */
return; return;
@ -2138,7 +2138,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
/* Top-level */ /* Top-level */
return; return;
} else if (IS_XSLT_NAME(node, "include")) { } else if (IS_XSLT_NAME(node, "include")) {
/* Top-level */ /* Top-level */
} else { } else {
/* /*
* NOTE that xsl:text, xsl:template, xsl:stylesheet, * NOTE that xsl:text, xsl:template, xsl:stylesheet,
@ -2150,7 +2150,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr node) {
"the XSLT element '%s'.\n", node->name); "the XSLT element '%s'.\n", node->name);
style->errors++; style->errors++;
return; return;
} }
} }
/* /*
* Assign the current list of in-scope namespaces to the * Assign the current list of in-scope namespaces to the
@ -2251,7 +2251,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
} else if (IS_XSLT_NAME(inst, "call-template")) { } else if (IS_XSLT_NAME(inst, "call-template")) {
xsltCheckInstructionElement(style, inst); xsltCheckInstructionElement(style, inst);
xsltCallTemplateComp(style, inst); xsltCallTemplateComp(style, inst);
} else if (IS_XSLT_NAME(inst, "param")) { } else if (IS_XSLT_NAME(inst, "param")) {
if (xsltCheckTopLevelElement(style, inst, 0) == 0) if (xsltCheckTopLevelElement(style, inst, 0) == 0)
xsltCheckInstructionElement(style, inst); xsltCheckInstructionElement(style, inst);
xsltParamComp(style, inst); xsltParamComp(style, inst);
@ -2319,7 +2319,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
"xsltStylePreCompute: unknown xsl:%s\n", inst->name); "xsltStylePreCompute: unknown xsl:%s\n", inst->name);
if (style != NULL) style->warnings++; if (style != NULL) style->warnings++;
} }
cur = (xsltStylePreCompPtr) inst->psvi; cur = (xsltStylePreCompPtr) inst->psvi;
/* /*
* A ns-list is build for every XSLT item in the * A ns-list is build for every XSLT item in the

View file

@ -24,15 +24,15 @@ extern "C" {
*/ */
extern const xmlChar *xsltExtMarker; extern const xmlChar *xsltExtMarker;
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
xsltDocumentComp (xsltStylesheetPtr style, xsltDocumentComp (xsltStylesheetPtr style,
xmlNodePtr inst, xmlNodePtr inst,
xsltTransformFunction function); xsltTransformFunction function);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltStylePreCompute (xsltStylesheetPtr style, xsltStylePreCompute (xsltStylesheetPtr style,
xmlNodePtr inst); xmlNodePtr inst);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeStylePreComps (xsltStylesheetPtr style); xsltFreeStylePreComps (xsltStylesheetPtr style);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -181,7 +181,7 @@ xsltGetSecurityPrefs(xsltSecurityPrefsPtr sec, xsltSecurityOption option) {
*/ */
void void
xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec) { xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec) {
xsltDefaultSecurityPrefs = sec; xsltDefaultSecurityPrefs = sec;
} }
@ -206,7 +206,7 @@ xsltGetDefaultSecurityPrefs(void) {
* *
* Returns -1 in case of error, 0 otherwise * Returns -1 in case of error, 0 otherwise
*/ */
int int
xsltSetCtxtSecurityPrefs(xsltSecurityPrefsPtr sec, xsltSetCtxtSecurityPrefs(xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt) { xsltTransformContextPtr ctxt) {
if (ctxt == NULL) if (ctxt == NULL)
@ -265,7 +265,7 @@ xsltSecurityForbid(xsltSecurityPrefsPtr sec ATTRIBUTE_UNUSED,
* *
* TODO: remove at some point !!! * TODO: remove at some point !!!
* Local copy of xmlCheckFilename to avoid a hard dependency on * Local copy of xmlCheckFilename to avoid a hard dependency on
* a new version of libxml2 * a new version of libxml2
* *
* if stat is not available on the target machine, * if stat is not available on the target machine,
* returns 1. if stat fails, returns 0 (if calling * returns 1. if stat fails, returns 0 (if calling
@ -282,7 +282,7 @@ xsltCheckFilename (const char *path)
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
DWORD dwAttrs; DWORD dwAttrs;
dwAttrs = GetFileAttributes(path); dwAttrs = GetFileAttributes(path);
if (dwAttrs != INVALID_FILE_ATTRIBUTES) { if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
if (dwAttrs & FILE_ATTRIBUTE_DIRECTORY) { if (dwAttrs & FILE_ATTRIBUTE_DIRECTORY) {
return 2; return 2;

View file

@ -55,43 +55,43 @@ typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec,
/* /*
* Module interfaces * Module interfaces
*/ */
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
xsltNewSecurityPrefs (void); xsltNewSecurityPrefs (void);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec); xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec, xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec,
xsltSecurityOption option, xsltSecurityOption option,
xsltSecurityCheck func); xsltSecurityCheck func);
XSLTPUBFUN xsltSecurityCheck XSLTCALL XSLTPUBFUN xsltSecurityCheck XSLTCALL
xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec, xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec,
xsltSecurityOption option); xsltSecurityOption option);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec); xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec);
XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
xsltGetDefaultSecurityPrefs (void); xsltGetDefaultSecurityPrefs (void);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec, xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt); xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSecurityAllow (xsltSecurityPrefsPtr sec, xsltSecurityAllow (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt, xsltTransformContextPtr ctxt,
const char *value); const char *value);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSecurityForbid (xsltSecurityPrefsPtr sec, xsltSecurityForbid (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt, xsltTransformContextPtr ctxt,
const char *value); const char *value);
/* /*
* internal interfaces * internal interfaces
*/ */
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltCheckWrite (xsltSecurityPrefsPtr sec, xsltCheckWrite (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt, xsltTransformContextPtr ctxt,
const xmlChar *URL); const xmlChar *URL);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltCheckRead (xsltSecurityPrefsPtr sec, xsltCheckRead (xsltSecurityPrefsPtr sec,
xsltTransformContextPtr ctxt, xsltTransformContextPtr ctxt,
const xmlChar *URL); const xmlChar *URL);

View file

@ -39,7 +39,7 @@
* Module interfaces * * Module interfaces *
* * * *
************************************************************************/ ************************************************************************/
/** /**
* xsltEvalXPathPredicate: * xsltEvalXPathPredicate:
* @ctxt: the XSLT transformation context * @ctxt: the XSLT transformation context
@ -454,7 +454,7 @@ xsltEvalStaticAttrValueTemplate(xsltStylesheetPtr style, xmlNodePtr inst,
* Evaluates Attribute Value Templates and copies the attribute over to * Evaluates Attribute Value Templates and copies the attribute over to
* the result element. * the result element.
* This does *not* process attribute sets (xsl:use-attribute-set). * This does *not* process attribute sets (xsl:use-attribute-set).
* *
* *
* Returns the generated attribute node. * Returns the generated attribute node.
*/ */
@ -467,14 +467,14 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
if ((ctxt == NULL) || (attr == NULL) || (target == NULL)) if ((ctxt == NULL) || (attr == NULL) || (target == NULL))
return(NULL); return(NULL);
if (attr->type != XML_ATTRIBUTE_NODE) if (attr->type != XML_ATTRIBUTE_NODE)
return(NULL); return(NULL);
/* /*
* Skip all XSLT attributes. * Skip all XSLT attributes.
*/ */
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
if (attr->psvi == xsltXSLTAttrMarker) if (attr->psvi == xsltXSLTAttrMarker)
return(NULL); return(NULL);
#else #else
@ -511,7 +511,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
} }
ret = ret->next; ret = ret->next;
} }
if (ret != NULL) { if (ret != NULL) {
/* free the existing value */ /* free the existing value */
xmlFreeNodeList(ret->children); xmlFreeNodeList(ret->children);
ret->children = ret->last = NULL; ret->children = ret->last = NULL;
@ -530,7 +530,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
xsltGetNamespace(ctxt, attr->parent, attr->ns, target), xsltGetNamespace(ctxt, attr->parent, attr->ns, target),
attr->name, NULL); attr->name, NULL);
else else
ret = xmlNewNsProp(target, NULL, attr->name, NULL); ret = xmlNewNsProp(target, NULL, attr->name, NULL);
} }
/* /*
* Set the value. * Set the value.
@ -581,11 +581,11 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
} else { } else {
if (attr->ns) { if (attr->ns) {
xsltTransformError(ctxt, NULL, attr->parent, xsltTransformError(ctxt, NULL, attr->parent,
"Internal error: Failed to create attribute '{%s}%s'.\n", "Internal error: Failed to create attribute '{%s}%s'.\n",
attr->ns->href, attr->name); attr->ns->href, attr->name);
} else { } else {
xsltTransformError(ctxt, NULL, attr->parent, xsltTransformError(ctxt, NULL, attr->parent,
"Internal error: Failed to create attribute '%s'.\n", "Internal error: Failed to create attribute '%s'.\n",
attr->name); attr->name);
} }
} }
@ -613,7 +613,7 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
* attributes will be disattached.) * attributes will be disattached.)
*/ */
xmlAttrPtr xmlAttrPtr
xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt, xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
xmlNodePtr target, xmlAttrPtr attrs) xmlNodePtr target, xmlAttrPtr attrs)
{ {
xmlAttrPtr attr, copy, last; xmlAttrPtr attr, copy, last;
@ -626,7 +626,7 @@ xsltAttrListTemplateProcess(xsltTransformContextPtr ctxt,
return(NULL); return(NULL);
oldInsert = ctxt->insert; oldInsert = ctxt->insert;
ctxt->insert = target; ctxt->insert = target;
/* /*
* Instantiate LRE-attributes. * Instantiate LRE-attributes.
@ -818,7 +818,7 @@ xmlNodePtr *
xsltTemplateProcess(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, xmlNodePtr node) { xsltTemplateProcess(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, xmlNodePtr node) {
if (node == NULL) if (node == NULL)
return(NULL); return(NULL);
return(0); return(0);
} }

View file

@ -20,21 +20,21 @@
extern "C" { extern "C" {
#endif #endif
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltEvalXPathPredicate (xsltTransformContextPtr ctxt, xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
xmlXPathCompExprPtr comp, xmlXPathCompExprPtr comp,
xmlNsPtr *nsList, xmlNsPtr *nsList,
int nsNr); int nsNr);
XSLTPUBFUN xmlChar * XSLTCALL XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalTemplateString (xsltTransformContextPtr ctxt, xsltEvalTemplateString (xsltTransformContextPtr ctxt,
xmlNodePtr contextNode, xmlNodePtr contextNode,
xmlNodePtr inst); xmlNodePtr inst);
XSLTPUBFUN xmlChar * XSLTCALL XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt, xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
xmlNodePtr node, xmlNodePtr node,
const xmlChar *name, const xmlChar *name,
const xmlChar *ns); const xmlChar *ns);
XSLTPUBFUN const xmlChar * XSLTCALL XSLTPUBFUN const xmlChar * XSLTCALL
xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style, xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
xmlNodePtr node, xmlNodePtr node,
const xmlChar *name, const xmlChar *name,
@ -42,30 +42,30 @@ XSLTPUBFUN const xmlChar * XSLTCALL
int *found); int *found);
/* TODO: this is obviously broken ... the namespaces should be passed too ! */ /* TODO: this is obviously broken ... the namespaces should be passed too ! */
XSLTPUBFUN xmlChar * XSLTCALL XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalXPathString (xsltTransformContextPtr ctxt, xsltEvalXPathString (xsltTransformContextPtr ctxt,
xmlXPathCompExprPtr comp); xmlXPathCompExprPtr comp);
XSLTPUBFUN xmlChar * XSLTCALL XSLTPUBFUN xmlChar * XSLTCALL
xsltEvalXPathStringNs (xsltTransformContextPtr ctxt, xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
xmlXPathCompExprPtr comp, xmlXPathCompExprPtr comp,
int nsNr, int nsNr,
xmlNsPtr *nsList); xmlNsPtr *nsList);
XSLTPUBFUN xmlNodePtr * XSLTCALL XSLTPUBFUN xmlNodePtr * XSLTCALL
xsltTemplateProcess (xsltTransformContextPtr ctxt, xsltTemplateProcess (xsltTransformContextPtr ctxt,
xmlNodePtr node); xmlNodePtr node);
XSLTPUBFUN xmlAttrPtr XSLTCALL XSLTPUBFUN xmlAttrPtr XSLTCALL
xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt, xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
xmlNodePtr target, xmlNodePtr target,
xmlAttrPtr cur); xmlAttrPtr cur);
XSLTPUBFUN xmlAttrPtr XSLTCALL XSLTPUBFUN xmlAttrPtr XSLTCALL
xsltAttrTemplateProcess (xsltTransformContextPtr ctxt, xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
xmlNodePtr target, xmlNodePtr target,
xmlAttrPtr attr); xmlAttrPtr attr);
XSLTPUBFUN xmlChar * XSLTCALL XSLTPUBFUN xmlChar * XSLTCALL
xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt, xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
const xmlChar* attr); const xmlChar* attr);
XSLTPUBFUN xmlChar * XSLTCALL XSLTPUBFUN xmlChar * XSLTCALL
xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt, xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
const xmlChar* str, const xmlChar* str,
xmlNodePtr node); xmlNodePtr node);

View file

@ -57,7 +57,7 @@ const xmlChar *xsltComputingGlobalVarMarker =
* @ctxt: an XSLT transformation context * @ctxt: an XSLT transformation context
* *
* Creates a Result Value Tree * Creates a Result Value Tree
* (the XSLT 1.0 term for this is "Result Tree Fragment") * (the XSLT 1.0 term for this is "Result Tree Fragment")
* *
* Returns the result value tree or NULL in case of API or internal errors. * Returns the result value tree or NULL in case of API or internal errors.
*/ */
@ -69,7 +69,7 @@ xsltCreateRVT(xsltTransformContextPtr ctxt)
/* /*
* Question: Why is this function public? * Question: Why is this function public?
* Answer: It is called by the EXSLT module. * Answer: It is called by the EXSLT module.
*/ */
if (ctxt == NULL) if (ctxt == NULL)
return(NULL); return(NULL);
@ -158,7 +158,7 @@ xsltRegisterLocalRVT(xsltTransformContextPtr ctxt,
{ {
if ((ctxt == NULL) || (RVT == NULL)) if ((ctxt == NULL) || (RVT == NULL))
return(-1); return(-1);
/* /*
* When evaluating "select" expressions of xsl:variable * When evaluating "select" expressions of xsl:variable
* and xsl:param, we need to bind newly created tree fragments * and xsl:param, we need to bind newly created tree fragments
@ -272,7 +272,7 @@ xsltExtensionInstructionResultRegister(xsltTransformContextPtr ctxt,
(((xmlNsPtr) cur)->next->type == XML_ELEMENT_NODE)) (((xmlNsPtr) cur)->next->type == XML_ELEMENT_NODE))
{ {
cur = (xmlNodePtr) ((xmlNsPtr) cur)->next; cur = (xmlNodePtr) ((xmlNsPtr) cur)->next;
doc = cur->doc; doc = cur->doc;
} else { } else {
xsltTransformError(ctxt, NULL, ctxt->inst, xsltTransformError(ctxt, NULL, ctxt->inst,
"Internal error in " "Internal error in "
@ -333,7 +333,7 @@ xsltReleaseRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
} }
/* /*
* Clear the document tree. * Clear the document tree.
* REVISIT TODO: Do we expect ID/IDREF tables to be existent? * REVISIT TODO: Do we expect ID/IDREF tables to be existent?
*/ */
if (RVT->children != NULL) { if (RVT->children != NULL) {
xmlFreeNodeList(RVT->children); xmlFreeNodeList(RVT->children);
@ -522,7 +522,7 @@ xsltCopyStackElem(xsltStackElemPtr elem) {
cur->nameURI = elem->nameURI; cur->nameURI = elem->nameURI;
cur->select = elem->select; cur->select = elem->select;
cur->tree = elem->tree; cur->tree = elem->tree;
cur->comp = elem->comp; cur->comp = elem->comp;
return(cur); return(cur);
} }
@ -563,13 +563,13 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
* </xsl:variable> * </xsl:variable>
* <f:result select="$bar"/> * <f:result select="$bar"/>
* </f:function> * </f:function>
* *
*/ */
xsltRegisterLocalRVT(elem->context, cur); xsltRegisterLocalRVT(elem->context, cur);
} else { } else {
xsltReleaseRVT((xsltTransformContextPtr) elem->context, xsltReleaseRVT((xsltTransformContextPtr) elem->context,
cur); cur);
} }
} }
} }
/* /*
@ -583,7 +583,7 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
memset(elem, 0, sizeof(xsltStackElem)); memset(elem, 0, sizeof(xsltStackElem));
elem->context = ctxt; elem->context = ctxt;
elem->next = ctxt->cache->stackItems; elem->next = ctxt->cache->stackItems;
ctxt->cache->stackItems = elem; ctxt->cache->stackItems = elem;
ctxt->cache->nbStackItems++; ctxt->cache->nbStackItems++;
#ifdef XSLT_DEBUG_PROFILE_CACHE #ifdef XSLT_DEBUG_PROFILE_CACHE
ctxt->cache->dbgCachedVars++; ctxt->cache->dbgCachedVars++;
@ -602,7 +602,7 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
void void
xsltFreeStackElemList(xsltStackElemPtr elem) { xsltFreeStackElemList(xsltStackElemPtr elem) {
xsltStackElemPtr next; xsltStackElemPtr next;
while (elem != NULL) { while (elem != NULL) {
next = elem->next; next = elem->next;
xsltFreeStackElem(elem); xsltFreeStackElem(elem);
@ -706,7 +706,7 @@ xsltCheckStackElem(xsltTransformContextPtr ctxt, const xmlChar *name,
else if (cur->comp->type == XSLT_FUNC_PARAM) else if (cur->comp->type == XSLT_FUNC_PARAM)
return(2); return(2);
} }
return(1); return(1);
} }
@ -752,10 +752,10 @@ xsltAddStackElem(xsltTransformContextPtr ctxt, xsltStackElemPtr elem)
} }
ctxt->varsTab[ctxt->varsNr++] = elem; ctxt->varsTab[ctxt->varsNr++] = elem;
ctxt->vars = elem; ctxt->vars = elem;
elem = elem->next; elem = elem->next;
} while (elem != NULL); } while (elem != NULL);
return(0); return(0);
} }
@ -799,7 +799,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
(xsltStyleItemVariablePtr) castedComp; (xsltStyleItemVariablePtr) castedComp;
#else #else
xsltStylePreCompPtr comp = castedComp; xsltStylePreCompPtr comp = castedComp;
#endif #endif
xmlXPathObjectPtr result = NULL; xmlXPathObjectPtr result = NULL;
xmlNodePtr oldInst; xmlNodePtr oldInst;
@ -842,7 +842,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
oldXPContextSize = xpctxt->contextSize; oldXPContextSize = xpctxt->contextSize;
oldXPNamespaces = xpctxt->namespaces; oldXPNamespaces = xpctxt->namespaces;
oldXPNsNr = xpctxt->nsNr; oldXPNsNr = xpctxt->nsNr;
xpctxt->node = ctxt->node; xpctxt->node = ctxt->node;
/* /*
* OPTIMIZE TODO: Lame try to set the context doc. * OPTIMIZE TODO: Lame try to set the context doc.
@ -854,7 +854,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
/* /*
* BUG TODO: The proximity position and the context size will * BUG TODO: The proximity position and the context size will
* potentially be wrong. * potentially be wrong.
* Example: * Example:
* <xsl:template select="foo"> * <xsl:template select="foo">
* <xsl:variable name="pos" select="position()"/> * <xsl:variable name="pos" select="position()"/>
* <xsl:for-each select="bar"> * <xsl:for-each select="bar">
@ -865,9 +865,9 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
* to the context of <xsl:for-each select="bar">, but * to the context of <xsl:for-each select="bar">, but
* the variable needs to be evaluated in the context of * the variable needs to be evaluated in the context of
* <xsl:template select="foo">. * <xsl:template select="foo">.
*/ */
if (comp != NULL) { if (comp != NULL) {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
if (comp->inScopeNs != NULL) { if (comp->inScopeNs != NULL) {
xpctxt->namespaces = comp->inScopeNs->list; xpctxt->namespaces = comp->inScopeNs->list;
@ -892,9 +892,9 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
* we'll eventually free still referenced fragments, before * we'll eventually free still referenced fragments, before
* we leave the scope of the variable. * we leave the scope of the variable.
*/ */
ctxt->contextVariable = variable; ctxt->contextVariable = variable;
variable->flags |= XSLT_VAR_IN_SELECT; variable->flags |= XSLT_VAR_IN_SELECT;
result = xmlXPathCompiledEval(xpExpr, xpctxt); result = xmlXPathCompiledEval(xpExpr, xpctxt);
variable->flags ^= XSLT_VAR_IN_SELECT; variable->flags ^= XSLT_VAR_IN_SELECT;
@ -932,7 +932,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
} else { } else {
if (variable->tree == NULL) { if (variable->tree == NULL) {
result = xmlXPathNewCString(""); result = xmlXPathNewCString("");
} else { } else {
if (variable->tree) { if (variable->tree) {
xmlDocPtr container; xmlDocPtr container;
xmlNodePtr oldInsert; xmlNodePtr oldInsert;
@ -954,14 +954,14 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
*/ */
/* /*
* Attach the Result Tree Fragment to the variable; * Attach the Result Tree Fragment to the variable;
* when the variable is freed, it will also free * when the variable is freed, it will also free
* the Result Tree Fragment. * the Result Tree Fragment.
*/ */
variable->fragment = container; variable->fragment = container;
oldOutput = ctxt->output; oldOutput = ctxt->output;
oldInsert = ctxt->insert; oldInsert = ctxt->insert;
ctxt->output = container; ctxt->output = container;
ctxt->insert = (xmlNodePtr) container; ctxt->insert = (xmlNodePtr) container;
ctxt->contextVariable = variable; ctxt->contextVariable = variable;
@ -972,10 +972,10 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
xsltApplyOneTemplate(ctxt, ctxt->node, variable->tree, xsltApplyOneTemplate(ctxt, ctxt->node, variable->tree,
NULL, NULL); NULL, NULL);
ctxt->contextVariable = oldVar; ctxt->contextVariable = oldVar;
ctxt->insert = oldInsert; ctxt->insert = oldInsert;
ctxt->output = oldOutput; ctxt->output = oldOutput;
result = xmlXPathNewValueTree((xmlNodePtr) container); result = xmlXPathNewValueTree((xmlNodePtr) container);
} }
if (result == NULL) { if (result == NULL) {
@ -985,7 +985,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
* Freeing is not handled there anymore. * Freeing is not handled there anymore.
* QUESTION TODO: What does the above comment mean? * QUESTION TODO: What does the above comment mean?
*/ */
result->boolval = 0; result->boolval = 0;
} }
#ifdef WITH_XSLT_DEBUG_VARIABLE #ifdef WITH_XSLT_DEBUG_VARIABLE
#ifdef LIBXML_DEBUG_ENABLED #ifdef LIBXML_DEBUG_ENABLED
@ -1054,7 +1054,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
* called; and in the case of global params, if values for such params * called; and in the case of global params, if values for such params
* are provided by the user. * are provided by the user.
*/ */
if (elem->select != NULL) { if (elem->select != NULL) {
xmlXPathCompExprPtr xpExpr = NULL; xmlXPathCompExprPtr xpExpr = NULL;
xmlDocPtr oldXPDoc; xmlDocPtr oldXPDoc;
xmlNodePtr oldXPContextNode; xmlNodePtr oldXPContextNode;
@ -1069,8 +1069,8 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
} }
if (xpExpr == NULL) if (xpExpr == NULL)
goto error; goto error;
if (comp != NULL) if (comp != NULL)
ctxt->inst = comp->inst; ctxt->inst = comp->inst;
else else
@ -1082,7 +1082,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
* to process the root node of the source document: the current * to process the root node of the source document: the current
* node is the root node of the source document and the current * node is the root node of the source document and the current
* node list is a list containing just the root node of the source * node list is a list containing just the root node of the source
* document." * document."
*/ */
/* /*
* Save context states. * Save context states.
@ -1093,14 +1093,14 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
oldXPContextSize = xpctxt->contextSize; oldXPContextSize = xpctxt->contextSize;
oldXPNamespaces = xpctxt->namespaces; oldXPNamespaces = xpctxt->namespaces;
oldXPNsNr = xpctxt->nsNr; oldXPNsNr = xpctxt->nsNr;
xpctxt->node = ctxt->initialContextNode; xpctxt->node = ctxt->initialContextNode;
xpctxt->doc = ctxt->initialContextDoc; xpctxt->doc = ctxt->initialContextDoc;
xpctxt->contextSize = 1; xpctxt->contextSize = 1;
xpctxt->proximityPosition = 1; xpctxt->proximityPosition = 1;
if (comp != NULL) { if (comp != NULL) {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
if (comp->inScopeNs != NULL) { if (comp->inScopeNs != NULL) {
xpctxt->namespaces = comp->inScopeNs->list; xpctxt->namespaces = comp->inScopeNs->list;
@ -1117,7 +1117,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
xpctxt->namespaces = NULL; xpctxt->namespaces = NULL;
xpctxt->nsNr = 0; xpctxt->nsNr = 0;
} }
result = xmlXPathCompiledEval(xpExpr, xpctxt); result = xmlXPathCompiledEval(xpExpr, xpctxt);
/* /*
@ -1156,7 +1156,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
} else { } else {
xmlDocPtr container; xmlDocPtr container;
xmlNodePtr oldInsert; xmlNodePtr oldInsert;
xmlDocPtr oldOutput, oldXPDoc; xmlDocPtr oldOutput, oldXPDoc;
/* /*
* Generate a result tree fragment. * Generate a result tree fragment.
*/ */
@ -1167,14 +1167,14 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
* Let the lifetime of the tree fragment be handled by * Let the lifetime of the tree fragment be handled by
* the Libxslt's garbage collector. * the Libxslt's garbage collector.
*/ */
xsltRegisterPersistRVT(ctxt, container); xsltRegisterPersistRVT(ctxt, container);
oldOutput = ctxt->output; oldOutput = ctxt->output;
oldInsert = ctxt->insert; oldInsert = ctxt->insert;
oldXPDoc = ctxt->xpathCtxt->doc; oldXPDoc = ctxt->xpathCtxt->doc;
ctxt->output = container; ctxt->output = container;
ctxt->insert = (xmlNodePtr) container; ctxt->insert = (xmlNodePtr) container;
ctxt->xpathCtxt->doc = ctxt->initialContextDoc; ctxt->xpathCtxt->doc = ctxt->initialContextDoc;
@ -1187,7 +1187,7 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
ctxt->insert = oldInsert; ctxt->insert = oldInsert;
ctxt->output = oldOutput; ctxt->output = oldOutput;
result = xmlXPathNewValueTree((xmlNodePtr) container); result = xmlXPathNewValueTree((xmlNodePtr) container);
if (result == NULL) { if (result == NULL) {
result = xmlXPathNewCString(""); result = xmlXPathNewCString("");
@ -1227,11 +1227,11 @@ error:
int int
xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) { xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
xsltStackElemPtr elem; xsltStackElemPtr elem;
xsltStylesheetPtr style; xsltStylesheetPtr style;
if ((ctxt == NULL) || (ctxt->document == NULL)) if ((ctxt == NULL) || (ctxt->document == NULL))
return(-1); return(-1);
#ifdef WITH_XSLT_DEBUG_VARIABLE #ifdef WITH_XSLT_DEBUG_VARIABLE
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext, XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
"Registering global variables\n")); "Registering global variables\n"));
@ -1242,7 +1242,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
style = ctxt->style; style = ctxt->style;
while (style != NULL) { while (style != NULL) {
elem = style->variables; elem = style->variables;
#ifdef WITH_XSLT_DEBUG_VARIABLE #ifdef WITH_XSLT_DEBUG_VARIABLE
if ((style->doc != NULL) && (style->doc->URL != NULL)) { if ((style->doc != NULL) && (style->doc->URL != NULL)) {
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext, XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
@ -1257,7 +1257,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
/* /*
* Global variables are stored in the variables pool. * Global variables are stored in the variables pool.
*/ */
def = (xsltStackElemPtr) def = (xsltStackElemPtr)
xmlHashLookup2(ctxt->globalVars, xmlHashLookup2(ctxt->globalVars,
elem->name, elem->nameURI); elem->name, elem->nameURI);
if (def == NULL) { if (def == NULL) {
@ -1288,7 +1288,7 @@ xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) {
/* /*
* This part does the actual evaluation * This part does the actual evaluation
*/ */
xmlHashScan(ctxt->globalVars, xmlHashScan(ctxt->globalVars,
(xmlHashScanner) xsltEvalGlobalVariable, ctxt); (xmlHashScanner) xsltEvalGlobalVariable, ctxt);
@ -1414,7 +1414,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
const xmlChar *href; const xmlChar *href;
xmlXPathCompExprPtr xpExpr; xmlXPathCompExprPtr xpExpr;
xmlXPathObjectPtr result; xmlXPathObjectPtr result;
xsltStackElemPtr elem; xsltStackElemPtr elem;
int res; int res;
void *res_ptr; void *res_ptr;
@ -1496,7 +1496,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
int oldXPProximityPosition, oldXPContextSize, oldXPNsNr; int oldXPProximityPosition, oldXPContextSize, oldXPNsNr;
xmlNsPtr *oldXPNamespaces; xmlNsPtr *oldXPNamespaces;
xmlXPathContextPtr xpctxt = ctxt->xpathCtxt; xmlXPathContextPtr xpctxt = ctxt->xpathCtxt;
/* /*
* Save context states. * Save context states.
*/ */
@ -1516,19 +1516,19 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
* node list is a list containing just the root node of the source * node list is a list containing just the root node of the source
* document." * document."
*/ */
xpctxt->doc = ctxt->initialContextDoc; xpctxt->doc = ctxt->initialContextDoc;
xpctxt->node = ctxt->initialContextNode; xpctxt->node = ctxt->initialContextNode;
xpctxt->contextSize = 1; xpctxt->contextSize = 1;
xpctxt->proximityPosition = 1; xpctxt->proximityPosition = 1;
/* /*
* There is really no in scope namespace for parameters on the * There is really no in scope namespace for parameters on the
* command line. * command line.
*/ */
xpctxt->namespaces = NULL; xpctxt->namespaces = NULL;
xpctxt->nsNr = 0; xpctxt->nsNr = 0;
result = xmlXPathCompiledEval(xpExpr, xpctxt); result = xmlXPathCompiledEval(xpExpr, xpctxt);
/* /*
* Restore Context states. * Restore Context states.
*/ */
@ -1538,7 +1538,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
xpctxt->proximityPosition = oldXPProximityPosition; xpctxt->proximityPosition = oldXPProximityPosition;
xpctxt->namespaces = oldXPNamespaces; xpctxt->namespaces = oldXPNamespaces;
xpctxt->nsNr = oldXPNsNr; xpctxt->nsNr = oldXPNsNr;
xmlXPathFreeCompExpr(xpExpr); xmlXPathFreeCompExpr(xpExpr);
} }
if (result == NULL) { if (result == NULL) {
@ -1549,9 +1549,9 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
} }
} }
/* /*
* If @eval is 0 then @value is to be taken literally and result is NULL * If @eval is 0 then @value is to be taken literally and result is NULL
* *
* If @eval is not 0, then @value is an XPath expression and has been * If @eval is not 0, then @value is an XPath expression and has been
* successfully evaluated and result contains the resulting value and * successfully evaluated and result contains the resulting value and
* is not NULL. * is not NULL.
@ -1579,7 +1579,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
elem->computed = 1; elem->computed = 1;
if (eval == 0) { if (eval == 0) {
elem->value = xmlXPathNewString(value); elem->value = xmlXPathNewString(value);
} }
else { else {
elem->value = result; elem->value = result;
} }
@ -1612,7 +1612,7 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
* *
* Returns 0 in case of success, -1 in case of error * Returns 0 in case of success, -1 in case of error
*/ */
int int
xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) { xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
int indx = 0; int indx = 0;
@ -1624,7 +1624,7 @@ xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
while (params[indx] != NULL) { while (params[indx] != NULL) {
name = (const xmlChar *) params[indx++]; name = (const xmlChar *) params[indx++];
value = (const xmlChar *) params[indx++]; value = (const xmlChar *) params[indx++];
if (xsltEvalOneUserParam(ctxt, name, value) != 0) if (xsltEvalOneUserParam(ctxt, name, value) != 0)
return(-1); return(-1);
} }
return 0; return 0;
@ -1642,7 +1642,7 @@ xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
* *
* Returns 0 in case of success, -1 in case of error. * Returns 0 in case of success, -1 in case of error.
*/ */
int int
xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) { xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
int indx = 0; int indx = 0;
@ -1654,7 +1654,7 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
while (params[indx] != NULL) { while (params[indx] != NULL) {
name = (const xmlChar *) params[indx++]; name = (const xmlChar *) params[indx++];
value = (const xmlChar *) params[indx++]; value = (const xmlChar *) params[indx++];
if (xsltQuoteOneUserParam(ctxt, name, value) != 0) if (xsltQuoteOneUserParam(ctxt, name, value) != 0)
return(-1); return(-1);
} }
return 0; return 0;
@ -1680,7 +1680,7 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
int int
xsltEvalOneUserParam(xsltTransformContextPtr ctxt, xsltEvalOneUserParam(xsltTransformContextPtr ctxt,
const xmlChar * name, const xmlChar * name,
const xmlChar * value) { const xmlChar * value) {
return xsltProcessUserParamInternal(ctxt, name, value, return xsltProcessUserParamInternal(ctxt, name, value,
1 /* xpath eval ? */); 1 /* xpath eval ? */);
@ -1727,7 +1727,7 @@ xsltBuildVariable(xsltTransformContextPtr ctxt,
(xsltStyleBasicItemVariablePtr) castedComp; (xsltStyleBasicItemVariablePtr) castedComp;
#else #else
xsltStylePreCompPtr comp = castedComp; xsltStylePreCompPtr comp = castedComp;
#endif #endif
xsltStackElemPtr elem; xsltStackElemPtr elem;
#ifdef WITH_XSLT_DEBUG_VARIABLE #ifdef WITH_XSLT_DEBUG_VARIABLE
@ -1777,8 +1777,8 @@ xsltRegisterVariable(xsltTransformContextPtr ctxt,
xsltStylePreCompPtr comp = castedComp; xsltStylePreCompPtr comp = castedComp;
int present; int present;
#endif #endif
xsltStackElemPtr variable; xsltStackElemPtr variable;
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
/* /*
* REFACTORED NOTE: Redefinitions of vars/params are checked * REFACTORED NOTE: Redefinitions of vars/params are checked
@ -1787,7 +1787,7 @@ xsltRegisterVariable(xsltTransformContextPtr ctxt,
*/ */
#else #else
present = xsltCheckStackElem(ctxt, comp->name, comp->ns); present = xsltCheckStackElem(ctxt, comp->name, comp->ns);
if (isParam == 0) { if (isParam == 0) {
if ((present != 0) && (present != 3)) { if ((present != 0) && (present != 3)) {
/* TODO: report QName. */ /* TODO: report QName. */
xsltTransformError(ctxt, NULL, comp->inst, xsltTransformError(ctxt, NULL, comp->inst,
@ -1903,13 +1903,13 @@ xsltVariableLookup(xsltTransformContextPtr ctxt, const xmlChar *name,
/** /**
* xsltParseStylesheetCallerParam: * xsltParseStylesheetCallerParam:
* @ctxt: the XSLT transformation context * @ctxt: the XSLT transformation context
* @inst: the xsl:with-param instruction element * @inst: the xsl:with-param instruction element
* *
* Processes an xsl:with-param instruction at transformation time. * Processes an xsl:with-param instruction at transformation time.
* The value is compute, but not recorded. * The value is compute, but not recorded.
* NOTE that this is also called with an *xsl:param* element * NOTE that this is also called with an *xsl:param* element
* from exsltFuncFunctionFunction(). * from exsltFuncFunctionFunction().
* *
* Returns the new xsltStackElemPtr or NULL * Returns the new xsltStackElemPtr or NULL
*/ */
@ -1925,7 +1925,7 @@ xsltParseStylesheetCallerParam(xsltTransformContextPtr ctxt, xmlNodePtr inst)
xmlNodePtr tree = NULL; /* The first child node of the instruction or xmlNodePtr tree = NULL; /* The first child node of the instruction or
the instruction itself. */ the instruction itself. */
xsltStackElemPtr param = NULL; xsltStackElemPtr param = NULL;
if ((ctxt == NULL) || (inst == NULL)) if ((ctxt == NULL) || (inst == NULL))
return(NULL); return(NULL);
@ -1934,7 +1934,7 @@ xsltParseStylesheetCallerParam(xsltTransformContextPtr ctxt, xmlNodePtr inst)
#else #else
comp = (xsltStylePreCompPtr) inst->psvi; comp = (xsltStylePreCompPtr) inst->psvi;
#endif #endif
if (comp == NULL) { if (comp == NULL) {
xsltTransformError(ctxt, NULL, inst, xsltTransformError(ctxt, NULL, inst,
"Internal error in xsltParseStylesheetCallerParam(): " "Internal error in xsltParseStylesheetCallerParam(): "
@ -1987,7 +1987,7 @@ xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur)
if ((cur == NULL) || (style == NULL)) if ((cur == NULL) || (style == NULL))
return; return;
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
/* /*
* Note that xsltStylePreCompute() will be called from * Note that xsltStylePreCompute() will be called from
@ -2014,7 +2014,7 @@ xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur)
* Parse the content (a sequence constructor) of xsl:variable. * Parse the content (a sequence constructor) of xsl:variable.
*/ */
if (cur->children != NULL) { if (cur->children != NULL) {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
xsltParseSequenceConstructor(XSLT_CCTXT(style), cur->children); xsltParseSequenceConstructor(XSLT_CCTXT(style), cur->children);
#else #else
xsltParseTemplateContent(style, cur); xsltParseTemplateContent(style, cur);
@ -2049,7 +2049,7 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) {
if ((cur == NULL) || (style == NULL)) if ((cur == NULL) || (style == NULL))
return; return;
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
/* /*
* Note that xsltStylePreCompute() will be called from * Note that xsltStylePreCompute() will be called from
@ -2059,7 +2059,7 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) {
#else #else
xsltStylePreCompute(style, cur); xsltStylePreCompute(style, cur);
comp = (xsltStylePreCompPtr) cur->psvi; comp = (xsltStylePreCompPtr) cur->psvi;
#endif #endif
if (comp == NULL) { if (comp == NULL) {
xsltTransformError(NULL, style, cur, xsltTransformError(NULL, style, cur,
"xsl:param : compilation failed\n"); "xsl:param : compilation failed\n");
@ -2076,7 +2076,7 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) {
* Parse the content (a sequence constructor) of xsl:param. * Parse the content (a sequence constructor) of xsl:param.
*/ */
if (cur->children != NULL) { if (cur->children != NULL) {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
xsltParseSequenceConstructor(XSLT_CCTXT(style), cur->children); xsltParseSequenceConstructor(XSLT_CCTXT(style), cur->children);
#else #else
xsltParseTemplateContent(style, cur); xsltParseTemplateContent(style, cur);
@ -2208,7 +2208,7 @@ xsltXPathVariableLookup(void *ctxt, const xmlChar *name,
XSLT_TRACE(((xsltTransformContextPtr)ctxt),XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext, XSLT_TRACE(((xsltTransformContextPtr)ctxt),XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
"Lookup variable '%s'\n", name)); "Lookup variable '%s'\n", name));
#endif #endif
tctxt = (xsltTransformContextPtr) ctxt; tctxt = (xsltTransformContextPtr) ctxt;
/* /*
* Local variables/params --------------------------------------------- * Local variables/params ---------------------------------------------
@ -2232,7 +2232,7 @@ xsltXPathVariableLookup(void *ctxt, const xmlChar *name,
goto local_variable_found; goto local_variable_found;
} }
cur = cur->next; cur = cur->next;
} }
/* /*
* Redo the lookup with interned strings to avoid string comparison. * Redo the lookup with interned strings to avoid string comparison.
* *
@ -2245,7 +2245,7 @@ xsltXPathVariableLookup(void *ctxt, const xmlChar *name,
name = xmlDictLookup(tctxt->dict, name, -1); name = xmlDictLookup(tctxt->dict, name, -1);
if (ns_uri) if (ns_uri)
ns_uri = xmlDictLookup(tctxt->dict, ns_uri, -1); ns_uri = xmlDictLookup(tctxt->dict, ns_uri, -1);
if ((tmpName != name) || (tmpNsName != ns_uri)) { if ((tmpName != name) || (tmpNsName != ns_uri)) {
for (i = tctxt->varsNr; i > tctxt->varsBase; i--) { for (i = tctxt->varsNr; i > tctxt->varsBase; i--) {
cur = tctxt->varsTab[i-1]; cur = tctxt->varsTab[i-1];
if ((cur->name == name) && (cur->nameURI == ns_uri)) { if ((cur->name == name) && (cur->nameURI == ns_uri)) {
@ -2263,7 +2263,7 @@ local_variable_found:
if (variable) { if (variable) {
if (variable->computed == 0) { if (variable->computed == 0) {
#ifdef WITH_XSLT_DEBUG_VARIABLE #ifdef WITH_XSLT_DEBUG_VARIABLE
XSLT_TRACE(tctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext, XSLT_TRACE(tctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
"uncomputed variable '%s'\n", name)); "uncomputed variable '%s'\n", name));
@ -2272,14 +2272,14 @@ local_variable_found:
variable->computed = 1; variable->computed = 1;
} }
if (variable->value != NULL) { if (variable->value != NULL) {
valueObj = xmlXPathObjectCopy(variable->value); valueObj = xmlXPathObjectCopy(variable->value);
} }
return(valueObj); return(valueObj);
} }
} }
/* /*
* Global variables/params -------------------------------------------- * Global variables/params --------------------------------------------
*/ */
if (tctxt->globalVars) { if (tctxt->globalVars) {
valueObj = xsltGlobalVariableLookup(tctxt, name, ns_uri); valueObj = xsltGlobalVariableLookup(tctxt, name, ns_uri);
} }

View file

@ -38,48 +38,48 @@ extern "C" {
* Interfaces for the variable module. * Interfaces for the variable module.
*/ */
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltEvalGlobalVariables (xsltTransformContextPtr ctxt); xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltEvalUserParams (xsltTransformContextPtr ctxt, xsltEvalUserParams (xsltTransformContextPtr ctxt,
const char **params); const char **params);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltQuoteUserParams (xsltTransformContextPtr ctxt, xsltQuoteUserParams (xsltTransformContextPtr ctxt,
const char **params); const char **params);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltEvalOneUserParam (xsltTransformContextPtr ctxt, xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
const xmlChar * name, const xmlChar * name,
const xmlChar * value); const xmlChar * value);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltQuoteOneUserParam (xsltTransformContextPtr ctxt, xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
const xmlChar * name, const xmlChar * name,
const xmlChar * value); const xmlChar * value);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseGlobalVariable (xsltStylesheetPtr style, xsltParseGlobalVariable (xsltStylesheetPtr style,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseGlobalParam (xsltStylesheetPtr style, xsltParseGlobalParam (xsltStylesheetPtr style,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseStylesheetVariable (xsltTransformContextPtr ctxt, xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseStylesheetParam (xsltTransformContextPtr ctxt, xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN xsltStackElemPtr XSLTCALL XSLTPUBFUN xsltStackElemPtr XSLTCALL
xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt, xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltAddStackElemList (xsltTransformContextPtr ctxt, xsltAddStackElemList (xsltTransformContextPtr ctxt,
xsltStackElemPtr elems); xsltStackElemPtr elems);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeGlobalVariables (xsltTransformContextPtr ctxt); xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
xsltVariableLookup (xsltTransformContextPtr ctxt, xsltVariableLookup (xsltTransformContextPtr ctxt,
const xmlChar *name, const xmlChar *name,
const xmlChar *ns_uri); const xmlChar *ns_uri);
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
xsltXPathVariableLookup (void *ctxt, xsltXPathVariableLookup (void *ctxt,
const xmlChar *name, const xmlChar *name,
const xmlChar *ns_uri); const xmlChar *ns_uri);

View file

@ -28,12 +28,12 @@
#include <math.h> #include <math.h>
#if defined _MSC_VER || defined __MINGW32__ #if defined _MSC_VER || defined __MINGW32__
/* MS C-runtime has functions which can be used in order to determine if /* MS C-runtime has functions which can be used in order to determine if
a given floating-point variable contains NaN, (+-)INF. These are a given floating-point variable contains NaN, (+-)INF. These are
preferred, because floating-point technology is considered propriatary preferred, because floating-point technology is considered propriatary
by MS and we can assume that their functions know more about their by MS and we can assume that their functions know more about their
oddities than we do. */ oddities than we do. */
#include <float.h> #include <float.h>
/* Bjorn Reese figured a quite nice construct for isinf() using the /* Bjorn Reese figured a quite nice construct for isinf() using the
_fpclass() function. */ _fpclass() function. */
#ifndef isinf #ifndef isinf
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \ #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \

File diff suppressed because it is too large Load diff

View file

@ -84,41 +84,41 @@ xsltNewLocale(const xmlChar *languageTag) {
const char *region = NULL; const char *region = NULL;
char *q = localeName; char *q = localeName;
int i, llen; int i, llen;
/* Convert something like "pt-br" to "pt_BR.utf8" */ /* Convert something like "pt-br" to "pt_BR.utf8" */
if (languageTag == NULL) if (languageTag == NULL)
return(NULL); return(NULL);
for (i=0; i<XSLTMAX_ISO639LANGLEN && ISALPHA(*p); ++i) for (i=0; i<XSLTMAX_ISO639LANGLEN && ISALPHA(*p); ++i)
*q++ = TOLOWER(*p++); *q++ = TOLOWER(*p++);
if (i == 0) if (i == 0)
return(NULL); return(NULL);
llen = i; llen = i;
*q++ = '_'; *q++ = '_';
if (*p) { if (*p) {
if (*p++ != '-') if (*p++ != '-')
return(NULL); return(NULL);
for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i) for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i)
*q++ = TOUPPER(*p++); *q++ = TOUPPER(*p++);
if (i == 0 || *p) if (i == 0 || *p)
return(NULL); return(NULL);
memcpy(q, ".utf8", 6); memcpy(q, ".utf8", 6);
locale = newlocale(LC_COLLATE_MASK, localeName, NULL); locale = newlocale(LC_COLLATE_MASK, localeName, NULL);
if (locale != NULL) if (locale != NULL)
return(locale); return(locale);
/* Continue without using country code */ /* Continue without using country code */
q = localeName + llen + 1; q = localeName + llen + 1;
} }
/* Try locale without territory, e.g. for Esperanto (eo) */ /* Try locale without territory, e.g. for Esperanto (eo) */
memcpy(q, ".utf8", 6); memcpy(q, ".utf8", 6);
@ -127,20 +127,20 @@ xsltNewLocale(const xmlChar *languageTag) {
return(locale); return(locale);
/* Try to find most common country for language */ /* Try to find most common country for language */
if (llen != 2) if (llen != 2)
return(NULL); return(NULL);
region = (char *)xsltDefaultRegion((xmlChar *)localeName); region = (char *)xsltDefaultRegion((xmlChar *)localeName);
if (region == NULL) if (region == NULL)
return(NULL); return(NULL);
q = localeName + llen + 1; q = localeName + llen + 1;
*q++ = region[0]; *q++ = region[0];
*q++ = region[1]; *q++ = region[1];
memcpy(q, ".utf8", 6); memcpy(q, ".utf8", 6);
locale = newlocale(LC_COLLATE_MASK, localeName, NULL); locale = newlocale(LC_COLLATE_MASK, localeName, NULL);
return(locale); return(locale);
#endif #endif
@ -165,7 +165,7 @@ xsltNewLocale(const xmlChar *languageTag) {
*q++ = '-'; *q++ = '-';
if (*p) { /*if country tag is given*/ if (*p) { /*if country tag is given*/
if (*p++ != '-') goto end; if (*p++ != '-') goto end;
for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i) for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i)
*q++ = TOUPPER(*p++); *q++ = TOUPPER(*p++);
if (i == 0 || *p) goto end; if (i == 0 || *p) goto end;
@ -195,10 +195,10 @@ xsltDefaultRegion(const xmlChar *localeName) {
xmlChar c; xmlChar c;
/* region should be xmlChar, but gcc warns on all string assignments */ /* region should be xmlChar, but gcc warns on all string assignments */
const char *region = NULL; const char *region = NULL;
c = localeName[1]; c = localeName[1];
/* This is based on the locales from glibc 2.3.3 */ /* This is based on the locales from glibc 2.3.3 */
switch (localeName[0]) { switch (localeName[0]) {
case 'a': case 'a':
if (c == 'a' || c == 'm') region = "ET"; if (c == 'a' || c == 'm') region = "ET";
@ -359,7 +359,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
#else #else
size_t xstrlen, r; size_t xstrlen, r;
xsltLocaleChar *xstr; xsltLocaleChar *xstr;
#ifdef XSLT_LOCALE_XLOCALE #ifdef XSLT_LOCALE_XLOCALE
xstrlen = strxfrm_l(NULL, (const char *)string, 0, locale) + 1; xstrlen = strxfrm_l(NULL, (const char *)string, 0, locale) + 1;
xstr = (xsltLocaleChar *) xmlMalloc(xstrlen); xstr = (xsltLocaleChar *) xmlMalloc(xstrlen);

View file

@ -53,9 +53,9 @@
#endif /* WIN32 */ #endif /* WIN32 */
/************************************************************************ /************************************************************************
* * * *
* Convenience function * * Convenience function *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -130,7 +130,7 @@ xsltGetCNsProp(xsltStylesheetPtr style, xmlNodePtr node,
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name); attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL)) if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name); attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) { if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
/* /*
* The DTD declaration only allows a prefix search * The DTD declaration only allows a prefix search
@ -216,7 +216,7 @@ xsltGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name); attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL)) if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name); attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) { if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
/* /*
* The DTD declaration only allows a prefix search * The DTD declaration only allows a prefix search
@ -314,7 +314,7 @@ error:
* -1 in case of an error. * -1 in case of an error.
*/ */
int int
xsltPointerListAddSize(xsltPointerListPtr list, xsltPointerListAddSize(xsltPointerListPtr list,
void *item, void *item,
int initialSize) int initialSize)
{ {
@ -410,9 +410,9 @@ xsltPointerListClear(xsltPointerListPtr list)
#endif /* XSLT_REFACTORED */ #endif /* XSLT_REFACTORED */
/************************************************************************ /************************************************************************
* * * *
* Handling of XSLT stylesheets messages * * Handling of XSLT stylesheets messages *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -465,9 +465,9 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
} }
/************************************************************************ /************************************************************************
* * * *
* Handling of out of context errors * * Handling of out of context errors *
* * * *
************************************************************************/ ************************************************************************/
#define XSLT_GET_VAR_STR(msg, str) { \ #define XSLT_GET_VAR_STR(msg, str) { \
@ -477,14 +477,14 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
va_list ap; \ va_list ap; \
\ \
str = (char *) xmlMalloc(150); \ str = (char *) xmlMalloc(150); \
if (str == NULL) \ if (str == NULL) \
return; \ return; \
\ \
size = 150; \ size = 150; \
\ \
while (size < 64000) { \ while (size < 64000) { \
va_start(ap, msg); \ va_start(ap, msg); \
chars = vsnprintf(str, size, msg, ap); \ chars = vsnprintf(str, size, msg, ap); \
va_end(ap); \ va_end(ap); \
if ((chars > -1) && (chars < size)) \ if ((chars > -1) && (chars < size)) \
break; \ break; \
@ -504,7 +504,7 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
* @ctx: an error context * @ctx: an error context
* @msg: the message to display/transmit * @msg: the message to display/transmit
* @...: extra parameters for the message display * @...: extra parameters for the message display
* *
* Default handler for out of context error messages. * Default handler for out of context error messages.
*/ */
static void static void
@ -550,7 +550,7 @@ xsltSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
* @ctx: an error context * @ctx: an error context
* @msg: the message to display/transmit * @msg: the message to display/transmit
* @...: extra parameters for the message display * @...: extra parameters for the message display
* *
* Default handler for out of context error messages. * Default handler for out of context error messages.
*/ */
static void static void
@ -632,8 +632,8 @@ xsltPrintErrorContext(xsltTransformContextPtr ctxt,
if (node->name != NULL) if (node->name != NULL)
name = node->name; name = node->name;
} }
} }
if (ctxt != NULL) if (ctxt != NULL)
type = "runtime error"; type = "runtime error";
else if (style != NULL) { else if (style != NULL) {
@ -719,9 +719,9 @@ xsltTransformError(xsltTransformContextPtr ctxt,
} }
/************************************************************************ /************************************************************************
* * * *
* QNames * * QNames *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -796,9 +796,9 @@ xsltGetQNameURI(xmlNodePtr node, xmlChar ** name)
* we are not trying to validate but just to cut, and yes it will * we are not trying to validate but just to cut, and yes it will
* work even if this is a set of UTF-8 encoded chars * work even if this is a set of UTF-8 encoded chars
*/ */
while ((qname[len] != 0) && (qname[len] != ':')) while ((qname[len] != 0) && (qname[len] != ':'))
len++; len++;
if (qname[len] == 0) if (qname[len] == 0)
return(NULL); return(NULL);
@ -903,11 +903,11 @@ xsltGetQNameURI2(xsltStylesheetPtr style, xmlNodePtr node,
xmlFree(qname); xmlFree(qname);
return(ns->href); return(ns->href);
} }
/************************************************************************ /************************************************************************
* * * *
* Sorting * * Sorting *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -962,7 +962,7 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
xmlNodeSetPtr list = NULL; xmlNodeSetPtr list = NULL;
xmlXPathObjectPtr res; xmlXPathObjectPtr res;
int len = 0; int len = 0;
int i; int i;
xmlNodePtr oldNode; xmlNodePtr oldNode;
xmlNodePtr oldInst; xmlNodePtr oldInst;
int oldPos, oldSize ; int oldPos, oldSize ;
@ -1078,7 +1078,7 @@ xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
* reorder the current node list accordingly to the set of sorting * reorder the current node list accordingly to the set of sorting
* requirement provided by the arry of nodes. * requirement provided by the arry of nodes.
*/ */
void void
xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
int nbsorts) { int nbsorts) {
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
@ -1095,7 +1095,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
int tst; int tst;
int depth; int depth;
xmlNodePtr node; xmlNodePtr node;
xmlXPathObjectPtr tmp; xmlXPathObjectPtr tmp;
int tempstype[XSLT_MAX_SORT], temporder[XSLT_MAX_SORT]; int tempstype[XSLT_MAX_SORT], temporder[XSLT_MAX_SORT];
if ((ctxt == NULL) || (sorts == NULL) || (nbsorts <= 0) || if ((ctxt == NULL) || (sorts == NULL) || (nbsorts <= 0) ||
@ -1175,7 +1175,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
j = i - incr; j = i - incr;
if (results[i] == NULL) if (results[i] == NULL)
continue; continue;
while (j >= 0) { while (j >= 0) {
if (results[j] == NULL) if (results[j] == NULL)
tst = 1; tst = 1;
@ -1193,7 +1193,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
else if (results[j]->floatval == else if (results[j]->floatval ==
results[j + incr]->floatval) results[j + incr]->floatval)
tst = 0; tst = 0;
else if (results[j]->floatval > else if (results[j]->floatval >
results[j + incr]->floatval) results[j + incr]->floatval)
tst = 1; tst = 1;
else tst = -1; else tst = -1;
@ -1201,10 +1201,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
tst = xsltLocaleStrcmp( tst = xsltLocaleStrcmp(
comp->locale, comp->locale,
(xsltLocaleChar *) results[j]->stringval, (xsltLocaleChar *) results[j]->stringval,
(xsltLocaleChar *) results[j + incr]->stringval); (xsltLocaleChar *) results[j + incr]->stringval);
} else { } else {
tst = xmlStrcmp(results[j]->stringval, tst = xmlStrcmp(results[j]->stringval,
results[j + incr]->stringval); results[j + incr]->stringval);
} }
if (descending) if (descending)
tst = -tst; tst = -tst;
@ -1227,11 +1227,11 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
* Compute the result of the next level for the * Compute the result of the next level for the
* full set, this might be optimized ... or not * full set, this might be optimized ... or not
*/ */
if (resultsTab[depth] == NULL) if (resultsTab[depth] == NULL)
resultsTab[depth] = xsltComputeSortResult(ctxt, resultsTab[depth] = xsltComputeSortResult(ctxt,
sorts[depth]); sorts[depth]);
res = resultsTab[depth]; res = resultsTab[depth];
if (res == NULL) if (res == NULL)
break; break;
if (res[j] == NULL) { if (res[j] == NULL) {
if (res[j+incr] != NULL) if (res[j+incr] != NULL)
@ -1242,7 +1242,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
accordance with XSLT spec */ accordance with XSLT spec */
if (xmlXPathIsNaN(res[j]->floatval)) { if (xmlXPathIsNaN(res[j]->floatval)) {
if (xmlXPathIsNaN(res[j + if (xmlXPathIsNaN(res[j +
incr]->floatval)) incr]->floatval))
tst = 0; tst = 0;
else else
tst = -1; tst = -1;
@ -1252,7 +1252,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
else if (res[j]->floatval == res[j + incr]-> else if (res[j]->floatval == res[j + incr]->
floatval) floatval)
tst = 0; tst = 0;
else if (res[j]->floatval > else if (res[j]->floatval >
res[j + incr]->floatval) res[j + incr]->floatval)
tst = 1; tst = 1;
else tst = -1; else tst = -1;
@ -1260,10 +1260,10 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
tst = xsltLocaleStrcmp( tst = xsltLocaleStrcmp(
comp->locale, comp->locale,
(xsltLocaleChar *) res[j]->stringval, (xsltLocaleChar *) res[j]->stringval,
(xsltLocaleChar *) res[j + incr]->stringval); (xsltLocaleChar *) res[j + incr]->stringval);
} else { } else {
tst = xmlStrcmp(res[j]->stringval, tst = xmlStrcmp(res[j]->stringval,
res[j + incr]->stringval); res[j + incr]->stringval);
} }
if (desc) if (desc)
tst = -tst; tst = -tst;
@ -1375,32 +1375,32 @@ xsltSetSortFunc(xsltSortFunc handler) {
* @handler: the new handler function * @handler: the new handler function
* *
* Function to set the handler for XSLT sorting * Function to set the handler for XSLT sorting
* for the specified context. * for the specified context.
* If the handler is NULL, then the global * If the handler is NULL, then the global
* sort function will be called * sort function will be called
*/ */
void void
xsltSetCtxtSortFunc(xsltTransformContextPtr ctxt, xsltSortFunc handler) { xsltSetCtxtSortFunc(xsltTransformContextPtr ctxt, xsltSortFunc handler) {
ctxt->sortfunc = handler; ctxt->sortfunc = handler;
} }
/************************************************************************ /************************************************************************
* * * *
* Parsing options * * Parsing options *
* * * *
************************************************************************/ ************************************************************************/
/** /**
* xsltSetCtxtParseOptions: * xsltSetCtxtParseOptions:
* @ctxt: a XSLT process context * @ctxt: a XSLT process context
* @options: a combination of libxml2 xmlParserOption * @options: a combination of libxml2 xmlParserOption
* *
* Change the default parser option passed by the XSLT engine to the * Change the default parser option passed by the XSLT engine to the
* parser when using document() loading. * parser when using document() loading.
* *
* Returns the previous options or -1 in case of error * Returns the previous options or -1 in case of error
*/ */
int int
xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options) xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
{ {
int oldopts; int oldopts;
@ -1419,9 +1419,9 @@ xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
} }
/************************************************************************ /************************************************************************
* * * *
* Output * * Output *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -1512,7 +1512,7 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result,
cur = cur->next; cur = cur->next;
continue; continue;
} }
do { do {
cur = cur->parent; cur = cur->parent;
if (cur == NULL) if (cur == NULL)
@ -1537,7 +1537,7 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result,
if (omitXmlDecl != 1) { if (omitXmlDecl != 1) {
xmlOutputBufferWriteString(buf, "<?xml version="); xmlOutputBufferWriteString(buf, "<?xml version=");
if (result->version != NULL) if (result->version != NULL)
xmlBufferWriteQuotedString(buf->buffer, result->version); xmlBufferWriteQuotedString(buf->buffer, result->version);
else else
xmlOutputBufferWriteString(buf, "\"1.0\""); xmlOutputBufferWriteString(buf, "\"1.0\"");
@ -1728,7 +1728,7 @@ xsltSaveResultToFd(int fd, xmlDocPtr result, xsltStylesheetPtr style) {
* Returns 0 in case of success and -1 in case of error * Returns 0 in case of success and -1 in case of error
*/ */
int int
xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len, xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
xmlDocPtr result, xsltStylesheetPtr style) { xmlDocPtr result, xsltStylesheetPtr style) {
xmlOutputBufferPtr buf; xmlOutputBufferPtr buf;
const xmlChar *encoding; const xmlChar *encoding;
@ -1766,9 +1766,9 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
} }
/************************************************************************ /************************************************************************
* * * *
* Generating profiling informations * * Generating profiling informations *
* * * *
************************************************************************/ ************************************************************************/
static long calibration = -1; static long calibration = -1;
@ -1857,7 +1857,7 @@ xsltTimestamp(void)
tics = (cur.tv_sec - startup.tv_sec) * XSLT_TIMESTAMP_TICS_PER_SEC; tics = (cur.tv_sec - startup.tv_sec) * XSLT_TIMESTAMP_TICS_PER_SEC;
tics += (cur.tv_usec - startup.tv_usec) / tics += (cur.tv_usec - startup.tv_usec) /
(1000000l / XSLT_TIMESTAMP_TICS_PER_SEC); (1000000l / XSLT_TIMESTAMP_TICS_PER_SEC);
tics -= calibration; tics -= calibration;
return(tics); return(tics);
#else #else
@ -1969,9 +1969,9 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
} }
/************************************************************************ /************************************************************************
* * * *
* Fetching profiling informations * * Fetching profiling informations *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -2084,9 +2084,9 @@ xsltGetProfileInformation(xsltTransformContextPtr ctxt)
} }
/************************************************************************ /************************************************************************
* * * *
* Hooks for libxml2 XPath * * Hooks for libxml2 XPath *
* * * *
************************************************************************/ ************************************************************************/
/** /**
@ -2153,9 +2153,9 @@ xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str) {
} }
/************************************************************************ /************************************************************************
* * * *
* Hooks for the debugger * * Hooks for the debugger *
* * * *
************************************************************************/ ************************************************************************/
/* /*
@ -2183,18 +2183,18 @@ int xslDebugStatus;
/** /**
* xsltSetDebuggerStatus: * xsltSetDebuggerStatus:
* @value : the value to be set * @value : the value to be set
* *
* This function sets the value of xslDebugStatus. * This function sets the value of xslDebugStatus.
*/ */
void void
xsltSetDebuggerStatus(int value) xsltSetDebuggerStatus(int value)
{ {
xslDebugStatus = value; xslDebugStatus = value;
} }
/** /**
* xsltGetDebuggerStatus: * xsltGetDebuggerStatus:
* *
* Get xslDebugStatus. * Get xslDebugStatus.
* *
* Returns the value of xslDebugStatus. * Returns the value of xslDebugStatus.
@ -2202,16 +2202,16 @@ xsltSetDebuggerStatus(int value)
int int
xsltGetDebuggerStatus(void) xsltGetDebuggerStatus(void)
{ {
return(xslDebugStatus); return(xslDebugStatus);
} }
/** /**
* xsltSetDebuggerCallbacks: * xsltSetDebuggerCallbacks:
* @no : number of callbacks * @no : number of callbacks
* @block : the block of callbacks * @block : the block of callbacks
* *
* This function allow to plug a debugger into the XSLT library * This function allow to plug a debugger into the XSLT library
* @block points to a block of memory containing the address of @no * @block points to a block of memory containing the address of @no
* callback routines. * callback routines.
* *
* Returns 0 in case of success and -1 in case of error * Returns 0 in case of success and -1 in case of error
@ -2236,9 +2236,9 @@ xsltSetDebuggerCallbacks(int no, void *block)
* @cur : source node being executed * @cur : source node being executed
* @node : data node being processed * @node : data node being processed
* @templ : temlate that applies to node * @templ : temlate that applies to node
* @ctxt : the xslt transform context * @ctxt : the xslt transform context
* *
* If either cur or node are a breakpoint, or xslDebugStatus in state * If either cur or node are a breakpoint, or xslDebugStatus in state
* where debugging must occcur at this time then transfer control * where debugging must occcur at this time then transfer control
* to the xslDebugBreak function * to the xslDebugBreak function
*/ */
@ -2256,7 +2256,7 @@ xslHandleDebugger(xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ,
* @source : the source node being processed * @source : the source node being processed
* *
* Add template "call" to call stack * Add template "call" to call stack
* Returns : 1 on sucess 0 otherwise an error may be printed if * Returns : 1 on sucess 0 otherwise an error may be printed if
* WITH_XSLT_DEBUG_BREAKPOINTS is defined * WITH_XSLT_DEBUG_BREAKPOINTS is defined
*/ */
int int

View file

@ -23,7 +23,7 @@
#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC #if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC
#define LIBXSLT_PUBLIC __declspec(dllimport) #define LIBXSLT_PUBLIC __declspec(dllimport)
#else #else
#define LIBXSLT_PUBLIC #define LIBXSLT_PUBLIC
#endif #endif
#endif #endif

View file

@ -24,7 +24,7 @@ extern "C" {
*/ */
typedef struct _xsltNumberData xsltNumberData; typedef struct _xsltNumberData xsltNumberData;
typedef xsltNumberData *xsltNumberDataPtr; typedef xsltNumberData *xsltNumberDataPtr;
struct _xsltNumberData { struct _xsltNumberData {
const xmlChar *level; const xmlChar *level;
const xmlChar *count; const xmlChar *count;

View file

@ -1,7 +1,7 @@
/* /*
* Summary: internal data structures, constants and functions * Summary: internal data structures, constants and functions
* Description: Internal data structures, constants and functions used * Description: Internal data structures, constants and functions used
* by the XSLT engine. * by the XSLT engine.
* They are not part of the API or ABI, i.e. they can change * They are not part of the API or ABI, i.e. they can change
* without prior notice, use carefully. * without prior notice, use carefully.
* *
@ -101,7 +101,7 @@ extern const xmlChar *xsltXSLTAttrMarker;
* XSLT_REFACTORED_XSLT_NSCOMP * XSLT_REFACTORED_XSLT_NSCOMP
* *
* Internal define to enable the pointer-comparison of * Internal define to enable the pointer-comparison of
* namespaces of XSLT elements. * namespaces of XSLT elements.
*/ */
/* #define XSLT_REFACTORED_XSLT_NSCOMP */ /* #define XSLT_REFACTORED_XSLT_NSCOMP */
@ -474,7 +474,7 @@ struct _xsltElemPreComp {
xsltElemPreCompPtr next; /* next item in the global chained xsltElemPreCompPtr next; /* next item in the global chained
list hold by xsltStylesheet. */ list hold by xsltStylesheet. */
xsltStyleType type; /* type of the element */ xsltStyleType type; /* type of the element */
xsltTransformFunction func; /* handling function */ xsltTransformFunction func; /* handling function */
xmlNodePtr inst; /* the node in the stylesheet's tree xmlNodePtr inst; /* the node in the stylesheet's tree
corresponding to this item */ corresponding to this item */
@ -506,7 +506,7 @@ XSLTPUBFUN void XSLTCALL
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltPointerListClear (xsltPointerListPtr list); xsltPointerListClear (xsltPointerListPtr list);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltPointerListAddSize (xsltPointerListPtr list, xsltPointerListAddSize (xsltPointerListPtr list,
void *item, void *item,
int initialSize); int initialSize);
@ -521,12 +521,12 @@ typedef xsltNsListContainer *xsltNsListContainerPtr;
struct _xsltNsListContainer { struct _xsltNsListContainer {
xmlNsPtr *list; xmlNsPtr *list;
int totalNumber; int totalNumber;
int xpathNumber; int xpathNumber;
}; };
/** /**
* XSLT_ITEM_COMPATIBILITY_FIELDS: * XSLT_ITEM_COMPATIBILITY_FIELDS:
* *
* Fields for API compatibility to the structure * Fields for API compatibility to the structure
* _xsltElemPreComp which is used for extension functions. * _xsltElemPreComp which is used for extension functions.
* Note that @next is used for storage; it does not reflect a next * Note that @next is used for storage; it does not reflect a next
@ -549,7 +549,7 @@ struct _xsltNsListContainer {
/* /*
xsltStylePreCompPtr parent;\ xsltStylePreCompPtr parent;\
xsltStylePreCompPtr children;\ xsltStylePreCompPtr children;\
xsltStylePreCompPtr nextItem; xsltStylePreCompPtr nextItem;
*/ */
/** /**
@ -570,7 +570,7 @@ struct _xsltNsListContainer {
XSLT_ITEM_NSINSCOPE_FIELDS XSLT_ITEM_NSINSCOPE_FIELDS
/** /**
* _xsltStylePreComp: * _xsltStylePreComp:
* *
* The abstract basic structure for items of the XSLT processor. * The abstract basic structure for items of the XSLT processor.
* This includes: * This includes:
@ -585,7 +585,7 @@ struct _xsltNsListContainer {
struct _xsltStylePreComp { struct _xsltStylePreComp {
xsltElemPreCompPtr next; /* next item in the global chained xsltElemPreCompPtr next; /* next item in the global chained
list hold by xsltStylesheet */ list hold by xsltStylesheet */
xsltStyleType type; /* type of the item */ xsltStyleType type; /* type of the item */
xsltTransformFunction func; /* handling function */ xsltTransformFunction func; /* handling function */
xmlNodePtr inst; /* the node in the stylesheet's tree xmlNodePtr inst; /* the node in the stylesheet's tree
corresponding to this item. */ corresponding to this item. */
@ -595,7 +595,7 @@ struct _xsltStylePreComp {
/** /**
* xsltStyleBasicEmptyItem: * xsltStyleBasicEmptyItem:
* *
* Abstract structure only used as a short-cut for * Abstract structure only used as a short-cut for
* XSLT items with no extra fields. * XSLT items with no extra fields.
* NOTE that it is intended that this structure looks the same as * NOTE that it is intended that this structure looks the same as
@ -610,7 +610,7 @@ struct _xsltStyleBasicEmptyItem {
/** /**
* xsltStyleBasicExpressionItem: * xsltStyleBasicExpressionItem:
* *
* Abstract structure only used as a short-cut for * Abstract structure only used as a short-cut for
* XSLT items with just an expression. * XSLT items with just an expression.
*/ */
@ -632,7 +632,7 @@ struct _xsltStyleBasicExpressionItem {
/** /**
* xsltStyleItemElement: * xsltStyleItemElement:
* *
* <!-- Category: instruction --> * <!-- Category: instruction -->
* <xsl:element * <xsl:element
* name = { qname } * name = { qname }
@ -645,11 +645,11 @@ typedef struct _xsltStyleItemElement xsltStyleItemElement;
typedef xsltStyleItemElement *xsltStyleItemElementPtr; typedef xsltStyleItemElement *xsltStyleItemElementPtr;
struct _xsltStyleItemElement { struct _xsltStyleItemElement {
XSLT_ITEM_COMMON_FIELDS XSLT_ITEM_COMMON_FIELDS
const xmlChar *use; const xmlChar *use;
int has_use; int has_use;
const xmlChar *name; const xmlChar *name;
int has_name; int has_name;
const xmlChar *ns; const xmlChar *ns;
const xmlChar *nsPrefix; const xmlChar *nsPrefix;
@ -794,7 +794,7 @@ typedef xsltStyleItemCopy *xsltStyleItemCopyPtr;
struct _xsltStyleItemCopy { struct _xsltStyleItemCopy {
XSLT_ITEM_COMMON_FIELDS XSLT_ITEM_COMMON_FIELDS
const xmlChar *use; /* copy, element */ const xmlChar *use; /* copy, element */
int has_use; /* copy, element */ int has_use; /* copy, element */
}; };
/** /**
@ -916,7 +916,7 @@ typedef struct _xsltStyleItemMessage xsltStyleItemMessage;
typedef xsltStyleItemMessage *xsltStyleItemMessagePtr; typedef xsltStyleItemMessage *xsltStyleItemMessagePtr;
struct _xsltStyleItemMessage { struct _xsltStyleItemMessage {
XSLT_ITEM_COMMON_FIELDS XSLT_ITEM_COMMON_FIELDS
int terminate; int terminate;
}; };
@ -935,7 +935,7 @@ struct _xsltStyleItemDocument {
TODO: Check if we need. */ TODO: Check if we need. */
const xmlChar *filename; /* document URL */ const xmlChar *filename; /* document URL */
int has_filename; int has_filename;
}; };
/************************************************************************ /************************************************************************
* * * *
@ -1005,7 +1005,7 @@ struct _xsltStyleItemParam {
const xmlChar *name; const xmlChar *name;
int has_name; int has_name;
const xmlChar *ns; const xmlChar *ns;
int has_ns; int has_ns;
}; };
/** /**
@ -1061,7 +1061,7 @@ struct _xsltStyleItemSort {
/** /**
* xsltStyleItemWhen: * xsltStyleItemWhen:
* *
* <xsl:when * <xsl:when
* test = boolean-expression> * test = boolean-expression>
* <!-- Content: template --> * <!-- Content: template -->
@ -1144,7 +1144,7 @@ typedef struct _xsltStyleItemExtElement xsltStyleItemExtElement;
typedef xsltStyleItemExtElement *xsltStyleItemExtElementPtr; typedef xsltStyleItemExtElement *xsltStyleItemExtElementPtr;
struct _xsltStyleItemExtElement { struct _xsltStyleItemExtElement {
XSLT_ITEM_COMMON_FIELDS XSLT_ITEM_COMMON_FIELDS
xsltElemPreCompPtr item; xsltElemPreCompPtr item;
}; };
/************************************************************************ /************************************************************************
@ -1160,7 +1160,7 @@ struct _xsltEffectiveNs {
xsltEffectiveNsPtr next; /* next item in the list */ xsltEffectiveNsPtr next; /* next item in the list */
const xmlChar *prefix; const xmlChar *prefix;
const xmlChar *nsName; const xmlChar *nsName;
/* /*
* Indicates if eclared on the literal result element; dunno if really * Indicates if eclared on the literal result element; dunno if really
* needed. * needed.
*/ */
@ -1196,7 +1196,7 @@ struct _xsltStyleItemLRElementInfo {
typedef struct _xsltNsAlias xsltNsAlias; typedef struct _xsltNsAlias xsltNsAlias;
typedef xsltNsAlias *xsltNsAliasPtr; typedef xsltNsAlias *xsltNsAliasPtr;
struct _xsltNsAlias { struct _xsltNsAlias {
xsltNsAliasPtr next; /* next in the list */ xsltNsAliasPtr next; /* next in the list */
xmlNsPtr literalNs; xmlNsPtr literalNs;
xmlNsPtr targetNs; xmlNsPtr targetNs;
xmlDocPtr docOfTargetNs; xmlDocPtr docOfTargetNs;
@ -1213,7 +1213,7 @@ struct _xsltNsMap {
xmlNodePtr elem; /* the element holding the ns-decl */ xmlNodePtr elem; /* the element holding the ns-decl */
xmlNsPtr ns; /* the xmlNs structure holding the XML namespace name */ xmlNsPtr ns; /* the xmlNs structure holding the XML namespace name */
const xmlChar *origNsName; /* the original XML namespace name */ const xmlChar *origNsName; /* the original XML namespace name */
const xmlChar *newNsName; /* the mapped XML namespace name */ const xmlChar *newNsName; /* the mapped XML namespace name */
}; };
#endif #endif
@ -1268,13 +1268,13 @@ struct _xsltCompilerNodeInfo {
/* The current in-scope namespaces */ /* The current in-scope namespaces */
xsltNsListContainerPtr inScopeNs; xsltNsListContainerPtr inScopeNs;
/* The current excluded result namespaces */ /* The current excluded result namespaces */
xsltPointerListPtr exclResultNs; xsltPointerListPtr exclResultNs;
/* The current extension instruction namespaces */ /* The current extension instruction namespaces */
xsltPointerListPtr extElemNs; xsltPointerListPtr extElemNs;
/* The current info for literal result elements. */ /* The current info for literal result elements. */
xsltStyleItemLRElementInfoPtr litResElemInfo; xsltStyleItemLRElementInfoPtr litResElemInfo;
/* /*
* Set to 1 if in-scope namespaces changed, * Set to 1 if in-scope namespaces changed,
* or excluded result namespaces changed, * or excluded result namespaces changed,
* or extension element namespaces changed. * or extension element namespaces changed.
@ -1289,7 +1289,7 @@ struct _xsltCompilerNodeInfo {
/* whether the content of an extension element was processed */ /* whether the content of an extension element was processed */
int extContentHandled; int extContentHandled;
/* the type of the current child */ /* the type of the current child */
xsltStyleType curChildType; xsltStyleType curChildType;
}; };
/** /**
@ -1297,7 +1297,7 @@ struct _xsltCompilerNodeInfo {
* *
* get pointer to compiler context * get pointer to compiler context
*/ */
#define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt) #define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt)
typedef enum { typedef enum {
XSLT_ERROR_SEVERITY_ERROR = 0, XSLT_ERROR_SEVERITY_ERROR = 0,
@ -1310,7 +1310,7 @@ struct _xsltCompilerCtxt {
void *errorCtxt; /* user specific error context */ void *errorCtxt; /* user specific error context */
/* /*
* used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING */ * used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING */
xsltErrorSeverityType errSeverity; xsltErrorSeverityType errSeverity;
int warnings; /* TODO: number of warnings found at int warnings; /* TODO: number of warnings found at
compilation */ compilation */
int errors; /* TODO: number of errors found at int errors; /* TODO: number of errors found at
@ -1320,7 +1320,7 @@ struct _xsltCompilerCtxt {
int simplified; /* whether this is a simplified stylesheet */ int simplified; /* whether this is a simplified stylesheet */
/* TODO: structured/unstructured error contexts. */ /* TODO: structured/unstructured error contexts. */
int depth; /* Current depth of processing */ int depth; /* Current depth of processing */
xsltCompilerNodeInfoPtr inode; xsltCompilerNodeInfoPtr inode;
xsltCompilerNodeInfoPtr inodeList; xsltCompilerNodeInfoPtr inodeList;
xsltCompilerNodeInfoPtr inodeLast; xsltCompilerNodeInfoPtr inodeLast;
@ -1333,7 +1333,7 @@ struct _xsltCompilerCtxt {
in a parsing episode */ in a parsing episode */
int maxNodeInfos; /* TEMP TODO: just for the interest */ int maxNodeInfos; /* TEMP TODO: just for the interest */
int maxLREs; /* TEMP TODO: just for the interest */ int maxLREs; /* TEMP TODO: just for the interest */
/* /*
* In order to keep the old behaviour, applying strict rules of * In order to keep the old behaviour, applying strict rules of
* the spec can be turned off. This has effect only on special * the spec can be turned off. This has effect only on special
* mechanisms like whitespace-stripping in the stylesheet. * mechanisms like whitespace-stripping in the stylesheet.
@ -1348,7 +1348,7 @@ struct _xsltCompilerCtxt {
xsltNsAliasPtr nsAliases; xsltNsAliasPtr nsAliases;
xsltVarInfoPtr ivars; /* Storage of local in-scope variables/params. */ xsltVarInfoPtr ivars; /* Storage of local in-scope variables/params. */
xsltVarInfoPtr ivar; /* topmost local variable/param. */ xsltVarInfoPtr ivar; /* topmost local variable/param. */
}; };
#else /* XSLT_REFACTORED */ #else /* XSLT_REFACTORED */
/* /*
@ -1471,7 +1471,7 @@ struct _xsltPrincipalStylesheetData {
#endif #endif
}; };
#endif #endif
/* /*
* Note that we added a @compCtxt field to anchor an stylesheet compilation * Note that we added a @compCtxt field to anchor an stylesheet compilation
@ -1516,7 +1516,7 @@ struct _xsltStylesheet {
void *textMatch; /* template based on text() */ void *textMatch; /* template based on text() */
void *piMatch; /* template based on processing-instruction() */ void *piMatch; /* template based on processing-instruction() */
void *commentMatch; /* template based on comment() */ void *commentMatch; /* template based on comment() */
/* /*
* Namespace aliases. * Namespace aliases.
* NOTE: Not used in the refactored code. * NOTE: Not used in the refactored code.
@ -1537,7 +1537,7 @@ struct _xsltStylesheet {
execution of XPath expressions; unfortunately execution of XPath expressions; unfortunately
it restricts the stylesheet to have distinct it restricts the stylesheet to have distinct
prefixes. prefixes.
TODO: We need to get rid of this. TODO: We need to get rid of this.
*/ */
void *nsDefs; /* ATTENTION TODO: This is currently used to store void *nsDefs; /* ATTENTION TODO: This is currently used to store
xsltExtDefPtr (in extensions.c) and xsltExtDefPtr (in extensions.c) and
@ -1558,7 +1558,7 @@ struct _xsltStylesheet {
xmlChar *encoding; /* encoding string */ xmlChar *encoding; /* encoding string */
int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */ int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */
/* /*
* Number formatting. * Number formatting.
*/ */
xsltDecimalFormatPtr decimalFormat; xsltDecimalFormatPtr decimalFormat;
@ -1628,7 +1628,7 @@ struct _xsltStylesheet {
*/ */
xsltCompilerCtxtPtr compCtxt; /* TODO: Change this to (void *). */ xsltCompilerCtxtPtr compCtxt; /* TODO: Change this to (void *). */
xsltPrincipalStylesheetDataPtr principalData; xsltPrincipalStylesheetDataPtr principalData;
#endif #endif
}; };
@ -1828,62 +1828,62 @@ struct _xsltTransformContext {
xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet,
xmlChar *name); xmlChar *name);
*/ */
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltNewStylesheet (void); xsltNewStylesheet (void);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltParseStylesheetFile (const xmlChar* filename); xsltParseStylesheetFile (const xmlChar* filename);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeStylesheet (xsltStylesheetPtr style); xsltFreeStylesheet (xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltIsBlank (xmlChar *str); xsltIsBlank (xmlChar *str);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltFreeStackElemList (xsltStackElemPtr elem); xsltFreeStackElemList (xsltStackElemPtr elem);
XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
xsltDecimalFormatGetByName(xsltStylesheetPtr style, xsltDecimalFormatGetByName(xsltStylesheetPtr style,
xmlChar *name); xmlChar *name);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltParseStylesheetProcess(xsltStylesheetPtr ret, xsltParseStylesheetProcess(xsltStylesheetPtr ret,
xmlDocPtr doc); xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseStylesheetOutput(xsltStylesheetPtr style, xsltParseStylesheetOutput(xsltStylesheetPtr style,
xmlNodePtr cur); xmlNodePtr cur);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltParseStylesheetDoc (xmlDocPtr doc); xsltParseStylesheetDoc (xmlDocPtr doc);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltParseStylesheetImportedDoc(xmlDocPtr doc, xsltParseStylesheetImportedDoc(xmlDocPtr doc,
xsltStylesheetPtr style); xsltStylesheetPtr style);
XSLTPUBFUN xsltStylesheetPtr XSLTCALL XSLTPUBFUN xsltStylesheetPtr XSLTCALL
xsltLoadStylesheetPI (xmlDocPtr doc); xsltLoadStylesheetPI (xmlDocPtr doc);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltNumberFormat (xsltTransformContextPtr ctxt, xsltNumberFormat (xsltTransformContextPtr ctxt,
xsltNumberDataPtr data, xsltNumberDataPtr data,
xmlNodePtr node); xmlNodePtr node);
XSLTPUBFUN xmlXPathError XSLTCALL XSLTPUBFUN xmlXPathError XSLTCALL
xsltFormatNumberConversion(xsltDecimalFormatPtr self, xsltFormatNumberConversion(xsltDecimalFormatPtr self,
xmlChar *format, xmlChar *format,
double number, double number,
xmlChar **result); xmlChar **result);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseTemplateContent(xsltStylesheetPtr style, xsltParseTemplateContent(xsltStylesheetPtr style,
xmlNodePtr templ); xmlNodePtr templ);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltAllocateExtra (xsltStylesheetPtr style); xsltAllocateExtra (xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt); xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt);
/* /*
* Extra functions for Result Value Trees * Extra functions for Result Value Trees
*/ */
XSLTPUBFUN xmlDocPtr XSLTCALL XSLTPUBFUN xmlDocPtr XSLTCALL
xsltCreateRVT (xsltTransformContextPtr ctxt); xsltCreateRVT (xsltTransformContextPtr ctxt);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, xsltRegisterTmpRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); xmlDocPtr RVT);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltRegisterLocalRVT (xsltTransformContextPtr ctxt, xsltRegisterLocalRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); xmlDocPtr RVT);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, xsltRegisterPersistRVT (xsltTransformContextPtr ctxt,
xmlDocPtr RVT); xmlDocPtr RVT);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
@ -1932,7 +1932,7 @@ XSLTPUBFUN void XSLTCALL
* * * *
************************************************************************/ ************************************************************************/
#ifdef XSLT_REFACTORED #ifdef XSLT_REFACTORED
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltParseSequenceConstructor( xsltParseSequenceConstructor(
xsltCompilerCtxtPtr cctxt, xsltCompilerCtxtPtr cctxt,

View file

@ -31,7 +31,7 @@ extern "C" {
* *
* Macro to flag unimplemented blocks. * Macro to flag unimplemented blocks.
*/ */
#define XSLT_TODO \ #define XSLT_TODO \
xsltGenericError(xsltGenericErrorContext, \ xsltGenericError(xsltGenericErrorContext, \
"Unimplemented block at %s:%d\n", \ "Unimplemented block at %s:%d\n", \
__FILE__, __LINE__); __FILE__, __LINE__);
@ -41,7 +41,7 @@ extern "C" {
* *
* Macro to flag that a problem was detected internally. * Macro to flag that a problem was detected internally.
*/ */
#define XSLT_STRANGE \ #define XSLT_STRANGE \
xsltGenericError(xsltGenericErrorContext, \ xsltGenericError(xsltGenericErrorContext, \
"Internal error at %s:%d\n", \ "Internal error at %s:%d\n", \
__FILE__, __LINE__); __FILE__, __LINE__);
@ -77,7 +77,7 @@ extern "C" {
((n)->type == XML_DOCUMENT_NODE) || \ ((n)->type == XML_DOCUMENT_NODE) || \
((n)->type == XML_HTML_DOCUMENT_NODE) || \ ((n)->type == XML_HTML_DOCUMENT_NODE) || \
((n)->type == XML_COMMENT_NODE) || \ ((n)->type == XML_COMMENT_NODE) || \
((n)->type == XML_PI_NODE))) ((n)->type == XML_PI_NODE)))
/* /*
* Our own version of namespaced atributes lookup. * Our own version of namespaced atributes lookup.
@ -100,24 +100,24 @@ XSLTPUBFUN int XSLTCALL
*/ */
typedef enum { typedef enum {
XSLT_TRACE_ALL = -1, XSLT_TRACE_ALL = -1,
XSLT_TRACE_NONE = 0, XSLT_TRACE_NONE = 0,
XSLT_TRACE_COPY_TEXT = 1<<0, XSLT_TRACE_COPY_TEXT = 1<<0,
XSLT_TRACE_PROCESS_NODE = 1<<1, XSLT_TRACE_PROCESS_NODE = 1<<1,
XSLT_TRACE_APPLY_TEMPLATE = 1<<2, XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
XSLT_TRACE_COPY = 1<<3, XSLT_TRACE_COPY = 1<<3,
XSLT_TRACE_COMMENT = 1<<4, XSLT_TRACE_COMMENT = 1<<4,
XSLT_TRACE_PI = 1<<5, XSLT_TRACE_PI = 1<<5,
XSLT_TRACE_COPY_OF = 1<<6, XSLT_TRACE_COPY_OF = 1<<6,
XSLT_TRACE_VALUE_OF = 1<<7, XSLT_TRACE_VALUE_OF = 1<<7,
XSLT_TRACE_CALL_TEMPLATE = 1<<8, XSLT_TRACE_CALL_TEMPLATE = 1<<8,
XSLT_TRACE_APPLY_TEMPLATES = 1<<9, XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
XSLT_TRACE_CHOOSE = 1<<10, XSLT_TRACE_CHOOSE = 1<<10,
XSLT_TRACE_IF = 1<<11, XSLT_TRACE_IF = 1<<11,
XSLT_TRACE_FOR_EACH = 1<<12, XSLT_TRACE_FOR_EACH = 1<<12,
XSLT_TRACE_STRIP_SPACES = 1<<13, XSLT_TRACE_STRIP_SPACES = 1<<13,
XSLT_TRACE_TEMPLATES = 1<<14, XSLT_TRACE_TEMPLATES = 1<<14,
XSLT_TRACE_KEYS = 1<<15, XSLT_TRACE_KEYS = 1<<15,
XSLT_TRACE_VARIABLES = 1<<16 XSLT_TRACE_VARIABLES = 1<<16
} xsltDebugTraceCodes; } xsltDebugTraceCodes;
/** /**
@ -142,26 +142,26 @@ XSLTPUBVAR void *xsltGenericErrorContext;
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug; XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug;
XSLTPUBVAR void *xsltGenericDebugContext; XSLTPUBVAR void *xsltGenericDebugContext;
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltPrintErrorContext (xsltTransformContextPtr ctxt, xsltPrintErrorContext (xsltTransformContextPtr ctxt,
xsltStylesheetPtr style, xsltStylesheetPtr style,
xmlNodePtr node); xmlNodePtr node);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltMessage (xsltTransformContextPtr ctxt, xsltMessage (xsltTransformContextPtr ctxt,
xmlNodePtr node, xmlNodePtr node,
xmlNodePtr inst); xmlNodePtr inst);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSetGenericErrorFunc (void *ctx, xsltSetGenericErrorFunc (void *ctx,
xmlGenericErrorFunc handler); xmlGenericErrorFunc handler);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSetGenericDebugFunc (void *ctx, xsltSetGenericDebugFunc (void *ctx,
xmlGenericErrorFunc handler); xmlGenericErrorFunc handler);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
void *ctx, void *ctx,
xmlGenericErrorFunc handler); xmlGenericErrorFunc handler);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltTransformError (xsltTransformContextPtr ctxt, xsltTransformError (xsltTransformContextPtr ctxt,
xsltStylesheetPtr style, xsltStylesheetPtr style,
xmlNodePtr node, xmlNodePtr node,
const char *msg, const char *msg,
@ -174,23 +174,23 @@ XSLTPUBFUN int XSLTCALL
* Sorting. * Sorting.
*/ */
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltDocumentSortFunction (xmlNodeSetPtr list); xsltDocumentSortFunction (xmlNodeSetPtr list);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSetSortFunc (xsltSortFunc handler); xsltSetSortFunc (xsltSortFunc handler);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
xsltSortFunc handler); xsltSortFunc handler);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltDefaultSortFunction (xsltTransformContextPtr ctxt, xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
xmlNodePtr *sorts, xmlNodePtr *sorts,
int nbsorts); int nbsorts);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltDoSortFunction (xsltTransformContextPtr ctxt, xsltDoSortFunction (xsltTransformContextPtr ctxt,
xmlNodePtr * sorts, xmlNodePtr * sorts,
int nbsorts); int nbsorts);
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
xsltComputeSortResult (xsltTransformContextPtr ctxt, xsltComputeSortResult (xsltTransformContextPtr ctxt,
xmlNodePtr sort); xmlNodePtr sort);
/* /*
@ -201,8 +201,8 @@ XSLTPUBFUN const xmlChar * XSLTCALL
xsltSplitQName (xmlDictPtr dict, xsltSplitQName (xmlDictPtr dict,
const xmlChar *name, const xmlChar *name,
const xmlChar **prefix); const xmlChar **prefix);
XSLTPUBFUN const xmlChar * XSLTCALL XSLTPUBFUN const xmlChar * XSLTCALL
xsltGetQNameURI (xmlNodePtr node, xsltGetQNameURI (xmlNodePtr node,
xmlChar **name); xmlChar **name);
XSLTPUBFUN const xmlChar * XSLTCALL XSLTPUBFUN const xmlChar * XSLTCALL
@ -213,27 +213,27 @@ XSLTPUBFUN const xmlChar * XSLTCALL
/* /*
* Output, reuse libxml I/O buffers. * Output, reuse libxml I/O buffers.
*/ */
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSaveResultTo (xmlOutputBufferPtr buf, xsltSaveResultTo (xmlOutputBufferPtr buf,
xmlDocPtr result, xmlDocPtr result,
xsltStylesheetPtr style); xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSaveResultToFilename (const char *URI, xsltSaveResultToFilename (const char *URI,
xmlDocPtr result, xmlDocPtr result,
xsltStylesheetPtr style, xsltStylesheetPtr style,
int compression); int compression);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSaveResultToFile (FILE *file, xsltSaveResultToFile (FILE *file,
xmlDocPtr result, xmlDocPtr result,
xsltStylesheetPtr style); xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSaveResultToFd (int fd, xsltSaveResultToFd (int fd,
xmlDocPtr result, xmlDocPtr result,
xsltStylesheetPtr style); xsltStylesheetPtr style);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSaveResultToString (xmlChar **doc_txt_ptr, xsltSaveResultToString (xmlChar **doc_txt_ptr,
int * doc_txt_len, int * doc_txt_len,
xmlDocPtr result, xmlDocPtr result,
xsltStylesheetPtr style); xsltStylesheetPtr style);
/* /*
@ -246,16 +246,16 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
/* /*
* Profiling. * Profiling.
*/ */
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltSaveProfiling (xsltTransformContextPtr ctxt, xsltSaveProfiling (xsltTransformContextPtr ctxt,
FILE *output); FILE *output);
XSLTPUBFUN xmlDocPtr XSLTCALL XSLTPUBFUN xmlDocPtr XSLTCALL
xsltGetProfileInformation (xsltTransformContextPtr ctxt); xsltGetProfileInformation (xsltTransformContextPtr ctxt);
XSLTPUBFUN long XSLTCALL XSLTPUBFUN long XSLTCALL
xsltTimestamp (void); xsltTimestamp (void);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xsltCalibrateAdjust (long delta); xsltCalibrateAdjust (long delta);
/** /**
* XSLT_TIMESTAMP_TICS_PER_SEC: * XSLT_TIMESTAMP_TICS_PER_SEC:
@ -292,12 +292,12 @@ XSLTPUBFUN void XSLTCALL
xsltSetDebuggerStatus (int value); xsltSetDebuggerStatus (int value);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltGetDebuggerStatus (void); xsltGetDebuggerStatus (void);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xsltSetDebuggerCallbacks (int no, void *block); xsltSetDebuggerCallbacks (int no, void *block);
XSLTPUBFUN int XSLTCALL XSLTPUBFUN int XSLTCALL
xslAddCall (xsltTemplatePtr templ, xslAddCall (xsltTemplatePtr templ,
xmlNodePtr source); xmlNodePtr source);
XSLTPUBFUN void XSLTCALL XSLTPUBFUN void XSLTCALL
xslDropCall (void); xslDropCall (void);
#ifdef __cplusplus #ifdef __cplusplus