[Home] [By Thread] [By Date] [Recent Entries]

  • From: Rick JELLIFFE <ricko@g...>
  • Date: Wed, 02 Aug 2000 02:21:04 +0800

Kay Michael wrote:
> 
> > Does anyone know if (and how) I can have one element contain itself?
> 
> No, you can't, but you can have one element contain another element of the
> same name, e.g.
> <section><section></section></section>
 
In SGML you could, potentially.  (I hope ISO 8879 said this is an error
:-)

Given the declaration
 <!ATTLIST x
     id ID #IMPLIED
     refid IDREF #CONREF >
you could attempt
  
 <x  id="x1"  refid="x1" >

where #CONREF means "if this attribute is used, the contents of the
element being pointed to can be taken as the contents of this element
(which cannot have any contents if #CONREF is specified)".  That allowed
SGML to specify many-to-one relationships on "children", but it wasn't
used much because most SGML was stream-processed.

Rick Jelliffe

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member