[XML-SIG] [Q] Namespace
Sun, 22 Nov 98 06:10:25 JST
Lars Marius Garshol <email@example.com> writes:
| * Tamito Kajiyama
| | First, according to the specification (Subsection 5.2), "If the URI
| | in a default namespace declaration is empty, then unprefixed
| | elements in the scope of the declaration are not considered to be in
| | any namespace." I cannot understand what this means. What should a
| | parser do on such unprefixed elements? Really nothing to do?
| This is used for turning off a default namespace:
| <root xmlns="http://default.namespace.uri/">
| <foo/> <!-- The expanded name is here ns='http://default.namespace.uri/'
| and type='foo' -->
| <bar xmlns=""/> <!-- The expanded name is here ns="" and type="bar -->
What should a validating parser do on the unprefixed element `bar'?
| | Second, what is the initial value of the default namespace before
| | the first declaration of the default namespace appears? Is the
| | default namespace undefined at first?
| So it is. The namespace is not defined until an explicit declaration
| appears, which is entirely reasonable to me, at least.
When the default namespace is undefined, what should a validating parser
do for unprefixed elements?
| | I think it is reasonable that the namespace associated to the DTD of
| | the XML document, if any, would be the first default namespace.
| What do you mean by this? I can't follow you here.
I understand that a namespace has an associated schema (e.g. DTD, RDF
schema), and a parser validates a prefixed element by referring the
schema associated to the namespace prefix. So, If an XML document has
its DTD specified by <!DOCTYPE ...>, there is a namespace associated to
the DTD. Is my understanding correct?
KAJIYAMA, Tamito <firstname.lastname@example.org>