1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-29 15:41:13 +03:00

copied over the apibuild.py from libxml2, adapted a bit and regenerated

* doc/Makefile.am doc/apibuild.py doc/libxslt-api.xml:
  copied over the apibuild.py from libxml2, adapted a bit and
  regenerated the API description in XML. Todo: libexslt-api.xml
* libxslt/attributes.c libxslt/documents.c libxslt/extensions.c
  libxslt/imports.c libxslt/numbers.c libxslt/numbersInternals.h
  libxslt/pattern.c libxslt/preproc.c libxslt/security.c
  libxslt/templates.c libxslt/transform.c libxslt/transform.h
  libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h
  libxslt/xsltutils.c libxslt/xsltutils.h: cleanup based on the
  report from the scripts.
* libxslt.spec.in: make sure libxslt-api.xml ends up in the devel
  package
Daniel
This commit is contained in:
Daniel Veillard
2002-12-11 17:53:37 +00:00
parent 8f56a0b269
commit 162c34f414
23 changed files with 2924 additions and 1204 deletions

View File

@ -1,3 +1,18 @@
Wed Dec 11 18:45:09 CET 2002 Daniel Veillard <daniel@veillard.com>
* doc/Makefile.am doc/apibuild.py doc/libxslt-api.xml:
copied over the apibuild.py from libxml2, adapted a bit and
regenerated the API description in XML. Todo: libexslt-api.xml
* libxslt/attributes.c libxslt/documents.c libxslt/extensions.c
libxslt/imports.c libxslt/numbers.c libxslt/numbersInternals.h
libxslt/pattern.c libxslt/preproc.c libxslt/security.c
libxslt/templates.c libxslt/transform.c libxslt/transform.h
libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h
libxslt/xsltutils.c libxslt/xsltutils.h: cleanup based on the
report from the scripts.
* libxslt.spec.in: make sure libxslt-api.xml ends up in the devel
package
Thu Dec 5 18:05:44 CET 2002 Daniel Veillard <daniel@veillard.com> Thu Dec 5 18:05:44 CET 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/transform.c: xsl:element generated superfluous xmlns * libxslt/transform.c: xsl:element generated superfluous xmlns

View File

