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
hardik mehtaSubject: change some element based on another
Author: hardik mehta
Date: 21 Nov 2006 05:39 AM
Hi all,

I am writing an xsl to change password based on a group. I am developing and automated testing tool for our system.

The test is an xml file like following:

<HTTPRequestSequence>
<vendid>254662</vendorid>
<flowtype>01</flowtype>
<userid>ssded</userid>
<pass>user234</pass>
<some other elements>
.....
......
.....
</some other elements>
</HTTPRequestSequence>

not I want to change passs word based on the the flowtype.

how should the xsl look like ? any answer would be helpful.

regards,
Hardik

Postnext
hardik mehtaSubject: change some element based on another
Author: hardik mehta
Date: 21 Nov 2006 05:48 AM
Originally Posted: 21 Nov 2006 05:47 AM
what I have done is following.

<xsl:template match="pass">
<xsl:variable name="flow">
<xsl:value-of select="/HTTPRequestSequence/flowtype" />
</xsl:variable>

<xsl:choose>
<xsl:when test="$flow='01'">
<xsl:text>new pass</xsl:text>
</xsl:when>
<xsl:when test="some other tests">

</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>



but this doesnt work.

Postnext
Ivan PedruzziSubject: change some element based on another
Author: Ivan Pedruzzi
Date: 21 Nov 2006 07:10 AM

<xsl:variable name="flow" select="../flowtype"/>

Ivan Pedruzzi
Stylus Studio Team
http://www.stylusstudio.com/xml_download.html

Posttop
hardik mehtaSubject: change some element based on another
Author: hardik mehta
Date: 21 Nov 2006 09:11 AM
thanks, now it is working.

I cant understand what was wrong with absolute path ?

anyway. thanks,
Hardik

 
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.