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

Re: xsl:sequence

Subject: Re: xsl:sequence
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 9 Aug 2006 13:05:52 +0100
Re:  xsl:sequence
> My point is that if xsl:sequence can mimic xsl:value-of behavior in this way 
> whats the point of using xsl:value-of ever?

xsl:value-of returns the string value of an element, and that isn't
obtainable from xsl:sequence (without doing a lot of work that the
system has already done) The string-value of an element is designed to
produce the "right" text in cases where XML is being used as originally
designed as a markup language marking up a text flow.

See the example I showed earlier

<p><i>This</i> is <b>bold</b> text</p>

the string value of that paragraph is "This is bold text" and that is
what <xsl:value-of select="p"/> returns.

<xsl:sequence select="p/text()"/> returns the sequence of child text
nodes, that is the sequence of two text nodes " is " and " text"  this
collection of words that happened not to be marked up isn't usually very

The functions of xsl:sequence and xsl:value-of are almost completely
different and usually it's clear which you should use.
xsl:copy-of and xsl:sequence of are much closer, as the difference is
that copy-of makes a copy, but in most situations where you need to
copy, for example copying nodes from the input tree to the result, there
is an implied copy operation anyway so the distinction between
xsl:copy-of and xsl:sequence is hidden.


Current Thread


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.
First Name
Last Name
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.