How to remove xmlns attribute from the transformed file using XSLT?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Here is my input xml:
<profile xmlns:a=" http://myuri.org/ http://myuri.org
<bikes>
<a:bike>Bike1 </a:bike>
<a:bike>Bike2 </a:bike>
<a:bike>Bike3 </a:bike>
<a:bike>Bike4 </a:bike>
<a:bike>Bike5 </a:bike>
</bikes>
</profile>
And heres my xslt to generate output xml:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a=" http://myuri.org http://myuri.org " version="1.0
<xsl:template match="bikes
<Rule propName="Bike
<SupportedRange lower="{substring-after(normalize-space(a:bike[1]), Bike)}"
higher="{substring-after(normalize-space(a:bike[last()]), Bike)}"/>
</Rule>
</xsl:template>
</xsl:stylesheet>
Heres the output I get from the XSLT transformation:
<Rule propName="Bike" xmlns:a=" http://myuri.org/ http://myuri.org
<SupportedRange lower="1" Higher="5"/>
</Rule>
But, heres my desired output xml:
<Rule propName="Bike
<SupportedRange lower="1" Higher="5"/>
</Rule>
Since my output doesnt really have anything related to the xmlns (" http://myuri.org http://myuri.org ") in the input xml, I dont want it to be visible in my output.
Is there anyway we can do this?
Thanks and Regards,
krishna

View the full article
 
Back
Top