Notations, subschemas, entities

John Cowan cowan at locke.ccil.org
Thu Jun 4 21:55:30 BST 1998


Toby Speight wrote:

> I can't remember (nor find easily in the spec) whether notations must
> be declared before use.

There seems to be no such requirement.  The VC simply says:
"Values of this type [i.e., notation] must match one of the notation
names included in the declaration; all notation names in the
declaration must be declared."

> John> Indeed, I'm thinking that XSchemas should have structure, ...
> 
> Sorry, you lost me with this paragraph. Can you illustrate it with an
> example?

In other words:

	<DOCTYPE root="blah">
	 <DOCTYPE>
           <ELEMENT id="blah"> ... </ELEMENT>
	   <ELEMENT id="bazz"> ... </ELEMENT>
	   <NOTATION id="foo"> ... </ELEMENT>
	 </DOCTYPE>
	 <DOCTYPE>
	   <ELEMENT id="zim"> ... </ELEMENT>
	   <DOCTYPE>
	    <ENTITY ...> ... </ENTITY>
	    <ENTITY ...> ... </ENTITY>
	   <ELEMENT id="zam"> ... </ELEMENT>
	 </DOCTYPE>
	</DOCTYPE>

In one sense it would be better to have a separate element for
grouping declarations, but using the same element for both
root and subordinate allows direct incorporation of XSchemas
into other XSchemas either by cut-and-paste or by external
text entities, as I mentioned before.

> I'm not keen on arbitrary markup, because I'm interested in processing the
> documentation with DSSSL to give a pretty-printed human-readable document
> to go with the DTD. It's hard to do that if you don't know what elements
> to expect.

Out of my depth.

> And, as I mentioned, we'll want some XSchema-specific elements
> to refer to ELEMENT definitions (for example).

XLink can do that using "#elementname", but that may not be the
Right Thing.

My concern is that we will bloat the simple XSchema DTD with
elements for marking up fancy text.  If we were going to do that,
we'd need a subschema (see above!) that handled just the bare bones
of fancy text, preferably in an HTML-compatible way.

(I do happen to have such a thing in my back pocket....)

> <!ELEMENT EXTERNAL-ENTITY (DOC)>
> <!ATTLIST EXTERNAL-ENTITY
> %external;
> notation CDATA #IMPLIED>
> <!ELEMENT INTERNAL-ENTITY (DOC)>
> <!ATTLIST INTERNAL-ENTITY
> value CDATA #REQUIRED>

Using an attribute value to hold the definition of an internal
entity involves processing out all markup characters (&, <, ', "),
thus:

<!ENTITY yutz 'I use &int-entity; and refer to "&ext-entity;"'>

would come out as

<INTERNAL-ENTITY value="I use &amp;int-entity; and refer to &quot;&amp;ext-entity;&quot;"/>

whereas

<INTERNAL-ENTITY><![CDATA[I use &int-entity, and refer to "&ext-entity"]]></INTERNAL-ENTITY>

is far more readable and writable.

The spec should say that the content of an ENTITY element should be
wrapped in a CDATA marked section.

-- 
John Cowan	http://www.ccil.org/~cowan		cowan at ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

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