Entities and namespaces in XSchemata

Toby Speight tms at ansa.co.uk
Mon Jun 1 12:08:30 BST 1998

Peter> Peter Murray-Rust <URL:mailto:peter at ursus.demon.co.uk>

=> In article < at pop3.demon.co.uk>,
=> Peter wrote:

Peter> I am not an XML/SGML theorist, but it seems to me that anything
Peter> that PEs can do for DTDs can be mirrored by entities in
Peter> XSchemata. This extends to content specs, and - this could be
Peter> exciting - namespaces. Watch:
Peter> <!DOCTYPE XSchema SYSTEM "xschema.dtd" [
Peter>   <!ENTITY cml "CML:">
Peter> ]>
Peter> <ElementType id="&cml:mol">
Peter>  <ContentSpec>
Peter>     <Seq optional="no" repeatable="no">
Peter>       <ElementType>&cml;atoms</ElementType>
Peter>     </Seq>
Peter>     <Seq optional="yes" repeatable="no">
Peter>       <ElementType>&cml;bonds</ElementType>
Peter>     </Seq>
Peter>  </ContentSpec>
Peter> </ElementType>

Wouldn't limit one's ability to constrain (e.g.) GIs to reasonable
values.  I envisioned <ElementType Name="mol">, where the attribute
"Name" was constrained to be a NMTOKEN, to mirror the constraint in
ordinary XML DTD language.  Am I mistaken in thinking that entities
are not expanded in NMTOKEN values?

OTOH, I'd be happy with asking a XSchema -> DTD transformer to add or
change namespace prefixes as part of the translation process.

[BTW, your use of <Seq optional="no" repeatable="no"> implies either
assumption of the WebTC or not constraining the values to a token group.
I'd go for <Seq optional="required" repeatable="not-repeatable"> in the
traditional idiom.  Or maybe use minimum/maximum occurance specifiers.]


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