+Tue Jan 13 00:33:50 HKT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * libxslt/transform.c: changed to assure comment which
+ preceeds root node is output after DTD (Bug 130433)
+ * test/exslt/common/node-set.4.*: added test case for
+ Bug 130922
+
Mon Jan 12 12:51:45 HKT 2004 William Brack <wbrack@mmm.com.hk>
* doc/site.xsl: Changed logo spacing to avoid stacking
{
xmlDocPtr res = NULL;
xsltTransformContextPtr ctxt = NULL;
- xmlNodePtr root;
+ xmlNodePtr root, node;
const xmlChar *method;
const xmlChar *doctypePublic;
const xmlChar *doctypeSystem;
}
if (ctxt->type == XSLT_OUTPUT_XML) {
XSLT_GET_IMPORT_PTR(doctypePublic, style, doctypePublic)
- XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem)
- if (((doctypePublic != NULL) || (doctypeSystem != NULL)))
+ XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem)
+ if (((doctypePublic != NULL) || (doctypeSystem != NULL))) {
+ /* Need a small "hack" here to assure DTD comes before
+ possible comment nodes */
+ node = res->children;
+ res->children = NULL;
res->intSubset = xmlCreateIntSubset(res, root->name,
doctypePublic,
doctypeSystem);
+ res->children->next = node;
+ }
}
}
xmlXPathFreeNodeSet(ctxt->nodeList);
node-set.1.xml node-set.1.xsl node-set.1.out \
node-set.2.xml node-set.2.xsl node-set.2.out \
node-set.3.xml node-set.3.xsl node-set.3.out \
+ node-set.4.xml node-set.4.xsl node-set.4.out \
object-type.1.xml object-type.1.xsl object-type.1.out \
import-test1a.imp import-test1b.imp import-test1.out \
import-test1.xml import-test1.xsl
--- /dev/null
+<?xml version="1.0"?>
+<initial>Mode of FOO is input</initial><post-transform>Mode of FOO is fiddled</post-transform>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ version="1.0">
+
+<xsl:key name="tmpls" match="xsl:template" use="@name"/>
+
+<xsl:template match="/">
+ <xsl:message>
+ <xsl:text>Mode of FOO is </xsl:text>
+ <xsl:value-of select="key('tmpls', 'FOO')/@mode"/>
+ </xsl:message>
+
+ <xsl:variable name="fiddle">
+ <xsl:apply-templates select="//xsl:template"/>
+ </xsl:variable>
+
+ <xsl:apply-templates select="exsl:node-set($fiddle)" mode="faddle"/>
+</xsl:template>
+
+<xsl:template match="xsl:template">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:attribute name="mode">fiddled</xsl:attribute>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="/" mode="faddle">
+ <xsl:message>
+ <xsl:text>Mode of FOO is </xsl:text>
+ <xsl:value-of select="key('tmpls', 'FOO')/@mode"/>
+ </xsl:message>
+</xsl:template>
+
+<xsl:template name="FOO" mode="input"/>
+
+</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ version="1.0">
+
+<xsl:key name="tmpls" match="xsl:template" use="@name"/>
+
+<xsl:template match="/">
+ <xsl:element name="initial">
+ <xsl:text>Mode of FOO is </xsl:text>
+ <xsl:value-of select="key('tmpls', 'FOO')/@mode"/>
+ </xsl:element>
+
+ <xsl:variable name="fiddle">
+ <xsl:apply-templates select="//xsl:template"/>
+ </xsl:variable>
+
+ <xsl:apply-templates select="exsl:node-set($fiddle)" mode="faddle"/>
+</xsl:template>
+
+<xsl:template match="xsl:template">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:attribute name="mode">fiddled</xsl:attribute>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="/" mode="faddle">
+ <xsl:element name="post-transform">
+ <xsl:text>Mode of FOO is </xsl:text>
+ <xsl:value-of select="key('tmpls', 'FOO')/@mode"/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template name="FOO" mode="input"/>
+
+</xsl:stylesheet>