|
top
|
Subject: RE: Passing variables to XSLT form Author: Ivan Pedruzzi Date: 21 Jan 2002 03:18 PM
|
Atif,
XSLT 1.0 doesn't support what you are trying to do: evaluate a string as
XPath expression.
The expr attribute is an XIS/Stylus custom extension. So if you are
using XIS you can do
{xsl:param name="pos"}
{xsl:param name="xslSt"
expr="HSCROOT/MORTGAGEDATA/BORROWER[position()=number($pos)]/FirstName"/
}
Or even
{xsl:param name="myxpath"}
{xsl:param name="xslSt" expr="$(myxpath)"/}
If you want to comply to XSLT 1.0 you should change you design creating
a template that match your Xpath and test the position:
{xsl-template name= "MyTemplate" match="HSCROOT/MORTGAGEDATA"}
{xsl:param name="pos"/}
{xsl:for-each select="BORROWER[position()=number($pos)]"}
{/xsl:for-each>}
{/xsl-template}
Ivan Pedruzzi
eXcelon Corporation
http://www.stylusstudio.com
Ivan Pedruzzi
eXcelon Corporation
http://www.stylusstudio.com
> -----Original Message-----
> From: stylus-studio-xslt Listmanager [mailto:listmanager]
> Sent: Monday, January 21, 2002 3:08 PM
> To: Recipients of 'stylus-studio-xslt' suppressed
> Subject: RE: Passing variables to XSLT form
>
>
> From: "Atif Sarfraz"
>
> Hi Ivan,
>
> Thanks, Its working with the following code i.e. by defining
> it as an expression
>
> {xsl:param name="xslSt"
> expr="HSCROOT/MORTGAGEDATA/BORROWER[1]/FirstName"/}
>
> Is there a way to do some string addition in the above
> expression. I mean I receive some no like 1, 2, 3, ......,
> from Java within my xsl parameter borrowerNo. e.g.
>
> {xsl:param name="borrowerNo" select="'1'"/>
>
> I want to use this no to build the first expression (e.g.
> BORROWER[1], BORROWER[2] etc). How can I do that?
>
> Regards,
>
> Atif
>
>
>
> To reply: mailto:stylus-studio-xslt.4463@edn.exceloncorp.com
> To start a new topic: mailto:stylus-studio-xslt@edn.exceloncorp.com
> To login: http://edn.exceloncorp.com/~SSDN
>
>
|
|
|
|