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

Re: importing text-source in a xsl-stylesheet

Subject: Re: importing text-source in a xsl-stylesheet
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 27 Aug 1999 15:50:06 +0100 (BST)
import text file into xsl
> Now I want to include a certain header (lika a javascript-block) in
> each of them (lets call it header.xsl).

You can do the following:

<!DOCTYPE xsl:stylesheet [
<!ENTITY header SYSTEM "header.txt">
]>

<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
  result-ns="">


<xsl:template match="foo">
&header;
<xsl:apply-templates/>
</xsl:template>


</xsl:stylesheet>

however note that

1) If your xsl engine uses a validating parser on the XSL file, you need
   to add a SYSTEM entry to that DOCTYPE pointing at a a DTD that
   matches the stylesheet you are using.

2) The header `text' file is still parsed as XML, so you still need to
   be careful of quoting < and &.

3) This is using general XML features rather than an XSL include
   mechanism, it is probably easier to put your header into a named
   template in an xsl file and then use the XSL import mechanism to
   include this into your stylesheets, then just access the header by
   calling the named template.

David


 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.