Details
-
Bug
-
Status: Resolved
-
Resolution: Incomplete
-
2.2.0
-
None
-
None
-
Operating System: Linux
Platform: PC
-
6124
Description
I'm using the following style sheet (see at the bottom) with
Xalan (version 2.2.0) and from the docs I've read (mainly
http://www.w3.org/TR/xslt#attribute-value-templates, but also the
FAQs and HOWTOs reported on xml.apache.org site) I was expecting a result
like
var = VALUE
get returns VALUE
<other:element value="VALUE"/>
but instead I got
var = VALUE
get returns {$var}
<other:element value="VALUE"/>
as if "{$var}" is not substituted in extension elements. What am I missing
here? Any help will be appreciated...
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:ext="ext"
extension-element-prefixes="ext"
version="1.0">
<lxslt:component prefix="ext" elements="set" functions="get">
<lxslt:script lang="javascript">
var t = "";
function set( xp, e )
{ t = e.getAttribute( "value" ); return null; }function get()
{ return t; }</lxslt:script>
</lxslt:component>
<xsl:variable name="var" select="'VALUE'"/>
<xsl:template match="/">
var = <xsl:value-of select="$var"/>
<ext:set value="{$var}"/>
get returns <xsl:copy-of select="ext:get()"/>
<other:element value="{$var}"/>
</xsl:template>
</xsl:stylesheet>