Re: `High-level' format specifications with XSL?

Subject: Re: `High-level' format specifications with XSL?
From: "Kent Fitch" <kent.fitch@xxxxxxxxxxxx>
Date: Thu, 9 Jul 1998 12:02:38 +1000
From: Kai Grossjohann <grossjohann@xxxxxxxxxxxxxxxxxxxxxxxxx>

>...
>Does MSXSL work under SPARC Solaris 2.5?  I vaguely remember it being
>a Java program, but I'm not sure.


No, it is a Microsoft Windows program - see:

>What would an XSL stylesheet look like that does this transformation?
>
>Assume a simple DTD:
>
>,-----
>| <!element project - - (projecttitle)>
>| <!element projecttitle - - (#PCDATA)> <!-- not sure about the
parens -->
>`-----
>
>And assume I want to transform
>
>,-----
>| <project><projecttitle>Project Foo</projecttitle></project>
>`-----
>
>into
>
>,-----
>| <html>
>|   <head><title>Project Foo</title></head>
>|   <body><h1>Project Foo</h1></body>
>| </html>
>`-----
>
>I think I should be able to work from there.


There are lots of ways, but depending on how the
real DTD looks (maybe there are many projects per
input XML tree?), this is one approach:

<xsl>
<rule>
   <root/>
     <HTML>
     <children/>
    </HTML>
</rule>

<rule>
    <target-element type="project"/>

    <HEAD><TITLE>
    <eval>children.item("projecttitle",0).text</eval>
    </TITLE></HEAD>
    <BODY>

    <children/>
    </BODY>
</rule>

<rule>
    <target-element type="projecttitle"/>

    <H1>
    <children/>
    </H1>
</rule>
</xsl>

Kent Fitch                           Ph: +61 2 6276 6711
ITS  CSIRO  Canberra  Australia      kent.fitch@xxxxxxxxxxxx



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


Current Thread