I have a XML file with namespace in the root element as below.(Other child element i have described in short to save space).
<T0020
xsi:schemaLocation="http://www.safersys.org/namespaces/T0020V1 T0020V1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.safersys.org/namespaces/T0020V1">
<IRP_ACCOUNT> ....<IRP_ACCOUNT>
<IRP_ACCOUNT> ....<IRP_ACCOUNT>
</T0020>
It was huge file so i have applied xslt to split it into multiple file for that my xslt is as below.
Code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.safersys.org/namespaces/T0020V1" version="2.0">
<xsl:output method="xml" indent="yes" name="xml" />
<xsl:variable name="accounts" select="t:T0020/t:IRP_ACCOUNT" />
<xsl:variable name="size" select="30" />
<xsl:template match="/">
<xsl:for-each select="$accounts[position() mod $size = 1]">
<xsl:variable name="filename" select="resolve-uri(concat('output/',position(),'.xml'))" />
<xsl:result-document href="{$filename}" method="xml">
<T0020>
<xsl:for-each select=". | following-sibling::t:IRP_ACCOUNT[position() < $size]">
<xsl:copy-of select="." />
</xsl:for-each>
</T0020>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
When i do Transformation my xml file are coming with name space in <T0020>
and <IRP_ACCOUNT> tag like below...
Code:
<T0020 xmlns:t="http://www.safersys.org/namespaces/T0020V1"><IRP_ACCOUNT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.safersys.org/namespaces/T0020V1">
That was not needed.It should be
Code:
<T0020> <IRP_ACCOUNT></IRP_ACCOUNT><T0020>
when i applied like <t:T0020> in xslt it was same reflected with t prefix in
T0020 tag.
Can you please help me that how to remove name space from this tag ?
Thanks in Advance.