LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives

XML-L Archives

XML-L Archives


Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font


Join or Leave XML-L
Reply | Post New Message
Search Archives

Subject: Re: Recursive_Lists
From: James Robertson <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Sun, 28 Mar 1999 11:09:04 +1000

text/plain (75 lines)

At 06:56 28/03/1999 , Johnny Lee wrote:
  | Greetings,
  |         I would be very interested to learn what others are doing with
  | regard to
  | DTD declarations for recursive lists.  That is, I'm looking for the best
  | way to incorporate recursive lists in my DTD element declarations, and I
  | would love some guidance as to what's out there.
  |         My current research with regard to so-called structural
elements (e.g.,
  | lists, tables, paragraphs, etc.) has led me to the point where I am
  | probably going to use something akin to:
  | <!ELEMENT p - ANY>
  | and/or
  | <!ELEMENT table - ANY>
  |         However, I'm having trouble visualizing precisely what (in
terms of an
  | element's declaration) makes a list recursive or not.  Any help at all
  | would be appreciated.

I would avoid using ANY if at all possible, otherwise
you are basically letting anything happen.

There are obviously many different ways of
dealing with recursive elements, each with its
strengths and weaknesses.

Regarding lists, I tend to do the following:

<!ELEMENT List ((ListItem | List)*)>
<!ELEMENT ListItem (ListItemNo, ListItemBody)>

That allows for infinite recursing of lists.

Although there are often strong advantages to doing

<!ELEMENT List ((ListItem | SubList)*)>
<!ELEMENT ListItem (ListItemNo, ListItemBody)>

<!ELEMENT SubList (SubListItem*)>
<!ELEMENT SubListItem (SubListItemNo, SubListItemBody)>

This restricts the depths to a specific level,
and can be easier to process when generating HTML, RTF, etc.

The same sort of structures can be applied
to tables.

In terms of how these can be used in a document,
I generally use:

<!ELEMENT Document ((Para | List | Table)*)>

This places the lists, paragraphs and tables
at the same level. Alternatively, you can make
lists and tables part of paragraphs, although
I find these a less clean solution.

Hope this is of some use,


James Robertson
Step Two Designs Pty Ltd
SGML, XML & HTML Consultancy
[log in to unmask]

"Beyond the Idea"
 ACN 081 019 623

Back to: Top of Message | Previous Page | Main XML-L Page



CataList Email List Search Powered by the LISTSERV Email List Manager