Modules (was Re: namespaces )
peter at ursus.demon.co.uk
Wed Jan 7 15:31:55 GMT 1998
At 17:05 07/01/98 +1100, Rick Jelliffe wrote:
>You may also be interested in the "Module" proposals, which were suggested
>inclusion into SGML. The idea started in Japan and has floated around getting
>firmer and simpler over the last year of XML discussions.
>The idea is simply to use any parameter entity name as a module prefix.
>So you could have, for example (though presumably it would use external
>parameter entities, not internal like in this example)
><!DOCTYPE y [
> <!ENTITY % one "
> <!ELEMENT x (#PCDATA)>
> <!ENTITY % two "
> <!ELEMENT x ( #PCDATA | y )* >
> <x>This is the element type declared in PE "one", as expected.</x>
> <one::x>This is also the element type declared in PE "one".</one::x>
> <two::x>This is the element type declared in PE "two".<y/></two::x>
> <two::one::x>This is the element type declared in "one".</two::one::x>
[Please shoot this down if I have missed something...]
I think that newcomers to XML may read more magic processing into this than
exists. In the example given, an XML parser will see TWO declared
elementTypes (x and y). There is no declaration of one::x, two::x,
two::one::x. Indeed if the document were given to a validating parser this
would presumably report that "one::x has not been declared".
An XML parser on seeing <one::x> simply sees it as a 6 character
elementType. It has no mechanism for relating it to <x>. So IMO the second
sentence is not correct, *for the XML parser* - they are two different
beasts. Note in particular that XML does not allow substitution within the
start tag in the document.
Unless the XML parsers passes the PE information to the application, the
app has no way of knowing that <x> and <one::x> are semantically linked. A
common mechanism for this mapping - architectural forms (AFs) - is not
currently part of the XML or X*L specs.
If I have this right, it's important to realise that parsers have nothing
to do with namespaces, and that any namespace handling is application
dependent. If the WG or others come up with namespace proposals, I would
expect them to be implemented elsewhere than the parser.
Peter Murray-Rust, Director Virtual School of Molecular Sciences, domestic
VSMS http://www.nottingham.ac.uk/vsms, Virtual Hyperglossary
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev