RE: calling external functions

Subject: RE: calling external functions
From: "Didier PH Martin" <martind@xxxxxxxxxxxxx>
Date: Fri, 17 Dec 1999 11:03:37 -0500
Hi Peter,

I have check the link you referred to. Here is the problem I encountered
with this solution.

It possess everything to transform an SGML document but no styling.

The following reasoning is exploratory:
----------------------------------------
The actual DSSSL specification is built from the scheme language. However,
the specification document may have the potential to be language independent
or possibly a template section could be added to perform transformation
before styling.

For instance, actually a specification document is made of several section
but mainly of a transformation section and a styling section. The DSSSL
engine will first use the transformation specification to transform the
SGML/XML document before applying a style on the resultant grove. Thus, the
SGML/XML document is firstly transformed into a Grove, then transformation
applied to it and finally styling applied on the transformed grove.

I am exploring actually the possibility to have the transformation section
to be specified by any other languages than DSSSL/scheme (but DSSSL/Scheme
is one of the possible language to be used for transformation). Each
language can have access to the underlying grove.

Let's say that the language in question is JavaScript, then there two way
this language can be used to do a transform
a) let the language construct loop in the grove and do transformation on it
based on which node is encountered
b) have this language augmented with new pattern matching constructs like
the expression below if we choose to use XPath as an addressing language (we
could as well used an S-expression language or SDQL)

query ("element1/element1.1")
{
   grove.node(currentnode).moveTo("element2");
}

Yes this construct is possible in JavaScript  as well as in Python ;-) So,
in the expression we said to move the element from its actual position to be
be now under element 2. So we have at the origin:

element 1
    |___ element1.1
element 2

after the transform we then have

element1
element 2
    |___ element1.1

I didn't renamed the element so that it can be easily recognized but you
could as well renamed it (i.e. the MoveTo function would then have two
parameters (destination_node, new-name) )

Or an other simpler way to do the transform is to use a template like in the
following expression( this is only an example):

<template-specification>
<Mydoc>
<element1>
</element1>
<element2>
<element1.1> <---- this element could also be renamed in addition to be
moved
<element1.1>
</element2>
</mydoc>
</template-specification>

So in this case, the template show the end result without any procedural
construct to manipulate the grove.

So, let's ask a different question to Holger this time. Could a template
resolve your problem?

Cheers
Didier PH Martin
mailto:martind@xxxxxxxxxxxxx
http://www.netfolder.com


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


Current Thread