SGML DTD navigation with the Web 
Author Message
 SGML DTD navigation with the Web

(This message is being sent out to what I believe are interested parties.)

Ever wondering if you can put a paragraph tag in a heading?  What
elements can contain a footnote?  Can I put a graphic inside of a
table?

If you've asked yourself questions like above, then I have the program
for you: dtd2html.

Dtd2html is a Perl program that generates an HTML document (composed of
several files) to allow hypertext navigation through an SGML DTD.  Now
one can easily find out what elements can contain what.  Dtd2html
determines what are the top-most elements in a DTD, and then allows a
user to navigate down (or up) the DTD element structure via
hyperlinks.

Dtd2html also generates an HTML page containing a list of all elements
so you can quickly jump to an element page you want.  Dtd2html can also
generate a page so one can see the overall element hierarchy defined by
the DTD.

Here's an example of what an element page looks like from the HTML DTD
(This was generated thru Mosaic's save file option using formatted text;
 therefore, all the hyperlinks do not show up):

---------------------------------------------------------------------------

HEAD
****

The HEAD element contains all information about the document in general.
It does not contain any text which is part of the document: this is in
the BODY.

Content
=======

 o base
 o isindex
 o link
 o nextid
 o title

Tag Minimization
   Open Tag: REQUIRED
   Close Tag: REQUIRED

See ATTRIBUTES
See CONTENT DECLERATION

Parent Elements
===============

 o html

Goto top element list.
Goto all element list.
Goto tree.

Goto HTML DTD main page.

HTML DTD

---------------------------------------------------------------------------

The element page contains hyperlinks to other element pages; a page
describing the attributes of the element; a page giving the actual SGML
syntax that defines the element; and links to the top element list, all
element list, tree, and home pages.

I've currently used dtd2html on the following DTDs:

        DocBook, OpenBook, Rainbow, HTML, HTML+, OSF Book

I've added in the ability for dtd2html to add in descriptions of the
elements in the DTD.  This way, one can use dtd2html as way of
documenting a DTD.

Is anyone interested in such a program?  I've created a tar file
containing the program and the DTDs I've converted.  The tar file
also contains the following:

    dtdtree
        dtdtree outputs the content hierarchy tree (in ASCII) of SGML
        elements defined in a DTD.

    dtd.pl
        A Perl library that parses an SGML document type defintion
        (DTD) and builds up data structures containing the structural
        content of the DTD.  Various convienance routines are
        defined to access the data structures.

        dtd2html and dtdtree utilize dtd.pl to do their work.

If there is interest, I would like to see if anyone/site is willing to
archive the stuff for distribution.  Currently, our company is still
working on geting a public Web server running, so it may be awhile
before I can put it there.

Following is the text file describing dtd2html:

dtd2html
*********

dtd2html is a Perl program that generates an HTML document
(composed of several files) to allow hypertext navigation through an
SGML DTD.

Description
============

dtd2html generates various HTML files for hypertext navigation of a
SGML DTD. The files generated are as follows:

DTD-HOME.html
   This file is the home page of the HTML document. This file
   contains to the basic links to start navigating through the DTD.
   The name of this file can be changed with the -homename option.

TOP-ELEM.html
   This file lists the top-most elements of the DTD, and contains the
   links to element pages describing each top-most element. The name
   of this file can be changed with the -topname option.

ALL-ELEM.html
   This file contains a list of all elements defined in the DTD. This
   page allows quick access to any individual element description page.
   The name of this file can be changed with the -allname option.

DTD-TREE.html
   (Optional) This file contains the content heierachy tree(s) of the
   top-most element(s) in the DTD. This file is only generated if the
   -tree option is specified during program invocation. The name of
   this file can be changed with the -treename option.

element.html
   For each element defined in the DTD, an element description file is
   generated with a filename of the element name suffixed by ".html".

element.attr.html
   For each element defined in the DTD, a file is generated describing
   the attributes defined for the element.

element.cont.html
   For each element defined in the DTD, a file is generated listing the
   content model decleration of the element as declared in the DTD.

Once all the files are generated, one needs only to create a link in the Web
server being used to the DTD-HOME.html file.

More information on the content of each file is in the HTML File
Descriptions section.

Usage
======

dtd2html is invoked from a Unix shell, with the following syntax:

% dtd2html [options] filename

filename is the SGML DTD to be parsed for generating the HTML files.
The following is the list of options available:

-allname filename
   Set the filename for file listing all elements in the DTD to filename.
   The default name is "ALL-ELEM.html".

-descfile filename
   Use filename as the source for element descriptions in the DTD. If
   this argument is not specified, no description file is used. See
   Element Description File for more information.

