This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: variable dtd path


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]