|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Unwanted (default) namespaces.
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








