|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
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 If Condition
Hi,
I have two different XML files which I need to process using the same XSL file. One of the XML files has the <EMAILID> tag and the other XML file has the <S_SMTP_ADR> tag. Each file can only have one of these tags. What I need to do is populate a variable with the value in these tags if they are present. My code below gives a syntax error: <xsl:if test="$AppUserID.length > 0"> <xsl:value-of select="$AppUserID"/> </xsl:if> <xsl:if test="$RegUserID.length > 0"> <xsl:value-of select="$RegUserID"/> </xsl:if> Can anybody guide me here please. Thanks,
__________________
Ranjan Kumar |
|
#2
|
|||
|
|||
|
Instead of the if try the choose:
<xsl:choose> <xsl:when test="$AppUserID.length > 0"> <xsl:value-of select="$AppUserID"/> </xsl:when> <xsl:when test="$RegUserID.length > 0"> <xsl:value-of select="$RegUserID"/> </xsl:when> <xsl therwise><xsl:text>It was not the first two!</text> </xsl therwise></choose> In this examp the otherwise is optional, but wanted to show it just it case it could come in handy. If something needs to be set if the other two fail then use the otherwise. Hope this helps! TCM!! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XSL If Condition |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|