[xsl] Namespace Problem

Subject: [xsl] Namespace Problem
From: jaya vardhani <jayavardhani@xxxxxxxxxxx>
Date: Wed, 28 Sep 2005 06:20:30 +0100 (BST)
Hi,
   
Could anyone help me out by giving a solution for the
following problem?
 
I am using XSLT to transform to a xml document. The
following is my xsl code snippet:
 
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"; 
     xmlns=" http://integration.api.com";  xmlns:xenc="
http://www.w3.org/2001/04/xmlenc#"; 
     xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
exclude-result-prefixes="fiHeader">
 
<xsl:import href="../Header.xsl"/>
 
<xsl:template match="selectrequest">
            <xsl:element name="fiAPI">
                <xsl:attribute
name="xsi:schemaLocation"> http://integration.api.com
DocumentInquiry.xsd</xsl:attribute>
                <!-- fiHeader -->
                <xsl:call-template name="header"/>
                <!-- Request --> 
                <xsl:element name="Request">
                    <xsl:call-template
name="DateClassType"/>
                    <xsl:call-template name="select"/>
                    <xsl:call-template
name="buildReqMetaData"/> 
                </xsl:element>
            </xsl:element>
        </xsl:template> 
</xsl:template>
 
The xsl also includes the definitions for all
templates except the "header" template which is called
from other xsl.
 
The output xml is as follows:
 
<fiAPI xmlns="http://integration.api.com"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xmlns:xenc=" http://www.w3.org/2001/04/xmlenc #"
xsi:schemaLocation=" http://integration.api.com
DocumentInquiry.xsd">
<fiHeader xmlns="" Version=" 2.0 ">
   .....
   .....
</fiHeader>
<Service Version="1.0" Name="ServArchiveAccessAPI"/>
<Request TypeOfRequest="DocumentInquiryRq"
RequestID="123" Echo="0">
             <Date>2005-09-20</Date>
             <Class>Check</Class>
             <Type>GetImage</Type> 
             <Condition>
                      <Detail>SerNum</Detail>
                      <Operator>EQ</Operator>
                      <Value>45445</Value>
              </Condition> 
...
...
</Request>
</fiAPI>
 
                   In the output xml's fiHeader
element i am getting one extra attribute xmlns.This
header is formed by calling a template from another
xsl.
If i include the namespace declaration in <xsl:element
name="fiAPI"> i am getting that xmlns attribute in all
the elements that are formed by calling templates.
I have tried various options with
exclude-result-prefixes but to no avail.
 
Thanking you in anticipation,
Jaya Vardhani M.




		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

Current Thread