Changing One Tag Name in an XML File Using XSLT
- by AlbertoPL
Is it possible for me to have a conditional in XSLT such that I find and replace only the FIRST tag of a particular tag name?
For example, I have an XML file with many tags. I would like to replace the first of these tags with . The rest should be left alone. How would I do this in my transform? What I currently have is this:
<xsl:template match="title">
<PageTitle>
<xsl:apply-templates />
</PageTitle>
</xsl:template>
which finds all tags and replaces them with PageTitle. Any help would be greatly appreciated!