Re: dl/dt/dd matching

Subject: Re: dl/dt/dd matching
From: Paul Prescod <paul@xxxxxxxxxxx>
Date: Tue, 12 Jan 1999 03:57:12 -0600
James Clark wrote:
> 
> Francois Belanger wrote:
> >
> > I'm scratching my head on this one.
> 
> I've been scratching my head for years on this one.  It's a problem in
> DSSSL too.

Actually, it very easy to solve if you solve it in the right place. You
need to augment the input schema (DTD, XSchema, whatever) so that it can
guide the grouping of things.

<!ELEMENT DL (!DTITEM)>
<!GROUP DTITEM (DT, DD)>

Given this document:

<DL>
  <DT>...</DT><DD>..</DD>
  <DT>...</DT><DD>..</DD>
  <DT>...</DT><DD>..</DD>
  <DT>...</DT><DD>..</DD>
</DL>

You get this tree:

DL
   DLITEM
      DT
      DD
   DLITEM
      DT
      DD
   DLITEM
      DT
      DD
   DLITEM
      DT
      DD

David Peterson may have invented this idea in the SGML context, but in
retrospect it is a straightforward application of the computer science
concept of "non-terminal" in a context-free-grammar.

 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"I want to give beauty pageants the respectability they deserve."
            - Brooke Ross, Miss Canada International


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread