|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Question:from Michael Kay's Book
At 08:42 AM 6/26/2002, you wrote:
The following is what i read.. <<//@width/..>> selects all the elements in the document that have a width attribute. xsl:value-of only returns the string version of the first match. You would need the xsl:for-each in order to get all of them. Try something like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="//@width/..">
<xsl:value-of select="."/><br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>> I am a bit confused about the above mentioned statement that > i read in the book. I shud be grateful if someone(possibly > Mr Kay) clears my doubt..I think i am missing something here.. The selection is not the problem, the value-of is. The selection indeed selected all of the nodes (though your version of /rooms/room[@width] is faster). The value-of only grabbed the first one.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








