[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT 2.0: When to use xsl:sequence, when to use x
On Sat, 16 Jun 2007 10:18:45 -0600, Florent Georges <darkman_spam@xxxxxxxx> wrote: <xsl:stylesheet xmlns:xsl="http://www.w3c.org/1999/XSL/Transform" version="2.0"> <xsl:variable name="elem" as="element()"> <elem a="value"/> </xsl:variable> <xsl:template match="/"> <xsl:sequence select="$elem/@a"/> </xsl:template> </xsl:stylesheet>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:variable name="elem" as="element()"> <elem>foo</elem> </xsl:variable> <xsl:template match="/"> <xsl:sequence select="$elem/text()" /> </xsl:template> </xsl:stylesheet> and <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:variable name="elem" as="element()"> <elem>foo</elem> </xsl:variable> <xsl:template match="/"> <xsl:value-of select="$elem/text()" /> </xsl:template> </xsl:stylesheet> will both produce 'foo' in the final serialized output. In this regard, is there a reason why one might use xsl:sequence over xsl:value-of or vice-versa? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|