Re: import vs include and how to use

Discussion in 'XML' started by Colin Mackenzie, Jul 3, 2003.

  1. a simple example would be something like

    main.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:eek:utput method="html" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:include href="head.xsl"/>
    <xsl:include href="left.xsl"/>

    <xsl:template match="/">
    <html>
    <body>
    <xsl:call-template name="headDiv"/>
    <xsl:call-template name="LeftDiv"/>
    <xsl:apply-templates select="Data"/>
    </body>
    </html>
    </xsl:template>

    etc..

    head.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template name="headDiv">
    <div class="Head">
    Lots of HTML Headers stuff
    </div>
    </xsl:template>

    left.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template name="leftDiv">
    <div class="left">
    Lots of HTML TOC stuff
    </div>
    </xsl:template>

    Colin

    "johkar" <> wrote in message
    news:vGLMa.75702$...
    > I have an XSL file transforming perfectly. Now I would like to break it

    up
    > by taking the "static" header navigation, left navigation and footer out

    of
    > the XSL so that I can reuse it across 12-15 XSL templates. I am a newbie

    to
    > XSL and am just not getting the posts I have seen to this group on the
    > topic. Note that the parts I want to take out currently do not have XSL
    > tags...just static HTML.
    >
    > I tried using import and then call-template to get it brought into the

    page.
    > Can some point me in the right direction or give me a simplistic example?
    >
    > Thank you, John
    >
    >
    Colin Mackenzie, Jul 3, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JPractitioner
    Replies:
    13
    Views:
    20,120
    Roedy Green
    Feb 24, 2006
  2. Rolf Magnus
    Replies:
    2
    Views:
    587
    Karl Heinz Buchegger
    Nov 28, 2003
  3. Elie Nader
    Replies:
    1
    Views:
    625
  4. Tuckers
    Replies:
    18
    Views:
    613
    ThosRTanner
    May 18, 2005
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    882
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page