Subject: RE: Outputting literal and 'quoted' tags.
From: "Stuart Celarier" <stuart@xxxxxxxxxxx>
Date: Wed, 5 Dec 2001 11:19:14 -0800
|
Excellent question, Joerg. Yes, both forms are correct XSLT. And using an
<xsl:attribute-set> would also be correct.
The <xsl:attribute> approach offers more flexibility than an attribute value
template (such as {@id}). That is useful in cases where there is conditional
logic for what the value is or whether the attribute is present. You might
also consider using <xsl:attribute> to aid in modularity and readability
when the attribute value is the result of a complex expression.
The <xsl:attribute-set> allows several attributes to be grouped together,
providing a little sanity in an attribute-dense data model.
For a comparison of the different options and their merits, see [1]. I was
trying to illustrate that there is a range of options available.
Cheers,
Stuart, stuart@xxxxxxxxxxx, www.ferncrk.com
Reference
[1] Kay, Michael, "XSLT Programmer's Reference, Second Edition", Wrox Press,
2001. See p. 169, "Usage".
-----Original Message-----
Why this extended version
> <input type="checkbox" value="yes">
> <xsl:attribute name="name"><xsl:value-of
select="@id"/></xsl:attribute>
> </input>
when it does the same like Emilianos
<input type="checkbox" value="yes" name="{@id}"/>
This is correct XSL!
Regards,
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: Outputting literal and 'quoted' tags., (continued)
- David Carlisle - Wed, 5 Dec 2001 08:12:05 -0500 (EST)
- Emiliano - Wed, 5 Dec 2001 08:32:31 -0500 (EST)
- Stuart Celarier - Wed, 5 Dec 2001 12:48:04 -0500 (EST)
- Jörg Heinicke - Wed, 5 Dec 2001 13:37:41 -0500 (EST)
- Stuart Celarier - Wed, 5 Dec 2001 14:14:31 -0500 (EST) <=
- Emiliano - Wed, 5 Dec 2001 13:59:02 -0500 (EST)
- David Carlisle - Wed, 5 Dec 2001 16:48:50 -0500 (EST)
- Mike Brown - Wed, 5 Dec 2001 12:51:21 -0500 (EST)
- Emiliano - Wed, 5 Dec 2001 13:44:27 -0500 (EST)
|
|