RE: [xsl] Discovering the joys of xsl:include (Sovled!)

Subject: RE: [xsl] Discovering the joys of xsl:include (Sovled!)
From: Lukas Svoboda <LukasS@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Apr 2001 17:03:24 +1200
Thanks to Tim Watts, Steve Muench and Josh Coltrane 
(from the XML list) for helping me with my include 
problems. For archive's sake I've documented the 
updated XSL files which now work perfectly:

XML File:

<?xml version="1.0"?>
    <company_name>Company XYZ</company_name>
    <copyright>(C) Company XYZ, Blah Blah</copyright>
      <product_title>Product Title 1</product_title>
      <product_description>This is the description of the product
      <product_title>Product Title 2</product_title>
      <product_description>This is the description of the product

XSL Main:

<xsl:stylesheet version="1.0"

  <xsl:import href="header.xsl" />

  <xsl:template match="/">

    <xsl:apply-templates select="page_data/header" />
    <table border="1" cellpading="4" cellspacing="4" bordercolor="#ffffff"
      <xsl:apply-templates select="page_data/products/product" />



  <xsl:template match="product">

      <xsl:apply-templates select="product_id" />
      <xsl:apply-templates select="product_title" />
      <xsl:apply-templates select="product_description" />


  <xsl:template match="product_id">
    <td><b><font face="verdana" color="#000033" size="2"><xsl:value-of

  <xsl:template match="product_title">
    <td><b><font face="verdana" color="#000033" size="2"><xsl:value-of

  <xsl:template match="product_description">
    <td><b><font face="verdana" color="#000033" size="2"><xsl:value-of


XSL Include File:

<xsl:stylesheet xmlns:xsl="";
version="1.0" xmlns:msxsl="urn:schemas-microsoft-com:xslt">

  <xsl:template match="header">
     <font face="verdana" color="#000033" size="3"><xsl:value-of
     <font face="verdana" color="#000033" size="1"><xsl:value-of


> -----Original Message-----
> From: Tim Watts [mailto:timw@xxxxxxx]
> Sent: Tuesday, 24 April 2001 4:16 p.m.
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Discovering the joys of xsl:include
> Hi Lukus,
> I can't see an xsl:include in your stylesheet, but the <xsl:import
> href="header.xsl" /> should be immediatly under the 
> <xsl:stylesheet>tag.
> (currently it is in a template)
> For example, in a stylesheet I happen to have open at the 
> moment, it is
> writen like so...
> <xsl:stylesheet version="1.0"
> xmlns:xsl="";>
> <xsl:include href="document.xsl"/>
> <xsl:include href="common.xsl"/>
>   <xsl:template match="/">
> ...
>   </xsl:template>
> etc.
> The imports and includes must be defined before the templates.
> Best of luck,
> Tim Watts :)

 XSL-List info and archive:

Current Thread