Re: Namespace well-formed external parsed entities?

Grosso, Paul writes:

> the namespace declaration must be in the entity itself or can
> be "inherited" from the "load environment" (in a fashion somewhat
> similar to what the XPointer xmlns() scheme allows one to do
> for xpointers).

I see nothing in the XML spec. which suggests that external entities
have to be self-contained.  In particular, as far as I can see the
following is entirely OK:

foo.xml:
<!DOCTYPE foo [
<!ENTITY a SYSTEM "a.ent">
<!ENTITY foo "foo">
]>
<foo>&a;</foo>

a.ent:
<a>&foo;</a>

If that's true, then by analogy the following is also OK

foo.xml:
<!DOCTYPE foo [
<!ENTITY a SYSTEM "a.ent">
<!ENTITY foo "foo">
]>
<foo xmlns:p="p">&a;</foo>

a.ent:
<a><p:b/></a>

But, this raises the question of what the point of the proposed
function is -- if its goal is to yield a (sequence of) document nodes,
then either 

 a) Not all XML-usable/XML-namespace-usable* external entities can be
    loaded;
or

 b) Namespace fixup may be required, presumably using XQuery-defined
    namespaces which are in scope.

*A 'document' is XML(-namespace)-usable if there exist well-formed XML
documents which (sc. successfully) include it as an external entity.

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

Received on Wednesday, 19 October 2011 07:36:22 UTC