-dtdname string
   Set the name of the DTD to string. If not specified, dtd2html
   determines the name of the DTD by its filename with the extension
   stripped off. If reading from standard input, then this argument
   should be specified. Otherwise, "Unknown" is used.

   The string " DTD" will be appended to the name of the DTD.

-elemlist
   Generate a blank element description file (see Element Description
   File). No HTML files are generated and all other options are
   ignored when this option is specified.

-help
   Print out a terse description of all options available. No HTML files
   are generated and all other options are ignored when this option is
   specified.

-homename filename
   Set the filename for the HTML home page for the DTD to filename.
   The default name is "DTD-HOME.html".

-level #
   Set the prune level of the content hierachy tree to #. This option is
   only valid if -tree is specified.

-mapfile filename
   Set the entity to map file to filename. The default is "map.txt". See
   DTDread_mapfile of package dtd for more information.

   The entity map file is only necessary if element/attribute markup
   are contained in multiply files, and the files are referenced by
   external parameter entities. dtd2html ignores general entities
   since they do not define document structure.

-outdir path
   Set destination of generated HTML files to path. Defaults to the
   current working directory.

-topname filename
   Set the filename for file listing the top-most elements in the DTD
   to filename. The default name is "TOP-ELEM.html".

-tree
   Generate the content hierarchy of the top-most elements defined in
   the DTD.

-treename filename
   Set the filename for file containing the content hierarchy tree(s) of
   the DTD to filename. The default name is "DTD-TREE.html".
   This option is only valid if -tree is specified.

-treetop string
   Set the top-most elements to string. String is a comma separated list
   of elements that dtd2html should treat as the top-most elements
   when printing the content hierarchy tree(s). This option is only
   valid if -tree is specified.

   Normally, dtd2html will compute what are the top-most
   elements of the DTD. This option overrides that computation for
   the sake of of printing the content hierarchy trees. This option has
   no affect on the top-most element list presented
   "TOP-ELEM.html" (or the file specified by -topname).

HTML File Descriptions
=======================

All HTML files/pages generated contain hypertext links at the end of the
page to the DTD-HOME, TOP-ELEM, ALL-ELEM, and DTD-TREE
(if specified) files, unless stated otherwise.

DTD-HOME
+++++++++

This page is the root of the HTML document. It contains the links to the
other main pages as described above. It also contains a brief paragraph
mentioning that this document was created by dtd2html.

This file may (should) be editted to add further description of the DTD,
and/or contain links to other documents about the DTD.

TOP-ELEM
+++++++++

This page contains the list of all top-most elements defined in the DTD. A
top-most element is defined as: An element which cannot be contained by
another element or can be only contained by itself.

ALL-ELEM
+++++++++

This page contains a list of all elements defined in the DTD.

DTD-TREE
+++++++++

This page contains the content hierarchy tree(s) of the top-most elements
of the DTD. See DTDprint_tree of package dtd for a detailed description
about the content hierarchy tree(s).

element
++++++++

element.html is the file describing the content of element. The element page
is divided into the following sections:

 o element description (optional, see Element Description File).
 o Links to subelements broken into three parts:
    o Base content
    o Inclusions (if defined)
    o Exclusions (if defined)
 o Tag minimization (if defined).
 o Links to element's attribute (element.attr) and SGML decleration (
   element.cont) pages.
 o Links to all possible parent elements.
 o Links to main pages as described above.

element.attr
+++++++++++++

element.attr.html is the file describing the attributes of element. The
element.attr page is divided into the following sections:

 o attribute(s) description (optional, see Element Description File).
 o List of attributes with possible values and default value.
 o Link back to element page.
...

read more »



Sun, 27 Oct 1996 07:58:43 GMT  
 SGML DTD navigation with the Web

Quote:

> Ever wondering if you can put a paragraph tag in a heading?  What
> elements can contain a footnote?  Can I put a graphic inside of a
> table?

> If you've asked yourself questions like above, then I have the program
> for you: dtd2html.

And if you would tell us an ftp site, we would be most happy... :-)

Cheers,
        Joachim

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Computer Science Department
Technical University of Darmstadt, Germany



Sun, 27 Oct 1996 22:33:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DTD2HTML NOW AVAILABLE (was Re: SGML DTD navigation ...)

2. : Web Developer/Senior Web Developer: SGML, XML, PERL5, LINUX

3. Developer: Web & SGML (Brighton, UK)

4. SGML-SPGrove-0.01: perl module for loading SGML, XML, HTML

5. SGML::parser & SGML::ultil

6. File navigation and line replacement help required

7. Navigation Tools - Directory Tree

8. Navigation Bar? (newbie question)

9. File navigation and line replacement help required

10. File navigation help required

11. directory navigation module?

12. External DTD not working in XML::DOM ! (fwd)

 

 
Powered by phpBB® Forum Software