[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
cover.xsl
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.