This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Using !ENTITY to include html
[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