[xsl] pass parameter to XSL

Subject: [xsl] pass parameter to XSL
From: <igutierrez027@xxxxxxxxxxxxx>
Date: Wed, 20 Feb 2008 14:14:11 +0100 (CET)
Hello everybody:

I am spanish student and I am doing my Project in my university and I
need help about how to pass a parameter to a XSL.

I have one interface doing in Java. The user gives me a variable that I
take like String. And I want to pass this variable to a XSL stylesheet
to use it, but I don't know how to do this. I'm using Oxygen to work
with
XSL.

This is my stylesheet:

author and book are tags of the xml file. I have give the values to de
field and class parameters. But the user gives me strings in the
interface.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform
 version="1.0" xmlns:pepe="http://bibtexml.sf.net/";>


<xsl:param name="campo" >author</xsl:param>

<xsl:param name="clase">book</xsl:param>
<xsl:template match="/">
<xsl:value-of
select="pepe:file/ pepe:entry/*[name()=$clase]/*[name()=$campo]"/>
</xsl:template>
</xsl:stylesheet>

How I can pass the strings to the stylesheet?
Thank you for your help.

Izaskun

Current Thread