Kunchesm
Jul 25th, 2003, 06:34 AM
hi all,
I have created an xml dom document dynamically from ADO.save option.. and i hav cleaned the unnecesary schema info from that xml dom object by applying this style sheet...
*******************************************
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema">
<xsl: output indent="yes" method="xml" version="1.0" standalone="yes" />
<xsl:template match="/">
<DATA>
<xsl:apply-templates select="xml/rs:data/z:row"/>
</DATA>
</xsl:template>
<xsl:template match="xml/rs:data/z:row">
<ROW>
<xsl:for-each select="@*">
<xsl:element name="{name()}">
<xsl:value-of select="z:row"/>
</xsl:element>
</xsl:for-each>
</ROW>
</xsl:template>
</xsl:stylesheet>
************************************************
but it is giving output as :
************************************************
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<DATA xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
</DATA>
************************************************
But i want the output as :
************************************************
<?xml version="1.0" ?>
<DATA>
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
</DATA>
************************************************
any modification in stylesheet will help??? ... or can i use removeNamedItem to remove the attributes of the parent .. i.e
For the node :
<DATA xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
Can i use...
Element = objXML.documentElement.parentNode;
Atts = Element.attributes;
RemItem = Atts.removeNamedItem("xmlns:dt")
..ThanX for any help!
Rgds
ksm
I have created an xml dom document dynamically from ADO.save option.. and i hav cleaned the unnecesary schema info from that xml dom object by applying this style sheet...
*******************************************
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema">
<xsl: output indent="yes" method="xml" version="1.0" standalone="yes" />
<xsl:template match="/">
<DATA>
<xsl:apply-templates select="xml/rs:data/z:row"/>
</DATA>
</xsl:template>
<xsl:template match="xml/rs:data/z:row">
<ROW>
<xsl:for-each select="@*">
<xsl:element name="{name()}">
<xsl:value-of select="z:row"/>
</xsl:element>
</xsl:for-each>
</ROW>
</xsl:template>
</xsl:stylesheet>
************************************************
but it is giving output as :
************************************************
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<DATA xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
</DATA>
************************************************
But i want the output as :
************************************************
<?xml version="1.0" ?>
<DATA>
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
<ROW>
<COUNTRY_CODE></COUNTRY_CODE>
<COUNTRY_NAME></COUNTRY_NAME>
</ROW>
</DATA>
************************************************
any modification in stylesheet will help??? ... or can i use removeNamedItem to remove the attributes of the parent .. i.e
For the node :
<DATA xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
Can i use...
Element = objXML.documentElement.parentNode;
Atts = Element.attributes;
RemItem = Atts.removeNamedItem("xmlns:dt")
..ThanX for any help!
Rgds
ksm