How to add new attributes to a tag in XML file using XSLT? [duplicate]
Possible Duplicate:
Add an attribute with static value with xslt
I have an XML file which I need to modify.
For example: Say my XML has a form tag<FORM name=""></FORM>
Now say I want to put some extra info to this tag like frame="frmName" frameby="name"
Expected result of running batch file OR some XSLT
<FORM name="" frame=开发者_如何学编程"frmName" frameby="name" ></FORM>
How can I do it using batch file?
I am just a beginner so please try to be simple.Thank you allHave you considered using XSLT to modify the XML, as further explained here
EDIT
xlst solution
<xsl:template match="FORM">
<xsl:copy>
<xsl:attribute name="name">frmName</xsl:attribute>
<xsl:apply-templates select="node()|@*/>
</xsl:copy>
</xsl:template>
精彩评论