DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6124>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6124

Attribute value templates aren't substituted in extension elements

           Summary: Attribute value templates aren't substituted in
                    extension elements
           Product: XalanJ2
           Version: 2.2.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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>

Reply via email to