• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 107
  • Last Modified:

replace tag of the xml by reading on of the tag value

Hi ,

i am trying to change one of the xml tags <MA> to <MAP> by reading the value of some other tag in the same parent node, here i am reading "Approval/HA " value and change the tag , but its only working if  Approval/HA ='D' is true , its not working for other conditions. can somebody let me know if the "or" condition should be the way as below or is different.

Thanks for the help.

<xsl:template match="Details/MA">
 <xsl:variable name="ename">
<xsl:if test="Approval/HA ='D' or Approval/HA= 'T' or  Approval/HA= 'C'">
 <xsl:element name="{$ename}"> <xsl:copy-of select="@*"/>
 <xsl:apply-templates select="node()"/>
1 Solution
Geert BormansInformation ArchitectCommented:
It always helps if you posted an example XML.
I created one myself


Open in new window

With this XML your code simply works

and yes, that is the way to do "or"
sri1209Author Commented:
Thanks Geert, i realized i was testing the wrong way, thanks for your help. as always it works.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now