|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I would like to find out how to incorporate a query such as when AccBal is less than 25000.00
When I use for-each select or when test it gives me error saying The value of attribute "test" associated with an element type "xsl:when" must not contain the '<' character. [84] ---------------------------------------------------------- <xsl:template match="ns:Customer"> <!--<xsl:template match="ns:Product">--> <tr> <xsl:variable name="Fees" select="10.00"/> <xsl:variable name="Deposits" select="sum(ns ep)"/><xsl:variable name="Wdl" select="sum(ns:Wdl)"/> <xsl:variable name="Monthly" select="($Balance + $Deposits) - ($Wdl)"/> <xsl:variable name="FinalMonthly" select="($Monthly) - ($Fees)"/> <xsl:choose> <xsl:when test="ns:Customer[(ns:AccBal<'25000.00')]"> <td><xsl:number value="position()"/>.<xsl:value-of select="ns:Customer[@Name]"/></td> <td><xsl:value-of select="ns:AccBal"/></td> <td><xsl:value-of select="ns:Country"/></td> <td><xsl:value-of select="Country"/></td> <td><xsl:value-of select="$FinalMonthly"/></td> </xsl:when> <xsl therwise><td>#a0FFa0</td> </xsl therwise> </xsl:choose> is less than |
|
#2
|
|||
|
|||
|
Simple answer is that there are certain characters you cannot use in xsl. Good example is '&nsbp;'. Here you have to use '&nsbp;' or you you can use the decimal equivalent '*'. Both will work.
Both '<' and '>' fall into this as well so use '<' for '<' and '>' for '>'. |
|
#3
|
|||
|
|||
|
Decimal is #160; with a & before it. Won't show here for some reason.
|
|
#4
|
|||
|
|||
|
XPath:Less Than
Quote:
---thanks much for responding!Can you please give me the full syntax with < and decimal that you are talking about?I dont think I am using them right... ![]() |
|
#5
|
|||
|
|||
|
Assuming your code is correct & your syntax is right,
<xsl:when test="ns:Customer[(ns:AccBal < '25000.00')]"> I don't know the decimal code off hand but this link was given to me by eknock in another thread, http://www.natural-innovations.com/wa/doc-charset.html |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > help!!XPATH QUERY:How to use "<" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|