Modules (was Re: namespaces )

Rick Jelliffe ricko at allette.com.au
Wed Jan 7 06:04:29 GMT 1998


 
> From: james anderson <mecom-gmbh at mixx.de>

> i had found two proposals at the time i was implementing namespaces, the
> implementation is closest to the one which i can attribute only to "microsoft"
> (my copy has no authorship noted) and which dates from 21.10.97.
> we use the pi-form from the microsoft proposal to denote the creationof the
> specified package and to load the specified dtd into that package.

You may also be interested in the "Module" proposals, which were suggested for
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 )* >
		%one;
	">
	%one;
	%two;
]>
<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>
</y>

These merely provide a directory system to resolve names, they
don't attempt to provide any schema solution (that is a separate
problem). Because parameter entities can contain other PEs,
the module prefixes can concatenate (e.g., two::one::x above).

(In the SGML proposals, there is actually a special keyword MODULE
put as part of the parameter entity declaration, to flag that the
PE is also a module, but this is not required.)

Rick Jelliffe



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;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list