Copy all stylesheet namespaces during apply-gen

* src/transform/apply-gen.xsl: Copy /xsl:*/namespace::*
* test/transform/apply-gen.xspec: Add respective test
master
Mike Gerwitz 2016-07-05 00:02:06 -04:00
parent cc91a821e8
commit 1fc360bc1c
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
2 changed files with 19 additions and 0 deletions

View File

@ -63,6 +63,10 @@
</comment>
<out:stylesheet version="2.0">
<!-- namespaces might be referenced in strings (e.g. @as), and so may
not be copied by default -->
<sequence select="namespace::*[ name() ]" />
<xsl:apply-templates mode="fgen:create" />
</out:stylesheet>
</document>

View File

@ -40,6 +40,21 @@
</variable>
<!-- source namespaces must be copied -->
<scenario label="source namespaces">
<context>
<xsl:stylesheet xmlns:foobar="baz">
<xsl:function name="foobar:baz">
<xsl:param name="foo" />
</xsl:function>
</xsl:stylesheet>
</context>
<expect label="are copied to destination"
test="exists( xsl:stylesheet/namespace::foobar )" />
</scenario>
<!-- basic case -->
<scenario label="given a unary function">
<context>