Re: lambda was RE: W3C-transformation language petition

Subject: Re: lambda was RE: W3C-transformation language petition
From: Chris Maden <crism@xxxxxxxxxxx>
Date: Fri, 12 Mar 1999 11:14:03 -0500 (EST)
[Daniel Glazman]
> Didier PH Martin a écrit :
> 
> >  <element match = "tag">
> >         <paragraph
> >                 font-size = "10pt">
> >         </paragraph>
> >  </elemen>
> 
> Or a more user- readable
> 
> 	tag { cast-element : paragraph ;
>               font-size : 10pt
>             }
> 
> based on CSS syntax...

Well, change 'cast-element: paragraph' to 'display: block' and it's
not CSS syntax, it *is* CSS.  It works very well for mapping a single
element to a single display object.

But when you extend CSS to create multiple formatted objects, it
becomes more complicated.  I believe that structured document syntax
is natural for representing structured document transformation (using
Didier's syntax):

<element match="tag">
  <paragraph
    font-size="12pt">
    <ancestor name="container">
      <descendant name="title"/>
    </ancestor>
    <text>: Tag</text>
  </paragraph>
  <paragraph
    font-size="10pt">
    <children/>
  </paragraph>
</element>

Or, in XSL:

<xsl:template match="tag">
  <fo:block font-size="12pt">
    <xsl:apply-templates select="ancestor(container)/title"/>
    <xsl:text>: Tag</xsl:text>
  </fo:block>
  <fo:block font-size="10pt">
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

In DSSSL:

(element tag
  (sosofo-append (make paragraph
                       font-size: 12pt
                       (process-node-list (select-elements (children (ancestor "container"))
                                                           "title"))
                       (literal ": Tag"))
                 (make paragraph
                       font-size: 10pt
                       (process-children))))

Can you show an example of this in your CSS-transformation syntax?  I
can't find the proposal, and didn't bookmark it.

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


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


Current Thread