|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: can you select name() of attributes?
> I want something that selects all the names of the > attributes. Is something > like the following possible? > <xsl:variable name="Attr" select="$Doc/@*/name()"/> or > <xsl:variable name="Attr" select="$Doc/name(@*)"/> > The XPath type system doesn't allow sequences of strings, so you can't assign a collection of names to a variable. (As DC pointed out, you can iterate over this collection, though). XPath 2.0 does allow sequences of strings. However the "/" operator only works on sequences of nodes (a much-debated question). So you would write: <xsl:variable name="attr" select="for $n in $Doc/@* return name($n)"/> This then allows if ($attr = 'abc') to test if any of the names is equal to 'abc'. Michael Kay
|
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








