[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Getting Started with XSL


Subject: Re: Getting Started with XSL
From: Francois Belanger <francois@xxxxxxxxxxx>
Date: Wed, 9 Dec 98 14:28:36 -0500

Nigel Byrnes wrote on 09/12/98 13h10:

>Hi
>
>As a relative newcomer to the wonderful world of XSL, I would
>like to ask for your advice. My project requires XML content to
>be published in a formatting markup language (like HTML).
>Trouble is: I am having great trouble getting started. So can
>you tell me what (in terms of XSL style sheet, which XSL
>processor, etc) is required to get

You can find a lot of good resources on XSL at Robin' Cover's XSL page <http://www.oasis-open.org/cover/xsl.html>. There's a really good article from Norman Walsh of Arbor Text in the January 1999 Web Techniques. It's not available on line on their we site but worth the cover price to get started.

As for XSL parser, I use James Clark's Java XT <http://www.jclark.com/xml/xt.html> , specifying HTML as the output namespace with a null prefix as follows:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
        xmlns="http://www.w3.org/TR/REC-html40" result-ns="">

XT will then, among other things, resolve some HTML tags that do not conform to XML such as <br> (instead of <br/> which older browsers ignore).  Also, I discovered that XT supports some recent tags that are not in the 1.0 draft such as copy (copies source node to target) and apply-templates (a synonym or replacement ? to 1st draft's process-children)

><simple_message>Hello world</simple_message>

Well, this stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
        xmlns="http://www.w3.org/TR/REC-html40" result-ns="">

<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Message</TITLE>
</HEAD>
<BODY>
     <xsl:process-children/>
</BODY>
</HTML>
</xsl:template>

<xsl:template match="simple_message">
        <p> <xsl:process-children/></p>
        <br/>
</xsl:template>
</xsl:stylesheet>

Will give you this with XT:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Message</TITLE>
</HEAD>
<BODY>
<p>Hello world</p>
<br>
</BODY>
</HTML>

Hope this helps.

François


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



Current Thread
Keywords