This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: 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="http://www.w3.org/1999/XSL/Transform";>
<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 :)

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Lukas Svoboda
Sent: Tuesday, 24 April 2001 1:52 PM
To: 'XSL-List@lists.mulberrytech.com'
Subject: [xsl] Discovering the joys of xsl:include



Hi, just trying to get xsl:includes working, but keep getting "Keyword
xsl:import may not be used here" Using MSXML3 btw.

My Main XSL is:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:msxsl="urn:schemas-microsoft-com:xslt">

  <xsl:template match="/">

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

...

  </xsl:template>

  <xsl:template match="product">
  <html>
  <body>
...
  </body>
  </html>
  </xsl:template>

  <xsl:template match="product_id">
...
  </xsl:template>

  <xsl:template match="product_title">
...
  </xsl:template>

  <xsl:template match="product_description">
...
  </xsl:template>

</xsl:stylesheet>

My Include XSL is:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0" xmlns:msxsl="urn:schemas-microsoft-com:xslt">

  <xsl:template match="/">

  <xsl:apply-templates select="page_data/header" />

  </xsl:template>

  <xsl:template match="header">
...
  </xsl:template>

</xsl:stylesheet>

What am I doing wrong? Take the include out and it works fine.

Thanks in advance,
Lukas



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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]