You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Saigal, Ankur" <an...@sap.com> on 2002/01/30 15:27:08 UTC

XSL:parameters

Hi, 
I have the following style sheet,

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mynsprefix="urn:sap-com:document:sap:rfc:functions"
	xmlns:java="http://xml.apache.org/xslt/java"
	exclude-result-prefixes="java"
	version="1.0" >
	
	<xsl:param name="Xpathname"/>
	<xsl:template match="/">
		<xsl:copy-of select="$Xpathname"/>
	</xsl:template>
	
</xsl:stylesheet>

RE: XSL:parameters

Posted by Gary L Peskin <ga...@firstech.com>.
In vanilla XSLT, you cannot dynamically specify an Xpath in a select
attribute as you are attempting to do.  Check out the evaluate extension
function.

You will generally get faster answers if you send these generic XSLT
questions to the Mulberry List
(http://www.mulberrytech.com/xsl/xsl-list/index.html).  Also, you might
want to check a FAQ (http://www.dpawson.co.uk/xsl/sect2/N1575.html)
before asking this type of frequent question.

Arthur, please send questions such as these to a list and not to
individuals.

Gary

> -----Original Message-----
> From: Xavier Renard [mailto:Xavier.Renard@ulg.ac.be] 
> Sent: Wednesday, January 30, 2002 6:52 AM
> To: xalan-j-users@xml.apache.org
> Subject: Re: XSL:parameters
> 
> 
> Saigal, Ankur wrote:
> 
> >Hi,
> >I have the following style sheet,
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >xmlns:mynsprefix="urn:sap-com:document:sap:rfc:functions"
> >	xmlns:java="http://xml.apache.org/xslt/java"
> >	exclude-result-prefixes="java"
> >	version="1.0" >
> >	
> >	<xsl:param name="Xpathname"/>
> >	<xsl:template match="/">
> >		<xsl:copy-of select="$Xpathname"/>
> >	</xsl:template>
> >	
> ></xsl:stylesheet>
> >
> >>From the java code I set the value of this parameter 
> (Xpathname).The 
> >>value I
> >set happens to be a String object.
> >Now when I transform I get the output as the value of the Xpathname 
> >parameter only, whereas If I declare a vraible inside the stylesheet 
> >and give it the same value as I am giving to the parameter 
> from outside 
> >I get the desired result. Is there some problem with passing 
> the String 
> >Object?
> >
> >Thanks and Regards,
> >Ankur
> >
> Well, I don't have the solution (any are welcome) but I did have the 
> same problem .I tried with the command line and Xalan didn't accept 
> passing the argument as aString Object but was expecting for 
> something 
> else .
> 
> Xavier
> 
> 


Re: XSL:parameters

Posted by Xavier Renard <Xa...@ulg.ac.be>.
Saigal, Ankur wrote:

>Hi, 
>I have the following style sheet,
>
><?xml version="1.0" encoding="UTF-8"?>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>xmlns:mynsprefix="urn:sap-com:document:sap:rfc:functions"
>	xmlns:java="http://xml.apache.org/xslt/java"
>	exclude-result-prefixes="java"
>	version="1.0" >
>	
>	<xsl:param name="Xpathname"/>
>	<xsl:template match="/">
>		<xsl:copy-of select="$Xpathname"/>
>	</xsl:template>
>	
></xsl:stylesheet>
>
>>From the java code I set the value of this parameter (Xpathname).The value I
>set happens to be a String object.
>Now when I transform I get the output as the value of the Xpathname
>parameter only, whereas If I declare a vraible inside the stylesheet and
>give it the same value as I am giving to the parameter from outside I get
>the desired result.
>Is there some problem with passing the String Object?
>
>Thanks and Regards,
>Ankur
>
Well, I don't have the solution (any are welcome) but I did have the 
same problem .I tried with the command line and Xalan didn't accept 
passing the argument as aString Object but was expecting for something 
else .

Xavier