|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
desperately need help with date sorting in XSL!!
I'm doing an assignment.
I'm a beginner in all things XML related and I need to know how to sort by date. My formatting is: DD-MM-YY but I don't know how to sort. First of all, in the DTD file, the date is regarded as #PCDATA. And I have no idea how to sort it by year, then month, then day. If my problem is too vague for you, could you give me some clues on where I can go to find additional information on sorting dates? Thanks. |
|
#2
|
|||
|
|||
|
Code:
<xsl:for-each select="Date"> <xsl:sort select="substring(. , 7,2)" order="ascending" data-type="number"/> <xsl:sort select="substring(. , 4,2)" order="ascending" data-type="number"/> <xsl:sort select="substring(. , 1,2)" order="ascending" data-type="number"/> <xsl:value-of select="."/><br/> </xsl:for-each> |
|
#3
|
||||
|
||||
|
I have a question about the following code:
Quote:
I currently use the above format, but each xsl:sort tag is self-standing. Shouldn't they be nested? example: Code:
<xsl:sort select="substring(. , 7,2)" order="ascending" data-type="number"> <xsl:sort select="substring(. , 4,2)" order="ascending" data-type="number"> <xsl:sort select="substring(. , 1,2)" order="ascending" data-type="number"> </xsl:sort></xsl:sort></xsl:sort>
__________________
Hello, old friend... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > desperately need help with date sorting in XSL!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|