Discussion:
How to remove dt:dt="string"
(too old to reply)
Alamelu
2006-11-16 11:46:02 UTC
Permalink
How to remove dt:dt="string" from the below xml in the respective nodes? What
API must be used

<?xml version="1.0"?>
<Root xmlns:dt="urn:schemas-microsoft-com:datatypes" Version="1">
<VERSION dt:dt="string">Default</VERSION>
<NO dt:dt="string">Default</NO>
<SERIA dt:dt="string">Default</SERIAL>
<TIME dt:dt="dateTime">2006-10-30T16:57:32</TIME>
</Root>

Is it a attribute or something else?

Regards,
Alamelu N
Martin Honnen
2006-11-16 13:14:40 UTC
Permalink
Post by Alamelu
How to remove dt:dt="string" from the below xml in the respective nodes? What
API must be used
<?xml version="1.0"?>
<Root xmlns:dt="urn:schemas-microsoft-com:datatypes" Version="1">
<VERSION dt:dt="string">Default</VERSION>
<NO dt:dt="string">Default</NO>
<SERIA dt:dt="string">Default</SERIAL>
<TIME dt:dt="dateTime">2006-10-30T16:57:32</TIME>
</Root>
Is it a attribute or something else?
dt:dt is an attribute (used by older Microsoft implementations to denote
the _d_ata_t_type), removing attributes if possible with the DOM or with
XSLT e.g.

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
exclude-result-prefixes="dt"
version="1.0">

<xsl:output method="xml"/>

<xsl:template match="@dt:*"/>

<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

removes all attributes in the namespace urn:schemas-microsoft-com:datatypes.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...