Rename tag in XML using XSLT -


i have xml below:

<?xml version="1.0" encoding="utf-8" standalone="no"?> <properties> <entry key="user">1234</entry> <entry key="name">sam</entry> </properties> 

i want modify key value(key="user" key="id") using xslt, output xml should this

<?xml version="1.0" encoding="utf-8" standalone="no"?> <properties> <entry key="id">1234</entry> <entry key="call">sam</entry> </properties> 

could please me this? new xslt area.

for have first transform identity transform handle key:

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0">     <xsl:template match="node()|@*">         <xsl:copy>             <xsl:apply-templates select="node()|@*"></xsl:apply-templates>         </xsl:copy>     </xsl:template>      <xsl:template match="@key[. = 'user']">         <xsl:attribute name="key">id</xsl:attribute>     </xsl:template> </xsl:stylesheet> 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -