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

RE: Including a document containing static HTML

Subject: RE: Including a document containing static HTML
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 17 Oct 2000 11:58:45 +0100
html include file static
> First: How to include the file?  Imagine the xml is of the form
> 
> <user_info_node file_name="XXX"/>
> 
> I have tried the following without success (no error given - 
> just nothing included in the output html):
> 
> <xsl:value-of select="document(@file_name)" 
> disable-output-escaping="yes"/>

The file retrieved by the document() function must be XML. If the file
cannot be retrieved or parsed, it's an error: the XSLT processor may either
report the error, or return an empty node-set.

> 
> Second: Will the disable-output-escaping="yes" save me from 
> potentially non-perfectly-formed HTML (by XML standards)?

No. If the document is well-formed XML, xsl:value-of extracts all the text
content; the only effect of disable-output-escaping is that if the input
contains "&lt;" this will be output as "<" rather than as "&lt;".

> How have other people dealt with this type of problem?

Write an extension function which returns the entire HTML content as a
string. Then write

<xsl:value-of select="my:HtmlDocument('filename')"
disable-output-escaping="yes"/>

Alternatively, generate HTML output that contains a server-side-include.

Mike Kay


 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.