perlsgml-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Perlsgml-dev] Perl5 modules API


From: Yann Dirson
Subject: [Perlsgml-dev] Perl5 modules API
Date: Thu, 13 Sep 2001 11:40:25 +0200
User-agent: Mutt/1.3.20i

I started to have a look at the perl5 modules API, and have a couple
of remarks:

- It seems to rely on a custom model.  What about using a more
standard one, grove-based, using (part of) the SGML property-set ?

- The SGML::DTD object does not return objects itself.  It would be
IHMO better to have classes like:

SGML::DTDDef::Element
SGML::DTDDef::Attribute
SGML::DTDDef::Notation
SGML::DTDDef::Entity    # generic, parent class for the following:
SGML::DTDDef::Entity::Parametric
SGML::DTDDef::Entity::General

Objects belonging to those classes would be either built on
read_dtd(), or instantiated in a lazy manner when SGML::DTD::get*()
and such would be called.

Also, some abstraction of the content model would be nice.  I suppose
the SGML property set has one, but don't know what it's like, I'll
have to check.  What I think of would be like the following:

content-model defn:     (title,subtitle?,((para,sect*)|sect+))
perl data struct:
        [ 'sequence',
                'title',
                [ 'repeat', 0, 1,
                        'subtitle'
                ],
                [ 'choice',
                        [ 'sequence'
                                'para',
                                [ 'repeat', 0, undef,
                                        'sect'
                                ]
                        ],
                        [ 'repeat', 1, undef,
                                'sect'
                        ]
                ]
        ]

This structure is more or less taken from the various schema designs.

Probably those 'sequence', 'choice', and 'repeat' should be
objects as well, with classes like "DTD::ContentModel::Sequence", etc.



References:

Docbook experimental schemas:
RELAX:  http://www.oasis-open.org/docbook/relax/index.shtml
TREX:   http://www.oasis-open.org/docbook/trex/index.shtml
W3C schema:
        http://www.oasis-open.org/docbook/xmlschema/index.shtml

Introduction to groves and property sets:
        http://www.prescod.net/groves/shorttut/

Groves and property sets (annex of the HyTime standard):
        http://www.ornl.gov/sgml/wg8/docs/n1920/html/clause-A.4.html

SGML property set (annex of the HyTime standard):
        http://www.ornl.gov/sgml/wg8/docs/n1920/html/clause-A.7.html


-- 
Yann Dirson <address@hidden>                 http://www.alcove.com/
Free-Software Engineer                                Ingénieur Logiciel-Libre
Free-Software time manager             Responsable du temps Informatique-Libre



reply via email to

[Prev in Thread] Current Thread [Next in Thread]