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 13:21:01 -0400
- CC: xsl list <xsl_list at hotmail dot com>
- Organization: Department of Engineering Science, The University of Auckland
- References: <20000628160613.8940.qmail@hotmail.com>
- Reply-To: xsl-list at mulberrytech dot com
xsl list wrote:
>
> ><xsl:value-of select="$DTD_PATH" />
This prints out the value of the DTD_PATH parameter.
> I need to validate the xml, hence, am adding the <!DOCTYPE ... > to all my
> xml files and ruuning xalan as such:
> xalan -in file.xml -validate
> Can I make the dtd path variable so I would not have to edit all the files
> if it changes?
To pass a variable from the command line into a stylesheet you need
to have this at the top of your stylesheet.
<xsl:param name="DTD_PATH" select="']['" />
I've included a ridiculous default value, which makes it possible to
check if no parameter was received, and crash out if this is the case.
Then on the command line:
xalan -in file.xml -validate -param DTD_PATH '../dtds'
As long as the DTD_PATH parameter is specifed, it will override the
default value (][).
--
Warren Hedley
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list