This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:attribute (was Re: URL query as table data)
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 17 Feb 2002 20:26:46 +0200
- Subject: Re: [xsl] xsl:attribute (was Re: URL query as table data)
- Organization: Multiconn International
- References: <200202170538.g1H5cmv70790@skew.org> <5767175010.20020217181048@webcsd.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Antonio!
Try shorter one :)
<xsl:template match="canal">
<option value="{@id}">
<xsl:value-of select="."/>
</option>
</xsl:template>
But anyway it (template are you talking about) should work, what is the
error message ?
--
Oleg Tkachenko
Multiconn International, Israel
Antonio Bueno wrote:
> I've tried to do the same but instead of A and HREF I was using OPTION
> and VALUE. And it didn't work.
>
> I wanted to transform
> <canal id="CP">Canal +</canal>
> into
> <option value="CP">Canal +</option>
>
> I'm using MSXML4 and this worked:
>
> <xsl:template match="canal">
> <option>
> <xsl:value-of select="."/>
> </option>
> </xsl:template>
>
> But with this I only get:
> <option>Canal +</option>
>
> Then I tried to apply Mike's answer:
>
> <xsl:template match="canal">
> <option>
> <xsl:attribute name="value">
> <xsl:value-of select="@id"/>
> </xsl:attribute>
> <xsl:value-of select="."/>
> </option>
> </xsl:template>
>
> But it didn't work (the VBScript transformNode() method I'm using gave
> me a numeric error).
>
> This is what finally worked:
>
> <xsl:template match="canal">
> <xsl:element name="option">
> <xsl:attribute name="value">
> <xsl:value-of select="@id"/>
> </xsl:attribute>
> <xsl:value-of select="."/>
> </xsl:element>
> </xsl:template>
>
> Why doesn't xsl:attribute works in the first try?
> Is it something specific from MSXML4?
>
> Thanks in advance
> and greetings from Spain
> Antonio
>
> http://www.webcsd.com
> mailto:atnbueno@webcsd.com
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list