This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: variable dtd path
- To: xsl-list at mulberrytech dot com
- Subject: Re: variable dtd path
- From: Warren Hedley <w dot hedley at auckland dot ac dot nz>
- Date: Wed, 28 Jun 2000 11:41:53 -0400
- Organization: Department of Engineering Science, The University of Auckland
- References: <20000628143206.28538.qmail@hotmail.com>
- Reply-To: xsl-list at mulberrytech dot com
Yasser El-Zein wrote:
>
> I need not to hard code the full path of my dtd file. This does not work:
> <!DOCTYPE tldoc SYSTYM "{$DTD_PATH}/tldoc.dtd"/>
> where {$DTD_PATH} is an enviroment, or command line, variable. Is there a
> work around?
The XML documents produced by XSLT processors are supposedly well-formed
XML external general parsed entities, and as such don't need DOCTYPE
declarations. You can force one to be generated by using the doctype-*
attributes on the <xsl:output> element (see Section 16.1), but as you
pointed out, you can't put variables in these attributes.
So you have to result to a hack:
<xsl:text disable-output-escaping="yes"><!DOCTYPE tldoc SYSTEM "</xsl;text>
<xsl:value-of select="$DTD_PATH" />
<xsl:text disable-output-escaping="yes">/tldoc.dtd"></xsl:text>
Note that the DOCTYPE declaration is not an element, so you shouldn't have
that trailing slash before the end of the declaration.
--
Warren Hedley
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list