[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: variable dtd path


Subject: Re: variable dtd path
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Wed, 28 Jun 2000 11:41:53 -0400

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">&lt;!DOCTYPE tldoc SYSTEM "</xsl;text>
<xsl:value-of select="$DTD_PATH" />
<xsl:text disable-output-escaping="yes">/tldoc.dtd"&gt;</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



Current Thread
Keywords