XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Shoeb AhmedSubject: Compare Text Field
Author: Shoeb Ahmed
Date: 06 Dec 2006 10:23 PM
From Shoeb
I have some text nodes( DATA ) which is to be compared. There are seven differnt values in the the DATA . viz "Aerospace, Wings, Cockpit, GPS, Sattelite, Delta, Octaware" . This data is displayed in the List Box. My requirement is 'GPS' to be selected. But when i am using the code shown below , eavery value is selected .
Look forward for your anticipation.

Regards

Shoeb
<SELECT size="4" multiple="True" NAME="programNames" id="programname_">
<xsl:for-each select="$defaultProgramNames/ProgramNames/programname">
<OPTION value="{.}">
<xsl:if test="$defaultProgramNames/ProgramNames/programname/test() = 'GPS'">
<xsl:attribute name="selected">
<xsl:value-of select="true"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="."/>
</OPTION>
</xsl:for-each>
</SELECT>

Postnext
James DurningSubject: Compare Text Field
Author: James Durning
Date: 07 Dec 2006 11:04 AM
Originally Posted: 07 Dec 2006 11:03 AM
Your test should depend on the node you are testing; no need to reference the variable again in the if, otherwise you'll be testing a different node:
<xsl:for-each select="$defaultProgramNames/ProgramNames/programname">
<OPTION value="{.}">
<xsl:if test="test() = 'GPS'">

Posttop
Shoeb AhmedSubject: Compare Text Field
Author: Shoeb Ahmed
Date: 08 Dec 2006 03:37 AM
Hi James Durning
Thanks for your help . It worked just I replaced test() with a ". "
The code is shown below.

Regards

Shoeb Ahmed
INDIA

<xsl:for-each select="$defaultProgramNames/ProgramNames/programname">
<OPTION value="{.}">
<xsl:if test=". = 'GPS'">


 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.