RE: [xsl] external var in XSL

Subject: RE: [xsl] external var in XSL
From: "Angel Gavin" <agavin@xxxxxx>
Date: Wed, 16 Mar 2005 12:31:04 +0100

Use xsl:param to define global parameters (at first, i.e. global, level).
For example

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:param name="chapterNumber"/>
	<xsl:template match="manual/chapter[@name=$chapterNumber]">

Then call Xalan in the following way (command-line utility):

xalan -p chapterNumber 'chapter1' -o yourHTML.html  yourXML.xml

I hope this helps.


-----Original Message-----
From: Vojko [mailto:vojko@xxxxxxxxxxx]
Sent: 16 March 2005 12:10
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] external var in XSL


Is there a put a var in style sheet and then define it on

I would like to pars XSL and give it a different output by defining
different @name.


<xsl:template match="manual/chapter[@name=chapter1']"> --> chpater1.html
<xsl:template match="manual/chapter[@name=chapter2']"> --> chpater2.html

The XSL would stay the would only pars different XML tag, a
tag that is defined by @name.

So is there a way to define this on pars job when defining -in, -xsl and
-out attributes...since this way...I wouldn't need to copy n number of
XSL files for n number of output HTML files.

I am using Apache Xalan.

And if I totally missed in thinking how to do it...please advise how
could this problem be solved any other way.

Regards, Vojko.

Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

Current Thread