[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Weird behavior with attributes and >

Subject: Weird behavior with attributes and >
From: "Nesbitt, David" <DNesbitt@xxxxxxxxxx>
Date: Fri, 31 Aug 2001 16:19:30 -0700
weird attributes of people
Good People,

I have a follow-up on attributes.

I am trying to use XSLT to create JSPs.  In the JSP, JSP expressions are
often used to provide form element attribute values.  For example:

    <input
        type="hidden"
        name="<%= javaName %>"
        value="<%= javaValue %>">

I need to generate JSP v1.0 (so I can't use the new JSP XML
representations).  Here is what I have tried to do:

<xsl:output method="html"/>
<xsl:variable name="open.expression"><![CDATA[<%= ]]></xsl:variable>
<xsl:variable name="close.expression"><![CDATA[ %>]]></xsl:variable>
. . .
    <input>
        <xsl:attribute name="type">hidden</xsl:attribute>
        <xsl:attribute name="name">
            <xsl:value-of select="$open.expression"
disable-output-escaping="yes"/>javaName<xsl:value-of
select="$close.expression" disable-output-escaping="yes"/>
        </xsl:attribute>
        <xsl:attribute name="value">
            <xsl:value-of select="$open.expression"
disable-output-escaping="yes"/>javaValue<xsl:value-of
select="$close.expression" disable-output-escaping="yes"/>
        <xsl:attribute name="value">
    </input>

Unfortunately, the following gets created:

    <input type="hidden" name="<%= javaName %&gt;" value="<%= javaValue
%&gt;">

Is there anyway I can get around the conversion of ">" to "&gt;" within
attributes.  I am confused because I am using the CDATA and
disable-output-escaping trick to get around the conversion.  When I use
the value-of technique outside of attributes, the ">" does not get
converted.

Any help would be greatly appreciated.

Regards,
Dave

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.