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:
@@ -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>
|
Thu Mar 7 15:20:32 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* tests/docs/Makefile.am tests/docs/bug-75.xml
|
* tests/docs/Makefile.am tests/docs/bug-75.xml
|
||||||
|
@@ -311,6 +311,7 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
|
|||||||
if ((style == NULL) || (inst == NULL))
|
if ((style == NULL) || (inst == NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
xmlChar *qname;
|
xmlChar *qname;
|
||||||
|
|
||||||
|
@@ -406,17 +406,28 @@ xsltFreeCtxtExts(xsltTransformContextPtr ctxt) {
|
|||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI) {
|
xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI) {
|
||||||
xsltExtDataPtr data;
|
xsltExtDataPtr data = NULL;
|
||||||
|
xsltStylesheetPtr tmp;
|
||||||
|
|
||||||
|
|
||||||
if ((style == NULL) || (URI == NULL))
|
if ((style == NULL) || (URI == NULL))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
if (style->extInfos == NULL) {
|
|
||||||
style->extInfos = xmlHashCreate(10);
|
tmp = style;
|
||||||
if (style->extInfos == NULL)
|
while (tmp != NULL) {
|
||||||
return(NULL);
|
if (tmp->extInfos != NULL) {
|
||||||
data = NULL;
|
data = (xsltExtDataPtr) xmlHashLookup(tmp->extInfos, URI);
|
||||||
} else {
|
if (data != NULL)
|
||||||
data = (xsltExtDataPtr) xmlHashLookup(style->extInfos, URI);
|
break;
|
||||||
|
}
|
||||||
|
tmp = xsltNextImport(tmp);
|
||||||
|
}
|
||||||
|
if (data == NULL) {
|
||||||
|
if (style->extInfos == NULL) {
|
||||||
|
style->extInfos = xmlHashCreate(10);
|
||||||
|
if (style->extInfos == NULL)
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
void *extData;
|
void *extData;
|
||||||
|
2
tests/exslt/functions/function.7.out
Normal file
2
tests/exslt/functions/function.7.out
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<out xmlns:my="my://own.uri">17</out>
|
26
tests/exslt/functions/function.7.xml
Normal file
26
tests/exslt/functions/function.7.xml
Normal 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>
|
13
tests/exslt/functions/function.7.xsl
Normal file
13
tests/exslt/functions/function.7.xsl
Normal 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>
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user