@ -2,7 +2,8 @@
EXTRA_DIST = \ EXTRA_DIST = \
libxslt-api.xml \ libxslt-api.xml \
libxslt-decl.txt \ libxslt-decl.txt \
xsltproc.xml xsltproc.xml \
apibuild.py
# The name of the module. # The name of the module.
DOC_MODULE=libxslt-$(VERSION) DOC_MODULE=libxslt-$(VERSION)
@ -56,8 +57,8 @@ xml: sgml
-@(for s in sgml/*.sgml ; do name=`basename $$s .sgml` ; \ -@(for s in sgml/*.sgml ; do name=`basename $$s .sgml` ; \
xmllint --sgml $$s > xml/"$$name".xml ; done) xmllint --sgml $$s > xml/"$$name".xml ; done)
libxslt-api.xml libxslt-refs.xml: xml parsedecl.py libxslt-decl.txt libxslt-decl-list.txt libxslt-api.xml: apibuild.py ../libxslt/*.h ../libxslt/*.c
-(./parsedecl.py) -(./apibuild.py)
api: libxslt-api.xml libxslt-refs.xml api: libxslt-api.xml libxslt-refs.xml

1463
doc/apibuild.py Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -102,6 +102,7 @@ rm -fr %{buildroot}
%defattr(-, root, root) %defattr(-, root, root)
%doc AUTHORS ChangeLog NEWS README Copyright TODO FEATURES %doc AUTHORS ChangeLog NEWS README Copyright TODO FEATURES
%doc doc/libxslt-api.xml
%doc %{_mandir}/man4/libxslt.4* %doc %{_mandir}/man4/libxslt.4*
%doc %{_mandir}/man4/libexslt.4* %doc %{_mandir}/man4/libexslt.4*
%{_libdir}/lib*.so %{_libdir}/lib*.so

View File

@ -266,10 +266,9 @@ xsltMergeAttrElemList(xsltAttrElemPtr list, xsltAttrElemPtr old) {
/** /**
* xsltParseStylesheetAttributeSet: * xsltParseStylesheetAttributeSet:
* @style: the XSLT stylesheet * @style: the XSLT stylesheet
* @template: the "preserve-space" element * @cur: the "attribute-set" element
* *
* parse an XSLT stylesheet preserve-space element and record * parse an XSLT stylesheet attribute-set element
* elements needing preserving
*/ */
void void

View File

@ -45,6 +45,8 @@
* @doc: a parsed XML document * @doc: a parsed XML document
* *
* Register a new document, apply key computations * Register a new document, apply key computations
*
* Returns a handler to the document
*/ */
xsltDocumentPtr xsltDocumentPtr
xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) { xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
@ -72,6 +74,8 @@ xsltNewDocument(xsltTransformContextPtr ctxt, xmlDocPtr doc) {
* @doc: a parsed XML document * @doc: a parsed XML document
* *
* Register a new document, apply key computations * Register a new document, apply key computations
*
* Returns a handler to the document
*/ */
xsltDocumentPtr xsltDocumentPtr
xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) { xsltNewStyleDocument(xsltStylesheetPtr style, xmlDocPtr doc) {
@ -267,7 +271,7 @@ xsltLoadStyleDocument(xsltStylesheetPtr style, const xmlChar *URI) {
/** /**
* xsltFindDocument: * xsltFindDocument:
* @ctxt: an XSLT transformation context * @ctxt: an XSLT transformation context
* @@doc: a parsed XML document * @doc: a parsed XML document
* *
* Try to find a document within the XSLT transformation context * Try to find a document within the XSLT transformation context
* *

View File

@ -875,7 +875,7 @@ xsltUnregisterAllExtModules(void)
* xsltXPathGetTransformContext: * xsltXPathGetTransformContext:
* @ctxt: an XPath transformation context * @ctxt: an XPath transformation context
* *
* Returns the XSLT transformation context from the XPath transformation * Provides the XSLT transformation context from the XPath transformation
* context. This is useful when an XPath function in the extension module * context. This is useful when an XPath function in the extension module
* is called by the XPath interpreter and that the XSLT context is needed * is called by the XPath interpreter and that the XSLT context is needed
* for example to retrieve the associated data pertaining to this XSLT * for example to retrieve the associated data pertaining to this XSLT

View File

@ -56,11 +56,11 @@
/** /**
* xsltParseStylesheetImport: * xsltParseStylesheetImport:
* @style: the XSLT stylesheet * @style: the XSLT stylesheet
* @template: the "strip-space" element * @cur: the import element
* *
* parse an XSLT stylesheet strip-space element and record * parse an XSLT stylesheet import element
* elements needing stripping. Returns zero on success and something else *
* on failure. * Returns 0 in case of success -1 in case of failure.
*/ */
int int
@ -139,11 +139,11 @@ error:
/** /**
* xsltParseStylesheetInclude: * xsltParseStylesheetInclude:
* @style: the XSLT stylesheet * @style: the XSLT stylesheet
* @template: the "strip-space" element * @cur: the include node
* *
* parse an XSLT stylesheet strip-space element and record * parse an XSLT stylesheet include element
* elements needing stripping. Returns zero on success, something else *
* on failure. * Returns 0 in case of success -1 in case of failure
*/ */
int int
@ -230,7 +230,7 @@ xsltNextImport(xsltStylesheetPtr cur) {
* xsltNeedElemSpaceHandling: * xsltNeedElemSpaceHandling:
* @ctxt: an XSLT transformation context * @ctxt: an XSLT transformation context
* *
* Returns whether that stylesheet requires white-space stripping * Checks whether that stylesheet requires white-space stripping
* *
* Returns 1 if space should be stripped, 0 if not * Returns 1 if space should be stripped, 0 if not
*/ */

View File

@ -826,6 +826,8 @@ xsltFormatNumberPreSuffix(xsltDecimalFormatPtr self, xmlChar **format, xsltForma
* ? multiply by 1000 and show as per mille * ? multiply by 1000 and show as per mille
* X any other characters can be used in the prefix or suffix * X any other characters can be used in the prefix or suffix
* ' used to quote special characters in a prefix or suffix. * ' used to quote special characters in a prefix or suffix.
*
* Returns a possible XPath error
*/ */
xmlXPathError xmlXPathError
xsltFormatNumberConversion(xsltDecimalFormatPtr self, xsltFormatNumberConversion(xsltDecimalFormatPtr self,

View File

@ -21,7 +21,10 @@ extern "C" {
* *
* This data structure is just a wrapper to pass xsl:number data in. * This data structure is just a wrapper to pass xsl:number data in.
*/ */
typedef struct _xsltNumberData { typedef struct _xsltNumberData xsltNumberData;
typedef xsltNumberData *xsltNumberDataPtr;
struct _xsltNumberData {
xmlChar *level; xmlChar *level;
xmlChar *count; xmlChar *count;
xmlChar *from; xmlChar *from;
@ -33,14 +36,17 @@ typedef struct _xsltNumberData {
int groupingCharacterLen; int groupingCharacterLen;
xmlDocPtr doc; xmlDocPtr doc;
xmlNodePtr node; xmlNodePtr node;
} xsltNumberData, *xsltNumberDataPtr; };
/** /**
* xsltFormatNumberInfo,: * xsltFormatNumberInfo,:
* *
* This data structure lists the various parameters needed to format numbers. * This data structure lists the various parameters needed to format numbers.
*/ */
typedef struct _xsltFormatNumberInfo { typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo;
typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr;
struct _xsltFormatNumberInfo {
int integer_hash; /* Number of '#' in integer part */ int integer_hash; /* Number of '#' in integer part */
int integer_digits; /* Number of '0' in integer part */ int integer_digits; /* Number of '0' in integer part */
int frac_digits; /* Number of '0' in fractional part */ int frac_digits; /* Number of '0' in fractional part */
@ -50,7 +56,7 @@ typedef struct _xsltFormatNumberInfo {
char add_decimal; /* Flag for whether decimal point appears in pattern */ char add_decimal; /* Flag for whether decimal point appears in pattern */
char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */ char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */
char is_negative_pattern;/* Flag for processing -ve prefix/suffix */ char is_negative_pattern;/* Flag for processing -ve prefix/suffix */
} xsltFormatNumberInfo, *xsltFormatNumberInfoPtr; };
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -2221,36 +2221,3 @@ xsltFreeTemplateHashes(xsltStylesheetPtr style) {
xsltFreeCompMatchList(style->commentMatch); xsltFreeCompMatchList(style->commentMatch);
} }
#if 0
/**
* xsltMatchPattern
* @node: a node in the source tree
* @pattern: an XSLT pattern
* @ctxtdoc: context document (for namespaces)
* @ctxtnode: context node (for namespaces)
*
* Determine if a node matches a pattern.
*/
int
xsltMatchPattern(xsltTransformContextPtr context,
xmlNodePtr node,
const xmlChar *pattern,
xmlDocPtr ctxtdoc,
xmlNodePtr ctxtnode)
{
int match = 0;
xsltCompMatchPtr first, comp;
if ((context != NULL) && (pattern != NULL)) {
first = xsltCompilePattern(pattern, ctxtdoc, ctxtnode);
for (comp = first; comp != NULL; comp = comp->next) {
match = xsltTestCompMatch(context, comp, node, NULL, NULL);
if (match)
break; /* for */
}
if (first)
xsltFreeCompMatchList(first);
}
return match;
}
#endif

View File

@ -193,8 +193,11 @@ xsltFreeStylePreComp(xsltStylePreCompPtr comp) {
* xsltDocumentComp: * xsltDocumentComp:
* @style: the XSLT stylesheet * @style: the XSLT stylesheet
* @inst: the instruction in the stylesheet * @inst: the instruction in the stylesheet
* @function: unused
* *
* Pre process an XSLT-1.1 document element * Pre process an XSLT-1.1 document element
*
* Returns a precompiled data structure for the element
*/ */
xsltElemPreCompPtr xsltElemPreCompPtr
xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst, xsltDocumentComp(xsltStylesheetPtr style, xmlNodePtr inst,

View File

@ -163,7 +163,7 @@ xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec) {
} }
/** /**
* xsltSetDefaultSecurityPrefs: * xsltGetDefaultSecurityPrefs:
* *
* Get the default security preference application-wide * Get the default security preference application-wide
* *

View File

@ -224,7 +224,6 @@ xsltEvalTemplateString(xsltTransformContextPtr ctxt, xmlNodePtr node,
* @ctxt: the XSLT transformation context * @ctxt: the XSLT transformation context
* @str: the attribute template node value * @str: the attribute template node value
* @node: the node hosting the attribute * @node: the node hosting the attribute
* @nsList: the list of in-scope namespaces to use
* *
* Process the given string, allowing to pass a namespace mapping * Process the given string, allowing to pass a namespace mapping
* context and return the new string value. * context and return the new string value.

View File

@ -77,55 +77,187 @@ int xsltMaxDepth = 5000;
#define IS_BLANK_NODE(n) \ #define IS_BLANK_NODE(n) \
(((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content))) (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
/* /**
* Generic function for accessing stacks in the transform Context * templPush:
* @ctxt: the transformation context
* @value: the template to push on the stack
*
* Push a template on the stack
*
* Returns the new index in the stack or 0 in case of error
*/ */
static int
#define PUSH_AND_POP(scope, type, name) \ templPush(xsltTransformContextPtr ctxt, xsltTemplatePtr value)
scope int name##Push(xsltTransformContextPtr ctxt, type value) { \ {
if (ctxt->name##Max == 0) { \ if (ctxt->templMax == 0) {
ctxt->name##Max = 4; \ ctxt->templMax = 4;
ctxt->name##Tab = (type *) xmlMalloc(ctxt->name##Max * \ ctxt->templTab =
sizeof(ctxt->name##Tab[0])); \ (xsltTemplatePtr *) xmlMalloc(ctxt->templMax *
if (ctxt->name##Tab == NULL) { \ sizeof(ctxt->templTab[0]));
xmlGenericError(xmlGenericErrorContext, \ if (ctxt->templTab == NULL) {
"malloc failed !\n"); \ xmlGenericError(xmlGenericErrorContext, "malloc failed !\n");
return(0); \ return (0);
} \ }
} \ }
if (ctxt->name##Nr >= ctxt->name##Max) { \ if (ctxt->templNr >= ctxt->templMax) {
ctxt->name##Max *= 2; \ ctxt->templMax *= 2;
ctxt->name##Tab = (type *) xmlRealloc(ctxt->name##Tab, \ ctxt->templTab =
ctxt->name##Max * sizeof(ctxt->name##Tab[0])); \ (xsltTemplatePtr *) xmlRealloc(ctxt->templTab,
if (ctxt->name##Tab == NULL) { \ ctxt->templMax *
xmlGenericError(xmlGenericErrorContext, \ sizeof(ctxt->templTab[0]));
"realloc failed !\n"); \ if (ctxt->templTab == NULL) {
return(0); \ xmlGenericError(xmlGenericErrorContext, "realloc failed !\n");
} \ return (0);
} \ }
ctxt->name##Tab[ctxt->name##Nr] = value; \ }
ctxt->name = value; \ ctxt->templTab[ctxt->templNr] = value;
return(ctxt->name##Nr++); \ ctxt->templ = value;
} \ return (ctxt->templNr++);
scope type name##Pop(xsltTransformContextPtr ctxt) { \ }
type ret; \ /**
if (ctxt->name##Nr <= 0) return(0); \ * varsPop:
ctxt->name##Nr--; \ * @ctxt: the transformation context
if (ctxt->name##Nr > 0) \ *
ctxt->name = ctxt->name##Tab[ctxt->name##Nr - 1]; \ * Pop a template value from the stack
else \ *
ctxt->name = (type) 0; \ * Returns the stored template value
ret = ctxt->name##Tab[ctxt->name##Nr]; \
ctxt->name##Tab[ctxt->name##Nr] = 0; \
return(ret); \
} \
/*
* Those macros actually generate the functions
*/ */
PUSH_AND_POP(static, xsltTemplatePtr, templ) static xsltTemplatePtr
PUSH_AND_POP(static, xsltStackElemPtr, vars) templPop(xsltTransformContextPtr ctxt)
PUSH_AND_POP(static, long, prof) {
xsltTemplatePtr ret;
if (ctxt->templNr <= 0)
return (0);
ctxt->templNr--;
if (ctxt->templNr > 0)
ctxt->templ = ctxt->templTab[ctxt->templNr - 1];
else
ctxt->templ = (xsltTemplatePtr) 0;
ret = ctxt->templTab[ctxt->templNr];
ctxt->templTab[ctxt->templNr] = 0;
return (ret);
}
/**
* varsPush:
* @ctxt: the transformation context
* @value: the variable to push on the stack
*
* Push a variable on the stack
*
* Returns the new index in the stack or 0 in case of error
*/
static int
varsPush(xsltTransformContextPtr ctxt, xsltStackElemPtr value)
{
if (ctxt->varsMax == 0) {
ctxt->varsMax = 4;
ctxt->varsTab =
(xsltStackElemPtr *) xmlMalloc(ctxt->varsMax *
sizeof(ctxt->varsTab[0]));
if (ctxt->varsTab == NULL) {
xmlGenericError(xmlGenericErrorContext, "malloc failed !\n");
return (0);
}
}
if (ctxt->varsNr >= ctxt->varsMax) {
ctxt->varsMax *= 2;
ctxt->varsTab =
(xsltStackElemPtr *) xmlRealloc(ctxt->varsTab,
ctxt->varsMax *
sizeof(ctxt->varsTab[0]));
if (ctxt->varsTab == NULL) {
xmlGenericError(xmlGenericErrorContext, "realloc failed !\n");
return (0);
}
}
ctxt->varsTab[ctxt->varsNr] = value;
ctxt->vars = value;
return (ctxt->varsNr++);
}
/**
* varsPop:
* @ctxt: the transformation context
*
* Pop a variable value from the stack
*
* Returns the stored variable value
*/
static xsltStackElemPtr
varsPop(xsltTransformContextPtr ctxt)
{
xsltStackElemPtr ret;
if (ctxt->varsNr <= 0)
return (0);
ctxt->varsNr--;
if (ctxt->varsNr > 0)
ctxt->vars = ctxt->varsTab[ctxt->varsNr - 1];
else
ctxt->vars = (xsltStackElemPtr) 0;
ret = ctxt->varsTab[ctxt->varsNr];
ctxt->varsTab[ctxt->varsNr] = 0;
return (ret);
}
/**
* profPush:
* @ctxt: the transformation context
* @value: the profiling value to push on the stack
*
* Push a profiling value on the stack
*
* Returns the new index in the stack or 0 in case of error
*/
static int
profPush(xsltTransformContextPtr ctxt, long value)
{
if (ctxt->profMax == 0) {
ctxt->profMax = 4;
ctxt->profTab =
(long *) xmlMalloc(ctxt->profMax * sizeof(ctxt->profTab[0]));
if (ctxt->profTab == NULL) {
xmlGenericError(xmlGenericErrorContext, "malloc failed !\n");
return (0);
}
}
if (ctxt->profNr >= ctxt->profMax) {
ctxt->profMax *= 2;
ctxt->profTab =
(long *) xmlRealloc(ctxt->profTab,
ctxt->profMax * sizeof(ctxt->profTab[0]));
if (ctxt->profTab == NULL) {
xmlGenericError(xmlGenericErrorContext, "realloc failed !\n");
return (0);
}
}
ctxt->profTab[ctxt->profNr] = value;
ctxt->prof = value;
return (ctxt->profNr++);
}
/**
* profPop:
* @ctxt: the transformation context
*
* Pop a profiling value from the stack
*
* Returns the stored profiling value
*/
static long
profPop(xsltTransformContextPtr ctxt)
{
long ret;
if (ctxt->profNr <= 0)
return (0);
ctxt->profNr--;
if (ctxt->profNr > 0)
ctxt->prof = ctxt->profTab[ctxt->profNr - 1];
else
ctxt->prof = (long) 0;
ret = ctxt->profTab[ctxt->profNr];
ctxt->profTab[ctxt->profNr] = 0;
return (ret);
}
/************************************************************************ /************************************************************************
* * * *
@ -149,7 +281,7 @@ xsltSetXIncludeDefault(int xinclude) {
/** /**
* xsltGetXIncludeDefault: * xsltGetXIncludeDefault:
* *
* return the default state for XInclude processing * Provides the default state for XInclude processing
* *
* Returns 0 if there is no processing 1 otherwise * Returns 0 if there is no processing 1 otherwise
*/ */
@ -1021,6 +1153,7 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node) {
* xsltProcessOneNode: * xsltProcessOneNode:
* @ctxt: a XSLT process context * @ctxt: a XSLT process context
* @node: the node in the source tree. * @node: the node in the source tree.
* @params: extra parameters passed to the template if any
* *
* Process the source node. * Process the source node.
*/ */
@ -3350,7 +3483,7 @@ xsltGetHTMLIDs(const xmlChar *version, const xmlChar **publicID,
/** /**
* xsltApplyStripSpaces: * xsltApplyStripSpaces:
* @ctxt: a XSLT process context * @ctxt: a XSLT process context
* @root: the root of the XML tree * @node: the root of the XML tree
* *
* Strip the unwanted ignorable spaces from the input tree * Strip the unwanted ignorable spaces from the input tree
*/ */

View File

@ -43,11 +43,6 @@ xmlDocPtr xsltApplyStylesheetUser (xsltStylesheetPtr style,
*/ */
void xsltApplyStripSpaces (xsltTransformContextPtr ctxt, void xsltApplyStripSpaces (xsltTransformContextPtr ctxt,
xmlNodePtr node); xmlNodePtr node);
xsltTransformFunction
xsltExtElementLookup (xsltTransformContextPtr ctxt,
const xmlChar *name,
const xmlChar *URI);
xmlDocPtr xsltApplyStylesheet (xsltStylesheetPtr style, xmlDocPtr xsltApplyStylesheet (xsltStylesheetPtr style,
xmlDocPtr doc, xmlDocPtr doc,
const char **params); const char **params);

View File

@ -949,10 +949,9 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
/** /**
* xsltEvalOneUserParam: * xsltEvalOneUserParam:
*
* @ctxt: the XSLT transformation context * @ctxt: the XSLT transformation context
* @name: a null terminated string giving the name of the parameter * @name: a null terminated string giving the name of the parameter
* @value a null terminated string giving the XPath expression to be evaluated * @value: a null terminated string giving the XPath expression to be evaluated
* *
* This is normally called from xsltEvalUserParams to process a single * This is normally called from xsltEvalUserParams to process a single
* parameter from a list of parameters. The @value is evaluated as an * parameter from a list of parameters. The @value is evaluated as an
@ -976,10 +975,9 @@ xsltEvalOneUserParam(xsltTransformContextPtr ctxt,
/** /**
* xsltQuoteOneUserParam: * xsltQuoteOneUserParam:
*
* @ctxt: the XSLT transformation context * @ctxt: the XSLT transformation context
* @name: a null terminated string giving the name of the parameter * @name: a null terminated string giving the name of the parameter
* @value a null terminated string giving the parameter value * @value: a null terminated string giving the parameter value
* *
* This is normally called from xsltQuoteUserParams to process a single * This is normally called from xsltQuoteUserParams to process a single
* parameter from a list of parameters. The @value is stored in the * parameter from a list of parameters. The @value is stored in the
@ -1167,7 +1165,7 @@ xsltVariableLookup(xsltTransformContextPtr ctxt, const xmlChar *name,
* parse an XSLT transformation param declaration, compute * parse an XSLT transformation param declaration, compute
* its value but doesn't record it. * its value but doesn't record it.
* *
* It returns the new xsltStackElemPtr or NULL * Returns the new xsltStackElemPtr or NULL
*/ */
xsltStackElemPtr xsltStackElemPtr

View File

@ -68,53 +68,67 @@ double xmlXPathStringEvalNumber(const xmlChar *str);
#define IS_BLANK_NODE(n) \ #define IS_BLANK_NODE(n) \
(((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content))) (((n)->type == XML_TEXT_NODE) && (xsltIsBlank((n)->content)))
/* /**
* Generic function for accessing stacks in the stylesheet * exclPrefixPush:
* @style: the transformation stylesheet
* @value: the excluded prefix to push on the stack
*
* Push an excluded prefix on the stack
*
* Returns the new index in the stack or 0 in case of error
*/ */
static int
#define PUSH_AND_POP(scope, type, name) \ exclPrefixPush(xsltStylesheetPtr style, xmlChar * value)
scope int name##Push(xsltStylesheetPtr style, type value) { \ {
if (style->name##Max == 0) { \ if (style->exclPrefixMax == 0) {
style->name##Max = 4; \ style->exclPrefixMax = 4;
style->name##Tab = (type *) xmlMalloc(style->name##Max * \ style->exclPrefixTab =
sizeof(style->name##Tab[0])); \ (xmlChar * *)xmlMalloc(style->exclPrefixMax *
if (style->name##Tab == NULL) { \ sizeof(style->exclPrefixTab[0]));
xmlGenericError(xmlGenericErrorContext, \ if (style->exclPrefixTab == NULL) {
"malloc failed !\n"); \ xmlGenericError(xmlGenericErrorContext, "malloc failed !\n");
return(0); \ return (0);
} \ }
} \ }
if (style->name##Nr >= style->name##Max) { \ if (style->exclPrefixNr >= style->exclPrefixMax) {
style->name##Max *= 2; \ style->exclPrefixMax *= 2;
style->name##Tab = (type *) xmlRealloc(style->name##Tab, \ style->exclPrefixTab =
style->name##Max * sizeof(style->name##Tab[0])); \ (xmlChar * *)xmlRealloc(style->exclPrefixTab,
if (style->name##Tab == NULL) { \ style->exclPrefixMax *
xmlGenericError(xmlGenericErrorContext, \ sizeof(style->exclPrefixTab[0]));
"realloc failed !\n"); \ if (style->exclPrefixTab == NULL) {
return(0); \ xmlGenericError(xmlGenericErrorContext, "realloc failed !\n");
} \ return (0);
} \ }
style->name##Tab[style->name##Nr] = value; \ }
style->name = value; \ style->exclPrefixTab[style->exclPrefixNr] = value;
return(style->name##Nr++); \ style->exclPrefix = value;
} \ return (style->exclPrefixNr++);
scope type name##Pop(xsltStylesheetPtr style) { \ }
type ret; \ /**
if (style->name##Nr <= 0) return(0); \ * exclPrefixPop:
style->name##Nr--; \ * @style: the transformation stylesheet
if (style->name##Nr > 0) \ *
style->name = style->name##Tab[style->name##Nr - 1]; \ * Pop an excluded prefix value from the stack
else \ *
style->name = NULL; \ * Returns the stored excluded prefix value
ret = style->name##Tab[style->name##Nr]; \
style->name##Tab[style->name##Nr] = 0; \
return(ret); \
} \
/*
* Those macros actually generate the functions
*/ */
PUSH_AND_POP(static, xmlChar *, exclPrefix) static xmlChar *
exclPrefixPop(xsltStylesheetPtr style)
{
xmlChar *ret;
if (style->exclPrefixNr <= 0)
return (0);
style->exclPrefixNr--;
if (style->exclPrefixNr > 0)
style->exclPrefix = style->exclPrefixTab[style->exclPrefixNr - 1];
else
style->exclPrefix = NULL;
ret = style->exclPrefixTab[style->exclPrefixNr];
style->exclPrefixTab[style->exclPrefixNr] = 0;
return (ret);
}
/************************************************************************ /************************************************************************
* * * *
@ -240,11 +254,13 @@ xsltFreeDecimalFormatList(xsltStylesheetPtr self)
* @name: the decimal-format name to find * @name: the decimal-format name to find
* *
* Find decimal-format by name * Find decimal-format by name
*
* Returns the xsltDecimalFormatPtr
*/ */
xsltDecimalFormatPtr xsltDecimalFormatPtr
xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, xmlChar *name) xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, xmlChar *name)
{ {
xsltDecimalFormatPtr result; xsltDecimalFormatPtr result = NULL;
if (name == NULL) if (name == NULL)
return sheet->decimalFormat; return sheet->decimalFormat;

View File

@ -50,8 +50,29 @@ struct _xsltRuntimeExtra {
void *val; /* data not needing deallocation */ void *val; /* data not needing deallocation */
}; };
/**
* XSLT_RUNTIME_EXTRA_LST:
* @ctxt: the transformation context
* @nr: the index
*
* Macro used to access extra information stored in the context
*/
#define XSLT_RUNTIME_EXTRA_LST(ctxt, nr) (ctxt)->extras[(nr)].info #define XSLT_RUNTIME_EXTRA_LST(ctxt, nr) (ctxt)->extras[(nr)].info
/**
* XSLT_RUNTIME_EXTRA_FREE:
* @ctxt: the transformation context
* @nr: the index
*
* Macro used to free extra information stored in the context
*/
#define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr) (ctxt)->extras[(nr)].deallocate #define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr) (ctxt)->extras[(nr)].deallocate
/**
* XSLT_RUNTIME_EXTRA:
* @ctxt: the transformation context
* @nr: the index
*
* Macro used to define extra information stored in the context
*/
#define XSLT_RUNTIME_EXTRA(ctxt, nr) (ctxt)->extras[(nr)].val #define XSLT_RUNTIME_EXTRA(ctxt, nr) (ctxt)->extras[(nr)].val
/** /**

View File

@ -476,6 +476,8 @@ xsltSetTransformErrorFunc(xsltTransformContextPtr ctxt,
/** /**
* xsltTransformError: * xsltTransformError:
* @ctxt: an XSLT transformation context * @ctxt: an XSLT transformation context
* @style: the XSLT stylesheet used
* @node: the current node in the stylesheet
* @msg: the message to display/transmit * @msg: the message to display/transmit
* @...: extra parameters for the message display * @...: extra parameters for the message display
* *
@ -631,10 +633,12 @@ xsltDocumentSortFunction(xmlNodeSetPtr list) {
/** /**
* xsltComputeSortResult: * xsltComputeSortResult:
* @ctxt: a XSLT process context * @ctxt: a XSLT process context
* @sorts: array of sort nodes * @sort: node list
* *
* 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 array of nodes. * requirement provided by the array of nodes.
*
* Returns a ordered XPath nodeset or NULL in case of error.
*/ */
xmlXPathObjectPtr * xmlXPathObjectPtr *
xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) { xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort) {
@ -1321,7 +1325,6 @@ xsltSaveResultToFd(int fd, xmlDocPtr result, xsltStylesheetPtr style) {
* @doc_txt_len: Length of the generated XML text * @doc_txt_len: Length of the generated XML text
* @result: the result xmlDocPtr * @result: the result xmlDocPtr
* @style: the stylesheet * @style: the stylesheet
* @compression: the compression factor (0 - 9 included)
* *
* Save the result @result obtained by applying the @style stylesheet * Save the result @result obtained by applying the @style stylesheet
* to a file or @URL * to a file or @URL
@ -1715,7 +1718,7 @@ static xsltDebuggerCallbacks xsltDebuggerCurrentCallbacks = {
int xslDebugStatus; int xslDebugStatus;
/** /**
* xslSetDebuggerCallbacks: * xsltSetDebuggerCallbacks:
* @no : number of callbacks * @no : number of callbacks
* @block : the block of callbacks * @block : the block of callbacks
* *
@ -1777,7 +1780,7 @@ xslAddCall(xsltTemplatePtr templ, xmlNodePtr source)
} }
/** /**
* xslDropCall : * xslDropCall:
* *
* Drop the topmost item off the call stack * Drop the topmost item off the call stack
*/ */

View File

@ -24,7 +24,7 @@ extern "C" {
#endif #endif
/** /**
* TODO: * XSLT_TODO:
* *
* Macro to flag unimplemented blocks. * Macro to flag unimplemented blocks.
*/ */
@ -34,7 +34,7 @@ extern "C" {
__FILE__, __LINE__); __FILE__, __LINE__);
/** /**
* STRANGE: * XSLT_STRANGE:
* *
* Macro to flag that a problem was detected internally. * Macro to flag that a problem was detected internally.
*/ */
@ -175,6 +175,11 @@ xmlDocPtr xsltGetProfileInformation (xsltTransformContextPtr ctxt);
long xsltTimestamp (void); long xsltTimestamp (void);
void xsltCalibrateAdjust (long delta); void xsltCalibrateAdjust (long delta);
/**
* XSLT_TIMESTAMP_TICS_PER_SEC:
*
* Sampling precision for profiling
*/
#define XSLT_TIMESTAMP_TICS_PER_SEC 100000l #define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
/* /*

View File

@ -33,6 +33,7 @@ isBlank()
loadStylesheetPI() loadStylesheetPI()
newStylesheet() newStylesheet()
parseStylesheetDoc() parseStylesheetDoc()
parseStylesheetFile()
# functions from module xsltutils # functions from module xsltutils
calibrateAdjust() calibrateAdjust()
@ -110,6 +111,8 @@ Class transformCtxt()
# functions from module templates # functions from module templates
attrListTemplateProcess() attrListTemplateProcess()
attrTemplateProcess() attrTemplateProcess()
attrTemplateValueProcess()
attrTemplateValueProcessNode()
evalAttrValueTemplate() evalAttrValueTemplate()
evalTemplateString() evalTemplateString()
@ -118,6 +121,9 @@ Class transformCtxt()
freeTransformContext() freeTransformContext()
registerAllElement() registerAllElement()
# functions from module transform.c
copyTree()
# functions from module variables # functions from module variables
evalGlobalVariables() evalGlobalVariables()
evalOneUserParam() evalOneUserParam()