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

Re: Namespace getting carried over to output XML

Subject: Re: Namespace getting carried over to output XML
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 11 Jul 2006 22:51:52 +0200
Re:  Namespace getting carried over to output XML
Prashanth T S wrote:
Hi,
    I tried to apply a xsl on a xhtml document and once it passes
through the xsl, I am getting the namespace carried over to my output
xhtml document in places unnecessary. Below is an example.

I have given the following line when I start my XSL

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform "
xmlns:xhtml="http://www.w3.org/1999/xhtml " xmlns="
http://www.w3.org/1999/xhtml" xmlns:abc="abctest"
exclude-result-prefixes="abc">

In the exclude-result-prefixes you should provide the prefixes you *don't* want to have in the result, rather then prefixes bound to namespaces you actually use in the result. Try something like

 <xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:xhtml="http://www.w3.org/1999/xhtml"
 xmlns="http://www.w3.org/1999/xhtml"
 xmlns:abc="abctest"
 exclude-result-prefixes="xhtml">
                          ^^^^^

You should also avoid binding the default namespace if possible.

J.Pietschmann

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.