[xsl] getting the text nodes from a set of attribute nodes

Subject: [xsl] getting the text nodes from a set of attribute nodes
From: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx>
Date: Thu, 4 Sep 2003 11:14:51 -0400 (EDT)
  i have the following XML:

   <b attr='whatever' ... </b>
   <b attr='more' ... </b>
   <b attr='yadda yadda' ... </b>

and i'd like to use another template to process the (string)
values of the (set of) "attr" attributes.

  if i'm already processing the <a> element, i can certainly
create a node-set of the appropriate attribute nodes with:

 <xsl:variable name="set" select="b/@attr"/>

that will give me a node-set of attribute nodes and, when i
pass these to another template, that template will be responsible
for taking the string value of each attribute node to do further 

  on the other hand, would it be any faster or more elegant to
use an expression to create a node-set of text nodes corresponding
to those attribute values right off the bat so that all i'm
passing is a set of text nodes?

  that is, is there an expression that would, in that above
xsl:variable template, produce the node set of text nodes
i'm after in a single select?  and do people have strong
opinions either way in terms of aesthetics?


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread