| | |
Following XSLT Logic Not Working
Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
I have to check value of a variable in XSLT if it is null then i have to set it to default "$"
so for that i have written following XSLT code:
<XSL:variable name dummy select= "ArrayOfBookMark/BookMark[ShortName='Asp-7041-EndVar1]/Value">
<XSL:choose>
<XSL:when test="($dummy!='')">
<XSL:variable name="dummy1" select="$dummy"/>
</when>
<XSL:otherwise>
<XSL:variable name="dummy1" select="'$'"/>
</XSL:variable>
<XSL:otherwise>
</XSL:choose>
Here in Dummy i am copying the value comming from follwing XML.it is retriving value correctly in to dummy.
Condition also checking but the value assignment code for new variable "dummy1" is not happening.
<ArrayOfBookMark>
<BookMark>
<ShortName>Asp-7041-EndVar1</ShortName>
<Value>12345</Value>
</BookMark>
</ArrayOfBookMark>
please help...
Quick response will b appriciated.
-Sanket
Sanket.chougule@gmail.com
so for that i have written following XSLT code:
<XSL:variable name dummy select= "ArrayOfBookMark/BookMark[ShortName='Asp-7041-EndVar1]/Value">
<XSL:choose>
<XSL:when test="($dummy!='')">
<XSL:variable name="dummy1" select="$dummy"/>
</when>
<XSL:otherwise>
<XSL:variable name="dummy1" select="'$'"/>
</XSL:variable>
<XSL:otherwise>
</XSL:choose>
Here in Dummy i am copying the value comming from follwing XML.it is retriving value correctly in to dummy.
Condition also checking but the value assignment code for new variable "dummy1" is not happening.
<ArrayOfBookMark>
<BookMark>
<ShortName>Asp-7041-EndVar1</ShortName>
<Value>12345</Value>
</BookMark>
</ArrayOfBookMark>
please help...
Quick response will b appriciated.
-Sanket
Sanket.chougule@gmail.com
•
•
Join Date: Oct 2008
Posts: 95
Reputation:
Solved Threads: 5
0
#2 31 Days Ago
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<xsl:variable name="dummy" select= "/ArrayOfBookMark/BookMark[ShortName='Asp-7042-EndVar1']/Value" /> <xsl:variable name="dummy1"> <xsl:choose> <xsl:when test="$dummy != ''">$dummy</xsl:when> <xsl:otherwise>$</xsl:otherwise> </xsl:choose> </xsl:variable>
![]() |
Similar Threads
- This still isn't working... (Python)
- finding prime numbers (C++)
- animation and threads (Java)
- stopping code executing if cancel button pressed on msgbox (VB.NET)
- if statement is not working... (C)
- parameter passing thru on click for different buttons (ASP)
- Chess Program (C++)
- Homework Help. (C++)
- urgent help required plz help (C)
- syntax error (C)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: Retrieving data from a sharepoint list using CAML query - returning uneeded columns
- Next Thread: Password protect SpreadsheetML
| Thread Tools | Search this Thread |






