[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: getting the text nodes from a set of attribute nod
Hi, > <a> > <b attr='whatever' ... </b> > <b attr='more' ... </b> > <b attr='yadda yadda' ... </b> > </a> > > 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 > processing. > > 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? Unlike in DOM, XPath attributes don't contain their textual value as a text node child, but rather it's just their value, see <http://www.w3.org/TR/xpath#attribute-nodes>. So the only way is to pass the attribute nodes themselves. Cheers, Jarno - Front Line Assembly: Final Impact 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
|