Re: Desperate Questions: [1]Absolute-Child-Number

Subject: Re: Desperate Questions: [1]Absolute-Child-Number
From: Joe English <jenglish@xxxxxxx>
Date: Wed, 25 Jun 1997 11:47:46 -0700
W. Eliot Kimber <eliot@xxxxxxxxxx> wrote:
>
> I am writing a transform to generate the HTML version of the HyTime
> standard--time is short and thus I am desperate. [...]
>
> My first challenge is calculating the absolute child number of an element.
> The standard DTD has 7 different element types that are the first level
> divisions within standard (H1, scope, refs, defs, notation, annexn,
> annexi).  In order to number things automatically I need the absolute child
> numbers of these element types. [...]


Can you solve this problem with an architectural transformation?

The base architecture might look something like:

    <!DOCTYPE FormattedDocument [

	<!ELEMENT FormattedDocument - - (titlep, frontm, div1+, annex+)>
	...
	<!ENTITY % s.zz "section content">
	<!ENTITY % m.ph "phrase model">

	<!ELEMENT DIV1 - - (TITLE, (%s.zz;)*, DIV2*)
		-- first-level divisions -- >
	<!ELEMENT TITLE - - %m.ph; >
	... etc.

    ]>


Then map all the first-level-division element types
in the source DTD to the "DIV1" architectural form:


    <!LINKTYPE FormattedDocument standard #IMPLIED [

	<?ArcBase FormattedDocument>
	<?AFDR OtherBlackMagicHere>

	<!ATTLIST (h1, scope, refs, defs, notation)
	    FormattedDocument	NAME #FIXED "DIV1"
	>
	<!ATTLIST (annexn, annexi)
	    FormattedDocument	NAME #FIXED "ANNEX"
	>
	...
    ]>

This should considerably simplify your DSSSL spec,
since you can use a single rule for DIV1 instead of having
to treat each DIV1-like element individually.  Similarly
you can map all your semantically oriented phrase-level
elements to a single HighlightedPhrase architectural form,
and so on.  It would also make it easier to reuse the
DSSSL spec with different DTDs or different extensions
of the base DTD.

Since you're in a hurry you probably don't have time to do this
now, but in the long run an architectural approach will probably
save time and effort.



--Joe English

  jenglish@xxxxxxx

 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread