[xsl] Embedded Stylesheets

Subject: [xsl] Embedded Stylesheets
From: "Sheryl Cia" <lyrehscg@xxxxxxxxxxx>
Date: Wed, 26 Sep 2001 05:14:32 +0000

Hi,


I'm trying to embed my stylesheet in my xml file which is covered
in the XSLT Recommendation at http://www.w3.org/TR/xslt#section-Embedding-Stylesheets.


Given this example:

--XML FILE --
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="booklist.xsl"?>
<BOOKLIST>
 <BOOKINFO>
   <ISBN>1-861000-68-5</ISBN>
   <BOOK_TITLE>IE4 DHTML Programmer's Reference</BOOK_TITLE>
   <RELEASE_DATE>1997-09-01</RELEASE_DATE>
   <DESCRIPTION>The ideal intro to Dynamic HTML</DESCRIPTION>
   <BOOK_CODE>0685</BOOK_CODE>
 </BOOKINFO>
</BOOKLIST>

--XSL FILE--
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
<xsl:template match="/">
<html>
<head>
<title>A List of Books</title>
<style type="text/css">
BODY TD {font-family:Tahoma,Arial,sans-serif;
font-size:10pt; font-weight:normal}
.heading {font-family:Tahoma,Arial,sans-serif;
font-size:14pt; font-weight:bold}
.itemhead {font-family:Tahoma,Arial,sans-serif;
font-size:10pt; font-weight:bold}
</style>
</head>
<body bgcolor="lightblue">
<div class="heading" align="center"><xsl:value-of select="BOOKLIST/HEADING/@title"/>
</div><hr/>
<xsl:for-each select="//BOOKINFO">
<p>
<TABLE BORDER="1" WIDTH="35%" BGCOLOR="yellow" ALIGN="center"><TR>
<TD ALIGN="center">
<br/>
<b><xsl:value-of select="BOOK_TITLE"/></b><br/><br/>
Author: <xsl:value-of select="AUTHOR"/><br/>
ISBN: <xsl:value-of select="ISBN" /><br/>
Date: <xsl:value-of select="RELEASE_DATE"/><br/><br/>
<xsl:value-of select="DESCRIPTION"/><br/><br/>
</TD></TR></TABLE>
</p>
</xsl:for-each>
<hr />
</body>
</html>
</xsl:template>
</xsl:stylesheet>


How will i include my xsl file into the xml file?
Could someone please give me an specific example on how to do this.
I'm having a hard time trying to do this.
By the way i'm using msxml3.

Thanks for the help.

Yey:)



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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



Current Thread