summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--libxslt/imports.c16
-rw-r--r--tests/docs/Makefile.am1
-rw-r--r--tests/docs/bug-147.xml21
-rw-r--r--tests/general/Makefile.am3
-rw-r--r--tests/general/bug-147-1.imp11
-rw-r--r--tests/general/bug-147-2.imp11
-rw-r--r--tests/general/bug-147-3.imp57
-rw-r--r--tests/general/bug-147-4.imp15
-rw-r--r--tests/general/bug-147-5.imp27
-rw-r--r--tests/general/bug-147-6.imp31
-rw-r--r--tests/general/bug-147.out17
-rw-r--r--tests/general/bug-147.xsl29
13 files changed, 244 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 75a2127b..65b439ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun May 2 23:47:43 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * libxslt/imports.c: added comments and function header,
+ improved logic of routine just added.
+ * tests/general/bug-147*, tests/docs/bug-147.xml,
+ tests/general/Makefile.am, tests/docs/Makefile.am: added
+ regression test for bug 141279
+
Sun May 2 12:47:32 PDT 2004 William Brack <wbrack@mmm.com.hk>
* libxslt/imports.c: enhanced normalization of comp steps
diff --git a/libxslt/imports.c b/libxslt/imports.c
index 85b62cf1..21dca748 100644
--- a/libxslt/imports.c
+++ b/libxslt/imports.c
@@ -52,13 +52,22 @@
* Module interfaces *
* *
************************************************************************/
+/**
+ * xsltFixImportedCompSteps:
+ * @master: the "master" stylesheet
+ * @style: the stylesheet being imported by the master
+ *
+ * normalize the comp steps for the stylesheet being imported
+ * by the master, together with any imports within that.
+ *
+ */
static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
xsltStylesheetPtr style) {
xsltStylesheetPtr res;
- for (res = style; res != NULL; res = res->imports)
- xmlHashScan(res->templatesHash,
+ xmlHashScan(style->templatesHash,
(xmlHashScanner) xsltNormalizeCompSteps, master);
- master->extrasNr += style->extrasNr;
+ for (res = style->imports; res != NULL; res = res->next)
+ xsltFixImportedCompSteps(master, res);
}
/**
@@ -143,6 +152,7 @@ xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) {
res->next = style->imports;
style->imports = res;
xsltFixImportedCompSteps(style, res);
+ style->extrasNr += res->extrasNr;
ret = 0;
} else {
xmlFreeDoc(import);
diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am
index 85f94ba9..5c57fcd5 100644
--- a/tests/docs/Makefile.am
+++ b/tests/docs/Makefile.am
@@ -146,6 +146,7 @@ EXTRA_DIST = \
bug-144.xml \
bug-145.xml \
bug-146.xml \
+ bug-147.xml \
character.xml \
array.xml \
items.xml
diff --git a/tests/docs/bug-147.xml b/tests/docs/bug-147.xml
new file mode 100644
index 00000000..d3a17685
--- /dev/null
+++ b/tests/docs/bug-147.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" standalone="yes"?>
+<dokument>
+<paragraph>
+<liste>
+<le>abc</le>
+</liste>
+</paragraph>
+<navigation location="bottom">
+<interestguide>
+<index>
+<link type="internal" text="Allgemein">
+<action name="ChangeBGColor" event="onMouseOver">
+<pass-param name="color" value="#f9e84a"/>
+</action>
+<action name="ChangeBGColor" event="onMouseOut"><pass-param name="color"
+value="#ffffff"/></action>
+</link>
+</index>
+</interestguide>
+</navigation>
+</dokument>
diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am
index 4bd304c1..202adda5 100644
--- a/tests/general/Makefile.am
+++ b/tests/general/Makefile.am
@@ -152,6 +152,9 @@ EXTRA_DIST = \
bug-144.out bug-144.xsl \
bug-145.out bug-145.xsl bug-145.err \
bug-146.out bug-146.xsl \
+ bug-147.out bug-147.xsl \
+ bug-147-1.imp bug-147-2.imp bug-147-3.imp \
+ bug-147-4.imp bug-147-5.imp bug-147-6.imp \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-147-1.imp b/tests/general/bug-147-1.imp
new file mode 100644
index 00000000..764f0efe
--- /dev/null
+++ b/tests/general/bug-147-1.imp
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="dokument">
+ <xsl:text>template#1 in module#1;</xsl:text>
+ <xsl:apply-templates select="paragraph"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-2.imp b/tests/general/bug-147-2.imp
new file mode 100644
index 00000000..86aa3b5d
--- /dev/null
+++ b/tests/general/bug-147-2.imp
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="interestguide">
+ <xsl:text>template#1 in module#2;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-3.imp b/tests/general/bug-147-3.imp
new file mode 100644
index 00000000..89444c83
--- /dev/null
+++ b/tests/general/bug-147-3.imp
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="numliste">
+ <xsl:text>template#1 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="numliste-u">
+ <xsl:text>template#2 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="liste | liste-u">
+ <xsl:text>template#3 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="numliste[@startindex] | numliste-u[@startindex]">
+ <xsl:text>template#4 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='strich'] |
+ le[parent::liste or parent::liste-u][not
+(parent::*/@typ)]">
+ <xsl:text>template#5 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='punkt']">
+ <xsl:text>template#6 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='kasten']">
+ <xsl:text>template#7 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="le[parent::*/@typ='arabisch'] |
+ le[parent::numliste or parent::numliste-u][not
+(parent::*/@typ)]">
+ <xsl:text>template#8 in module#3;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-4.imp b/tests/general/bug-147-4.imp
new file mode 100644
index 00000000..af2b0065
--- /dev/null
+++ b/tests/general/bug-147-4.imp
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="./bug-147-5.imp"/>
+
+
+<xsl:template match="action[@name='ShowPage']
+ [@event='onClick']
+ [pass-param/@name='pageid']">
+ <xsl:text>template#1 in module#4;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-5.imp b/tests/general/bug-147-5.imp
new file mode 100644
index 00000000..48515c10
--- /dev/null
+++ b/tests/general/bug-147-5.imp
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="./bug-147-6.imp"/>
+
+
+<xsl:template match="action[@name='ShowPage']
+ [@event='onClick']
+ [pass-param/@name='pageid']">
+ <xsl:text>template#1 in module#5;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ChangeBGColor']
+ [@event='onMouseOver']">
+ <xsl:text>template#2 in module#5;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ChangeBGColor']
+ [@event='onMouseOut']">
+ <xsl:text>template#3 in module#5;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147-6.imp b/tests/general/bug-147-6.imp
new file mode 100644
index 00000000..b6b52d0a
--- /dev/null
+++ b/tests/general/bug-147-6.imp
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="action[@name='ShowPage']
+ [@event='onClick']
+ [pass-param/@name='pagenum']">
+ <xsl:text>template#1 in module#6;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ShowPage']
+ [@event='onClick']
+ [pass-param/@name='pageid']">
+ <xsl:text>template#2 in module#6;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="action[@name='ShowInfoText']
+ [@event='onCreate']">
+ <xsl:text>template#3 in module#6;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="pass-param"
+ mode="invlink">
+ <xsl:text>template#4 in module#6;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/general/bug-147.out b/tests/general/bug-147.out
new file mode 100644
index 00000000..46963a8c
--- /dev/null
+++ b/tests/general/bug-147.out
@@ -0,0 +1,17 @@
+<html>
+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
+<body><div>template#1 in module#1;
+template#3 in module#3;
+template#5 in module#3;abc
+
+
+template#1 in module#2;
+
+
+template#2 in module#5;
+template#3 in module#5;
+
+
+
+</div></body>
+</html>
diff --git a/tests/general/bug-147.xsl b/tests/general/bug-147.xsl
new file mode 100644
index 00000000..70b54735
--- /dev/null
+++ b/tests/general/bug-147.xsl
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="./bug-147-3.imp"/>
+<xsl:import href="./bug-147-2.imp"/>
+<xsl:import href="./bug-147-1.imp"/>
+<xsl:import href="./bug-147-4.imp"/>
+
+
+<xsl:output method="html"/>
+
+
+<xsl:template match="/">
+ <html>
+ <head></head>
+ <body><xsl:apply-templates select="/dokument"/></body>
+ </html>
+</xsl:template>
+
+
+<xsl:template match="dokument">
+ <div>
+ <xsl:apply-imports/>
+ <xsl:apply-templates select="navigation[@location='bottom']"/>
+ </div>
+</xsl:template>
+
+</xsl:stylesheet>