1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-08 21:42:07 +03:00

fixed bug #73791 related to extension function declared in included

* libxslt/extensions.c: fixed bug #73791 related to extension
  function declared in included stylesheets
* tests/exslt/functions/function.7.*: added specific test
Daniel
This commit is contained in:
Daniel Veillard
2002-03-07 16:03:34 +00:00
parent e1ff13c822
commit cc0e7a04fd
6 changed files with 67 additions and 8 deletions

View File

@@ -1,3 +1,9 @@
Thu Mar 7 17:01:21 CET 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/extensions.c: fixed bug #73791 related to extension
function declared in included stylesheets
* tests/exslt/functions/function.7.*: added specific test
Thu Mar 7 15:20:32 CET 2002 Daniel Veillard <daniel@veillard.com>
* tests/docs/Makefile.am tests/docs/bug-75.xml

View File

@@ -311,6 +311,7 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
if ((style == NULL) || (inst == NULL))
return;
{
xmlChar *qname;

View File

@@ -406,17 +406,28 @@ xsltFreeCtxtExts(xsltTransformContextPtr ctxt) {
*/
void *
xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI) {
xsltExtDataPtr data;
xsltExtDataPtr data = NULL;
xsltStylesheetPtr tmp;
if ((style == NULL) || (URI == NULL))
return (NULL);
if (style->extInfos == NULL) {
style->extInfos = xmlHashCreate(10);
if (style->extInfos == NULL)
return(NULL);
data = NULL;
} else {
data = (xsltExtDataPtr) xmlHashLookup(style->extInfos, URI);
tmp = style;
while (tmp != NULL) {
if (tmp->extInfos != NULL) {
data = (xsltExtDataPtr) xmlHashLookup(tmp->extInfos, URI);
if (data != NULL)
break;
}
tmp = xsltNextImport(tmp);
}
if (data == NULL) {
if (style->extInfos == NULL) {
style->extInfos = xmlHashCreate(10);
if (style->extInfos == NULL)
return(NULL);
}
}
if (data == NULL) {
void *extData;

View File

@@ -0,0 +1,2 @@
<?xml version="1.0"?>
<out xmlns:my="my://own.uri">17</out>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<doc>
<section index="section1" index2="atr2val">
<section index="subSection1.1">
<p>Hello</p>
<p>Hello again.</p>
</section>
</section>
<section index="section2">
<p>Hello2</p>
<section index="subSection2.1">
<p>Hello</p>
<p>Hello again.</p>
</section>
<section index="subSection2.2">
<p>Hello</p>
<p>Hello again.</p>
</section>
<p>Hello2 again.</p>
<section index="subSection2.3">
<p>Hello</p>
<p>Hello again.</p>
</section>
</section>
</doc>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:my="my://own.uri">
<xsl:import href="function.1.xsl"/>
<xsl:template match="/">
<out>
<xsl:value-of select="my:count-elements()"/>
</out>
</xsl:template>
</xsl:stylesheet>