xsl-list
[Top] [All Lists]

Re: [xsl] position last and attributes

2012-09-20 07:30:44
Hi Ihe,

On Thu, Sep 20, 2012 at 4:05 PM, Ihe Onwuka 
<ihe(_dot_)onwuka(_at_)googlemail(_dot_)com> wrote:
the same way that I say that applying an ordering semantic to
something that is unordered is paradoxical.

As has been discussed, the position() and last() functions have
ordering semantics that relates to the instance sequence (which most
likely exists in a XSLT stylesheet at run-time). This ordering is not
related to the document order of an XML instance.

Also, a sequence may contain heterogeneous collection of items (like
elements, attributes, atomic values all in one sequence). For e.g, if
you do,

<!-- iterate elements and attributes together -->
<xsl:for-each select="elem | @*">
    <xsl:value-of select="position()"/>
</xsl:for-each>

Then the value of position() in this case, is the position of context
item (which could be an element or attribute).



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
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>
--~--