apply-gen stylesheet version copy if provided
* src/transform/apply-gen.xsl: Use input stylesheet version if provided, otherwise 2.0. * test/transform/apply-gen.xpsec: Test addedmaster
parent
1fc360bc1c
commit
bb246b9bf2
|
@ -62,7 +62,7 @@
|
|||
<text>hoxsl; please do not modify</text>
|
||||
</comment>
|
||||
|
||||
<out:stylesheet version="2.0">
|
||||
<out:stylesheet version="{( @version, '2.0' )[ 1 ]}">
|
||||
<!-- namespaces might be referenced in strings (e.g. @as), and so may
|
||||
not be copied by default -->
|
||||
<sequence select="namespace::*[ name() ]" />
|
||||
|
|
|
@ -40,6 +40,31 @@
|
|||
</variable>
|
||||
|
||||
|
||||
<!-- while functions are only supported in version >=2, this could be run
|
||||
on future versions, and we want to make sure that we don't break
|
||||
anything -->
|
||||
<scenario label="stylesheet version">
|
||||
<scenario label="when provided">
|
||||
<context>
|
||||
<xsl:stylesheet version="7.05" />
|
||||
</context>
|
||||
|
||||
<expect label="is copied to output"
|
||||
test="xsl:stylesheet/@version = '7.05'" />
|
||||
</scenario>
|
||||
|
||||
|
||||
<scenario label="when empty">
|
||||
<context>
|
||||
<xsl:stylesheet />
|
||||
</context>
|
||||
|
||||
<expect label="defaults to 2.0"
|
||||
test="xsl:stylesheet/@version = '2.0'" />
|
||||
</scenario>
|
||||
</scenario>
|
||||
|
||||
|
||||
<!-- source namespaces must be copied -->
|
||||
<scenario label="source namespaces">
|
||||
<context>
|
||||
|
|
Loading…
Reference in New Issue