Re: can you select name() of attributes?
> I think it drops down to the following: can you select name() of attributes in > a select attribute in an xsl element? yes as for any node select="name(/foo/bar/@baz)" will return the name of the selected node ("baz") in thi scase. > <xsl:variable name="Attr" select="$Doc/@*"/> which selects all attributes in > the Doc variable (which are text values as far as I know...?) No. That selects attribute nodes not text values. > I want to be able to use the name of the attributes in the same way as a > reqular nodeset, well tough, it's a string not a node set:-) > where I can say node-A=nodeset-B which in a nodeset is true >if just one node in nodeset-B is equal to node-A. As MK says most days you can do this in XPath 2 but not in Xpath 1 howver you can do it in xslt 1. If you have two sets of attributes, eg <xsl:variable name="Attr1" select="$Doc1/@*"/> <xsl:variable name="Attr2" select="$Doc2/@*"/> Then you want something like: <xsl:for-each select="$Attr1"> <xsl:for-each select="$Attr2[name()=name(current())]"> this is in Attr and Attr2: <xsl:value-of select="name()"/> </xsl:for-each> </xsl:for-each> David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
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