the xmlns: attribute is actually a namespace.
Declare a namespace in your stylesheet tag, eg add: xmlns:nms="http://www.blah/blah"
Everywhere you reference the node, use the namespace, eg as examples,
<xsl:template match="nms:root">,
<xsl:value-of select="nms:subelem"/>, and
<xsl:apply-templates select="nms:element1"/>
One sample template:
<xsl:template match"nms:element1">
<newElem1>
<xsl:apply-templates/>
</newElem1>
</xsl:template>
jkmyoung, I really appreciate your help.I tried your suggestion,but I still cant get what I want. I dont know what I'm doing wrong.here's the stylesheet and it's transformation
<?xml version="1.0"?>
<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:m="http://www.blah/blah">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match ="/">
<new_root xmlns:lm="http://iou.cm">
<xsl:apply-templates/></new_root>
</xsl:template>
<xsl:template match ="m:element1">
<newElem1><xsl:value-of select="m:NewSub1"/></newElem1>
</xsl:template>
</xsl:stylesheet>
here's the output:
<?xml version="1.0" encoding="UTF-16" ?>
<new_root xmlns:m="http://www.blah/blah xmlns:lm="http://iou.cm">
<newElem1>hello</newElem1>
</new_root>
How can I remove xmlns:m ="http://www.blah/blah namespace ?
I dont want it to appear in there