J
John L. Clark
I am curious as to the rationale, and effect, of having default
namespaces not applying (directly) to attributes (see
http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute
without a namespace prefix, what is its namespace, if default
namespaces do not apply? Are (either of) prefixed or non-prefixed
attributes correct? For example, are the following equivalent:
<html:br class="foo" xmlns:html="http://www.w3.org/1999/xhtml"/>
and
<html:br html:class="foo"
xmlns:html="http://www.w3.org/1999/xhtml"/>
If so, why? In the former, the class has no (or an empty?) namespace,
while in the latter the class explicitly has the html namespace.
Why would it make sense for attributes to not inherit namespaces as do
elements? What does the specification mean when it says that default
namespaces do not apply /directly/ to attributes?
While I'm on the topic of namespaces, another little thing has been
gnawing at the back of my brain. How can you determine when an
included, namespace-scoped subtree is allowed to be included into the
parent? For example:
<html:html xmlns:html="http://www.w3.org/1999/xhtml"
xmlnsther="http://some.other.namespace/">
<!--Other elements to make the xhtml file valid can be put
here...-->
<other:foo/>
</html:html>
Now, obviously schemas corresponding to the html namespace have no
knowledge of the "other" namespace, and so "other" elements shouldn't
be allowed to arbitrarily populate an "html" tree. Where in the
specifications is this sort of thing discussed? Are subtrees of one
namespace invisible to the parent tree of a different namespace?
Ok, true, this should really have been broken up into two threads, but
I was on a roll, so I felt like just cruisin' through them both.
Take care,
John
--
Please note that you have no evidence that this message was sent by me
<[email protected]>, as it is not digitally signed. If you need to
validate the authenticity of this message, do not hesitate to request
a receipt by responding to this message with the original included.
namespaces not applying (directly) to attributes (see
http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute
without a namespace prefix, what is its namespace, if default
namespaces do not apply? Are (either of) prefixed or non-prefixed
attributes correct? For example, are the following equivalent:
<html:br class="foo" xmlns:html="http://www.w3.org/1999/xhtml"/>
and
<html:br html:class="foo"
xmlns:html="http://www.w3.org/1999/xhtml"/>
If so, why? In the former, the class has no (or an empty?) namespace,
while in the latter the class explicitly has the html namespace.
Why would it make sense for attributes to not inherit namespaces as do
elements? What does the specification mean when it says that default
namespaces do not apply /directly/ to attributes?
While I'm on the topic of namespaces, another little thing has been
gnawing at the back of my brain. How can you determine when an
included, namespace-scoped subtree is allowed to be included into the
parent? For example:
<html:html xmlns:html="http://www.w3.org/1999/xhtml"
xmlnsther="http://some.other.namespace/">
<!--Other elements to make the xhtml file valid can be put
here...-->
<other:foo/>
</html:html>
Now, obviously schemas corresponding to the html namespace have no
knowledge of the "other" namespace, and so "other" elements shouldn't
be allowed to arbitrarily populate an "html" tree. Where in the
specifications is this sort of thing discussed? Are subtrees of one
namespace invisible to the parent tree of a different namespace?
Ok, true, this should really have been broken up into two threads, but
I was on a roll, so I felt like just cruisin' through them both.
Take care,
John
--
Please note that you have no evidence that this message was sent by me
<[email protected]>, as it is not digitally signed. If you need to
validate the authenticity of this message, do not hesitate to request
a receipt by responding to this message with the original included.