xsl-list
[Top] [All Lists]

Re: Reading Attributes in XSL

2005-11-15 09:31:42


I am trying to read attributes of current node such that I read the first
Attribute 

Note that attribute order is stable but implementation defined.
What do you mean by "first attribute" ? You can use @*[1] to select the
first attribute in document order, but that need not be (and often is
not) the first attribute to appear on the element. (XML parsers are not
required to report the order in which attributes appear).

On the face of it you seem to want

<xsl:for-each select="@*[1]|*/@*">
 something for first attribute and attributes on children
</xsl:for-each>
<xsl:for-each select="@*[position()&gt;1]">
 something for later attributes
</xsl:for-each>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>