Re: variable dtd path

Subject: Re: variable dtd path
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Wed, 28 Jun 2000 13:21:01 -0400
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:

Current Thread