xsl-list
[Top] [All Lists]

[xsl] pass parameter to XSL

2008-02-20 06:15:35
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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>