xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Watts, Tim T" <timothy.wa...@bankofamerica.com>
Subject RE: Namespaces inherited?
Date Thu, 13 Mar 2003 19:44:26 GMT
Ok, thanks. I'll sleep much better tonight!

-----Original Message-----
From: neilg@ca.ibm.com [mailto:neilg@ca.ibm.com]
Sent: Thursday, March 13, 2003 2:33 PM
To: general@xml.apache.org
Subject: Re: Namespaces inherited?


Hi Tim,

A general XML development list would probably be a better place to discuss
issues like this than this list--whose primary purpose is to discuss issues
common to multiple xml.apache.org projects...

Anyway:  No, the two examples are certainly not semantically equivalent.
It is true that descendant are in the scope of namespace prefixes declared
by their ancestors.  But the first elemB doesn't actually use the namespace
prefix declared in its parent, so it isn't in that namespace; the second
does, therefore it is in the same namespace as the parent.

Hope that helps,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  neilg@ca.ibm.com




|---------+--------------------------------->
|         |           "Watts, Tim T"        |
|         |           <timothy.watts@bankofa|
|         |           merica.com>           |
|         |                                 |
|         |           03/13/2003 02:21 PM   |
|         |           Please respond to     |
|         |           general               |
|         |                                 |
|---------+--------------------------------->
  >---------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                                                      |
  |       To:       general@xml.apache.org                                               
                                                      |
  |       cc:                                                                            
                                                      |
  |       Subject:  Namespaces inherited?                                                
                                                      |
  |                                                                                      
                                                      |
  |                                                                                      
                                                      |
  >---------------------------------------------------------------------------------------------------------------------------------------------|



Hello,

I read that child elements "inherit" the namespace of their parent by
default ("Professional Java SOAP", p30, Wrox Press). The W3C spec says that
they're in scope for all children. But that's not the same as inheriting.
To my understanding, "inheriting" would mean that the children
automatically become members of the parent's namespace unless explicitly
overridden while "in scope" means that the namespace is merely *available*
to the children.

According to the book, the following examples are semantically equivalent:

<ns:elemA xmlns:ns="urn:myNS">
  <elemB/> <!-- this elem would implicitly be in the 'ns' namespace -->
</ns:elemA>

<ns:elemA xmlns:ns="urn:myNS">
  <ns:elemB/>
</ns:elemA>

I don't think this is correct but I would like to hear from more
knowledgable sources. The behavior of the Xerces implementation of DOM does
not conform to the above.

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org





---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message