R
ree32
I have a problem with XSL sorting. The problem is that I need to create
a 2 column table so I am using this.
<xsl:apply-templates select="//Photo[position()mod 2=1]">
</xsl:apply-templates>
With template
<xsl:template match="//Photo">
.....
</xsl:template>
The problem arises when I want to sort the Photos by date (field name
Taken)
I tried this
<xsl:apply-templates select="//Photo[position()mod 2=1]">
<xsl:sort select="Taken"/>
</xsl:apply-templates>
With template
<xsl:template match="//Photo">
.....
</xsl:template>
but as you could see it is sorting the first columns of photos by date
but the second column is not sorted, as the second column is produced
using :
following-sibling::*/XXXXX
When I tried this:
<xsl:apply-templates select="//Photo">
<xsl:sort select="Taken"/>
</xsl:apply-templates>
With template
<xsl:template match="//Photo[position()mod 2=1]">
.....
</xsl:template>
The table is fine but its printing out all of the data from some Photo
nodes at the top of the page.
ie.
181001047_20050627_001.jpgtmb_001047_20050627_001.jpga27/06/2005
12:00:00
AM22001047_20050628_002.jpgtmb_001047_20050628_002.jpg2planks28/06/2005
12:00:00 AM44001047_20050628_004.jpgtmb_001047_20050628_004.jpg4
28/06/2005 12:00:00
AM66001047_20050628_006.jpgtmb_001047_20050628_006.jpg28/06/2005
12:00:00 AM
Can someone tell me how to solve this problem.
a 2 column table so I am using this.
<xsl:apply-templates select="//Photo[position()mod 2=1]">
</xsl:apply-templates>
With template
<xsl:template match="//Photo">
.....
</xsl:template>
The problem arises when I want to sort the Photos by date (field name
Taken)
I tried this
<xsl:apply-templates select="//Photo[position()mod 2=1]">
<xsl:sort select="Taken"/>
</xsl:apply-templates>
With template
<xsl:template match="//Photo">
.....
</xsl:template>
but as you could see it is sorting the first columns of photos by date
but the second column is not sorted, as the second column is produced
using :
following-sibling::*/XXXXX
When I tried this:
<xsl:apply-templates select="//Photo">
<xsl:sort select="Taken"/>
</xsl:apply-templates>
With template
<xsl:template match="//Photo[position()mod 2=1]">
.....
</xsl:template>
The table is fine but its printing out all of the data from some Photo
nodes at the top of the page.
ie.
181001047_20050627_001.jpgtmb_001047_20050627_001.jpga27/06/2005
12:00:00
AM22001047_20050628_002.jpgtmb_001047_20050628_002.jpg2planks28/06/2005
12:00:00 AM44001047_20050628_004.jpgtmb_001047_20050628_004.jpg4
28/06/2005 12:00:00
AM66001047_20050628_006.jpgtmb_001047_20050628_006.jpg28/06/2005
12:00:00 AM
Can someone tell me how to solve this problem.