[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: (off-topic) Re: Recursive Children?
Rick JELLIFFE <ricko@g...> wrote: > > > Does anyone know if (and how) I can have one element contain itself? > > 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)". Actually no: '#CONREF' *only* means that "if this attribute is specified, the element to which it belongs must be empty". The intended semantics is that the application could generate content for the element (in some unspecified way), but the parser doesn't do anything else with #CONREF attributes. > That allowed > SGML to specify many-to-one relationships on "children", but it wasn't > used much because most SGML was stream-processed. Attributes with declared value REFID turn into an 'irefnode' property in the grove, not a 'subnode' property; and the presense of an attribute with a #CONREF default value only ensures that the parent node will have _no_ 'subnode' property (or an empty one, I'm not sure which, but it amounts to the same thing). So the "children" relation always forms a tree, not a DAG or cyclic graph. --Joe English jenglish@f...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|