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

Re: Unwanted (default) namespaces.

Subject: Re: Unwanted (default) namespaces.
From: "David N Bertoni/Cambridge/IBM" <david_n_bertoni@xxxxxxxxxx>
Date: Mon, 8 Jul 2002 17:10:58 -0700
default namespace subtree
> You're right; that's how I was propogating the <html:br/> tag forward.  I
> have to confess that namespaces are the one area of XSL (I'm currently
> aware of) that I really don't have a handle on, so if you don't mind, I'd
> like to "kick the dead horse" a bit.
>
> In the source XML document, the <html:br/> tag is completely qualified.
> Why is the choice being made to associate an additional (the default)
> namespace with this node?  This seems like it will cause problems in
> environments in which components from multiple namespaces are being
> integrated.   Does this mean we shouldn't define default namespaces in
> situations involving multiple namespaces?  I don't understand why that
> node is being associated with a namespace other than what it was
> explicitly referenced by.   Could you describe what aspect/rule
> associated with the XSL transformation causes this additional namespace
> to be associated with that node?

It's not a "choice," and it's not additional.  If a namespace is in scope,
it's in scope.  Hopefully, you'll agree that if I declare a namespace bound
to a particular prefix, that namespace is in scope in that subtree:

   <foo:bar xmlns:foo="http://foo.com">
     <foo:bar/>
   </bar>

The default namespace is no different (other than in does not apply to
attributes):

   <bar xmlns="http://foo.com">
     <foo2:bar xmlns:foo2="http://foo2.com"> <!--  The default namespace,
   "http://foo.com", is in scope here -->
       <bar/>  <!--  In the namespace "http://foo.com" -->
     </foo2:bar>
   </bar>

That being the case, the XSLT recommendation requires that when you copy a
node, all the in-scope namespace nodes be copied to the result tree.

You need to understand the XPath data model.  The particulars regarding
namespace nodes are here:

   http://www.w3.org/TR/xpath#namespace-nodes

The particulars for xsl:copy are here:

   http://www.w3.org/TR/xslt#copying

Hope that helps...

Dave



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.