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

Re: Saxon output unused namespace declarations

Subject: Re: Saxon output unused namespace declarations
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Thu, 23 Jul 2009 11:22:52 +0200
Re:  Saxon output unused namespace declarations
Weihua JIANG schrieb:

I am wondering why the namespace declaration for xmlns:xs is
outputted. This namespace declaration is not used by the out element.
So, from my opinion, to make the output as simple as possible, the
XSLT 2.0 processor shall not output such declaration.

Yes, but the namespace is present in the instruction tree (the XSL document), so it is copied to the output - who knows in what weird way the (XML) output might need the namespaces to be present? Imagine the output is something like:

  <Constraint type="xs:decimal"/>
  <Constraint>xs:decimal</Constraint>

The QName may not appear in markup, but it appears in element or
attribute content; so it is okay for the XML parser if there is no
namespace declaration - but it might not be okay for the application
processing that document.

Take XSLT and XSD as examples of XML applications that use QNames in
content.

If you don't want the NS declaration in the output, use:

<xsl:stylesheet exclude-result-prefixes="xs bla blub" ...>

Michael Ludwig

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.