|
From: | Bill Denney |
Subject: | Re: C++ version of regexprep.cc |
Date: | Thu, 4 May 2006 13:58:07 -0400 (EDT) |
On Thu, 4 May 2006, Andy Adler wrote:
On Thu, 4 May 2006, Bill Denney wrote:I personally think that elements should have a namespace associated with it only if it's different than the parent. Then it is simple to climb the tree to see your particular namespace.That is a good idea. However, I'm not sure if this matches the XML spec. XML namespaces provide a default namespace for the document for all unspecified tags, not for those that differ from the parent (correct me if I'm wrong).
I don't think that's the case. The general format of a document is that you can change the default namespace or use a specific namespace for a specific element.
For example: <doc xmlns="http://my.namespace/uri" xmlns:his="http://his.namespace/uri"> <mine xmlns="http://other.namespace/uri"> <data/> </mine> <yours> <data/> </yours> <his:data/> </doc>The <data/> that is within mine falls into the namespace "http://other.namespace/uri" because the default namespace was changed for all sub-elements under <mine>. The <data/> under yours falls into the namespace "http://my.namespace/uri", and the his: in <his:data> indicates that that data element falls into the namespace "http://his.namespace/uri". So the default namespace can be changed for the tree under any leaf.
Bill -- "No, no, you're not thinking, you're just being logical." -- Niels Bohr
[Prev in Thread] | Current Thread | [Next in Thread] |