|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
XSL questions
Hello,
I dont know how to make a number list based on some condition in XSL. For example, it prints the Filename only when the 'FileStatus = 1' eg. <xsl:for-each select="./Files/File"> <xsl:if test="./FileStatus = 1"> No. <xsl:value-of select="position()"/> Filename: <xsl:value-of select="./Filename"/> </xsl:if> </xsl:for-each> The above codes will print No.1 Filename: FileA.txt No.5 Filename: FileB.txt and that is not my desired result. I want the 'No.' print in the order 1,2,3,4 .... eg. No.1 Filename: FileA.txt No.2 Filename: FileB.txt Anyone got some solution here? Thanks. |
|
#2
|
|||
|
|||
|
<xsl:variable name="print" select="Files/File[FileStatus = 1]"/>
<xsl:for-each select="$print"> No. <xsl:value-of select="position()"/> Filename: <xsl:value-of select="./Filename"/> </xsl:for-each> ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XSL questions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|