[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|