XML & SGML

Conleth O'Connell cso at vignette.com
Wed May 6 23:21:59 BST 1998


Lars Marius Garshol writes:
 > W. Eliot Kimber wrote:
 > > 
 > > The inability to use parameter entities inside of declarations is the
 > > problem--unless I've misunderstood the restriction.
 > 
 > You have. (Thankfully. Reassuring to see that you can be wrong about
 > something. :)
 > 
 > <!ELEMENT foo (%bar;)>
 > 
 > is entirely valid in the external subset, but not in the internal. This
 > is the relevant part of the spec (from section 2.8):
 > 
 > "Well-Formedness Constraint: PEs in Internal Subset
 > 
 >           In the internal DTD subset, parameter-entity references can 
 >           occur only where markup declarations can occur, not within 
 >           markup declarations. (This does not apply to references that 
 >           occur in external parameter entities or to the external 
 >           subset.)"
 > 
 > I still haven't found a sensible way to implement this in the external
 > subsets, though. :-(

It depends on your intent, but you may have use yet another level of
indirection.

Let's say I have DTD foo located at http://mycom.com/f.dtd

<!ENTITY % bar "baz | car">
<!ELEMENT foo (%bar;)>

The XML instance might look like:

<!DOCTYPE foo SYSTEM "http://mycom.com/f.dtd" [
<!ENTITY % bar "baz | car | xyzzy">
]>

<foo><xyzzy/></foo>

This is valid because the internal subset entity declaration is resolved
before the entity declaraition in the external subset.

The area I got tripped up was in the Attribute declarations:
 - only one element can be declared in each ATTLIST
 - it is more difficult to declare and use common attributes

This requires an intervening external subset to declare and use the
entities.  Too many years on DocBook I guess |-)

Cheers,
Con

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