cancel
Showing results for 
Search instead for 
Did you mean: 

String Comparision in XSLT Mapping

Former Member
0 Kudos

HI All,

Can any one suggest me to compare the two strings in XSLT mapping.Please let me know is there any string comparision function in xslt?

Thanks

Pullarao

Accepted Solutions (0)

Answers (3)

Answers (3)

prateek
Active Contributor
0 Kudos

Use "compare" function

http://www.xml.com/lpt/a/1263

Regards,

Prateek

Former Member
0 Kudos

Hi Pullaro!

It depends what you want to do with the comparison

E.g. you can use a simple xsl-if Tag to compare a value

and then take action.

If your XML looks like this:

<root>

<child><b>value1</b></child>

<child>value2</child>

</root>

you can make an expression like this and take action on it:

<xsl:if test="<b>//child = 'value1'</b>">

<i>.. Do what you want to do here..</i>

</xsl:if>

With kind regards

Sebastian

Former Member
0 Kudos

Hi Pullarao,

If you have stylus studio installed in your machine then it will directly give you the syntax for the function used for comparison of string.

Try with translate().

Message was edited by:

Shivika Bhorchi