I would like to change the value of RequestQueue elemt under “@sorregion name[.=’default’]” to “DEFAULT.REQUEST. I tried using the below identity template. Could anyone please help me with this dentity template. I would like to use identity template, only.
My xsl file
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@name[.='default']/QueueDetails/RequestQueue">
<xsl:value-of select="'DEFAULT.REQUEST'"/>
</xsl:template>
</xsl:stylesheet>
My input xml
How I would approach this question is the same way that @Kirill Polishchuk did (+1 btw) and that is to override the identity transform only for the node that needs to change.
However, in your question you stated “I would like to use identity template, only.“. If this is truly the case and you only want one template, you can do it like this:
I would be curious to know though why you would want to use the identity transform template only. If you end up needing to modify more than just
RequestQueue, it’s going to get ugly fast.