[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How to remove "xmlns" attribute when calling a named

Subject: How to remove "xmlns" attribute when calling a named template
From: "Chaudhary, Harsh" <HCHAUDHA@xxxxxxxxx>
Date: Tue, 12 Jun 2007 13:14:05 -0500
 How to remove "xmlns" attribute when calling a named
Hi all,

I am calling a named template in my XSL file. It works well except for
that there always appears an xmlns="" attribute in the output. Here are
my snippets:

XSL file:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

    <xsl:template name="testTemplate">

        <test>This is a test</test>

    </xsl:template>
    <xsl:template match="/">


        <request
            xmlns="somexmlns"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.amfam.com/xsd/message/rateprocessingservi
ce/v3/somexsd.xsd">

            <xsl:call-template name="testTemplate"/>
</request>
</xsl:template>
</xsl:stylesheet>

OUTPUT:

  <?xml version="1.0" encoding="UTF-8" ?>
- <request
xmlns="http://www.amfam.com/xsd/message/rateprocessingservice/v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.amfam.com/xsd/message/rateprocessingservi
ce/v3/RPSRequest.xsd">
  <test xmlns="">This is a test</test>
  </request>

I would like to remove the xmlns attribute from the <test> element.
Would really appreciate some help on this.

Thanks,
Harsh.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.