all groups > dotnet xml > january 2006 >
You're in the

dotnet xml

group:

Querying the last 2 ids for displaying


Querying the last 2 ids for displaying Aaron
1/26/2006 4:25:13 PM
dotnet xml:
Hello,
How can pull the last 5 ids in a list for displaying?
Display.xsl

<xsl:template match="/">

<xsl:for-each select="document(/Filings/File/@href)/DataCollected">

<xsl:sort select="@id" order="ascending" />

<xsl:apply-templates select="."/>

</xsl:for-each>

</xsl:template>

Filing.xml

<Filing>

<File href="Post1.xml" id="1"/>

<File href="Post2.xml" id="2"/>

<File href="Post3.xml" id="3"/>

.....

.....

.....

</Filing>

Re: Querying the last 2 ids for displaying Dimitre Novatchev
1/27/2006 12:00:00 AM

[quoted text, click to view]



<xsl:for-each select="document(/Filings/File/@href)/DataCollected">
<xsl:sort select="@id" order="ascending" />

<xsl:if test="5 > last() - position()">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>


Cheers,
Dimitre Novatchev

AddThis Social Bookmark Button