Subject: RE: Supress namespace auto-ns1
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 12 Jan 2006 08:48:15 -0000
|
I don't know why the auto-ns1 namespace is being output. I think it's a
problem with your particular XSLT processor. You haven't said which
processor you are using. However, it shouldn't do any harm; and the XSLT 1.0
spec is actually pretty liberal, saying that the serializer is allowed to
add any namespace declarations it feels like.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: jaya vardhani [mailto:jayavardhani@xxxxxxxxxxx]
> Sent: 12 January 2006 05:39
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Supress namespace auto-ns1
>
> Hi Michael,
>
> My XSL is as follows:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns ="http://integration.sapi.com"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> <xsl:strip-space elements="*"/>
> <xsl:output method="xml" indent="yes"
> media-type="text/xml"/>
>
> <xsl:template match="XferInfo">
> <xsl:element name="sAPI">
> <xsl:attribute
> name="xsi:schemalocation">
> <xsl:value-of
> select="'http://integration.sapi.com
> http://localhost/services/schemas/fso/Transfer-1.0.xsd'"/>
> </xsl:attribute>
> <xsl:element name="Request">
> <xsl:attribute
> name="TypeOfRequest">Transfer</xsl:attribute>
> <xsl:attribute name="Echo"><xsl:value-of
> select="'false'"/> </xsl:attribute>
> <TransferRq xmlns="http://fso.sapi.com/2004"
> xmlns:sap="http://integration.sapi.com">
> <xsl:element name="From">
> <Id>00000000000005000011</Id>
> <Info>
> <sap:Id>8888</sap:Id>
> </Info>
> </xsl:element>
> <xsl:element name="To">
> <Id>00000000000005000011</Id>
> <Info>
> <sap:Id>8888</sap:Id>
> </Info>
> </xsl:element>
> </TransferRq>
> </xsl:element>
> </xsl:element>
> </xsl:template>
>
> The output i got after transformation is:
>
> <?xml version="1.0" encoding="UTF-16" ?>
> <sAPI xsi:schemalocation="http://integration.sapi.com
> http://localhost/services/schemas/fso/Transfer-1.0.xsd"
> xmlns="http://integration.sapi.com">
> <Request TypeOfRequest="Transfer" Echo="false">
> <TransferRq
> xmlns:auto-ns1="http://integration.sapi.com"
> xmlns="http://fso.sapi.com/2004"
> xmlns:sap="http://integration.sapi.com">
> <From>
> <Id>00000000000005000011</Id>
> <Info>
> <sap:Id>8888</sap:Id>
> </Info>
> </From>
> <To>
> <Id>00000000000005000011</Id>
> <Info>
> <sap:Id>8888</sap:Id>
> </Info>
> </To>
> </TransferRq>
> </Request>
> </sAPI>
>
> Please let me know how to supress "xmlns:auto-ns1" in
> "TransferRq" element.
>
> Thanks&Regards,
> JayaVardhani M.
>
>
> Send instant messages to your online friends
> http://in.messenger.yahoo.com
|