Results 1 to 3 of 3

Thread: XML - Stylesheets - for removing schema info

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342

    XML - Stylesheets - for removing schema info

    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
    Last edited by Kunchesm; Jul 25th, 2003 at 11:21 AM.
    ksm

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342

    Urgent!!!!!!!!

    Anyone plz.....
    ksm

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    Using the "exclude-result-prefixes" atribute of xslutput will give required output..

    <xsl:stylesheet exclude-result-prefixes="dt rs z" >
    ksm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width