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

Re: Using !ENTITY to include html

Subject: Re: Using !ENTITY to include html
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 29 Aug 2001 10:24:38 -0400
include html xslt
[dante]
>
> I've been trying to use the following code in the beginning of my XSL to
add
> some html to my output document:
>....
> <xsl:template match="/">
>     <html>
>         <head>
>              <title>&title;</title>
> etc.


If you are trying to insert snippits of text into the result, you are better
off using document().  For example, you could put the title into an
***xml*** file like this:

File resources.xml:

<resources>
    <title>This is My Best Work</title>
<!--=== Typically you'd have other data here too ===-->
</resources>

Then in the stylesheet:

...
<xsl:variable name='resources' select='document("resources.xml")/>

<xsl:template match="/">
     <html>
         <head>
              <title><xsl:value-of select='$resources/title'/></title>
 etc.

If you want to insert a whole branch of a tree, use <xsl:copy-of
select='$resources/theBranch'/>

This way is more robust for use with xslt, and is a lot more flexible than
defining entities for everything.

Cheers,

Tom P





 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.