Empty Tags

Per-Ake Ling Per-Ake.Ling at uab.ericsson.se
Tue Jan 27 05:26:50 GMT 1998


> From wendling at ganymede.isdn.uiuc.edu Tue Jan 27 03:20:37 1998
...[snip]
> Is there a way in XML to make a tag conditionally empty?  That is, if you
> have this declaration:
> 
> <!ELEMENT syntax - - (attr)*>
> <!ATTLIST syntax TYPE (brief | full) brief>
> <!ATTLIST syntax ATTRSET CDATA #IMPLIED>
> 
> if the attrset attribute of syntax has a value, could the user type it as:
> 
> <syntax attrset="foo"/>
> 
> instead of
> 
> <syntax attrset="foo">
> </syntax>
...[snip]

There is an excellent way of doing it in SGML, but no way of doing it
in XML (other than having a well-formed document with no DTD).

In SGML:

<!ATTLIST syntax ATTRSET CDATA #CONREF>

will give you the behaviour you ask for, but this feature was one of the
"bothersome" ones that where removed from XML. Our own DTDs unfortunately
rely on CONREF and it will take some thought to rewrite them in a
sensible manner without compromising the documents too much.

CONREF is one of the features I miss most in XML.

Per-Åke
--
Per-Åke Ling	(note: Per-&Aring;ke, transliteration Per-Ake)
email:	Per-Ake.Ling at uab.ericsson.se	phone:  +46  8 727 5674
Ericsson Utvecklings AB			mobile: +46 70 790 2446
AXE Research and Development		fax:	+46  8 727 3463

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