p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Passing variabel with XSLT....


Message #1 by "Sukma Wardhana" <hantu_maut@y...> on Sat, 1 Feb 2003 13:48:04
Hi ..
I got problem using XSLT, the XSLT can't read ...

<A href="LihatData1.php?i=$i&j=$j&result=$result">BLABLA</A>

I need the variabel to pass it to another php page ...
Do you have any idea where's the wrong ?
I need it ASAP ...

Thanks ...

Sukma
Message #2 by "Nikolai Devereaux" <yomama@u...> on Sat, 1 Feb 2003 10:07:16 -0800
> I got problem using XSLT, the XSLT can't read ...
>
> <A href="LihatData1.php?i=$i&j=$j&result=$result">BLABLA</A>
>
> I need the variabel to pass it to another php page ...
> Do you have any idea where's the wrong ?
> I need it ASAP ...


I think you're confusing what XSLT can do.  XSLT is it's own programming
language.  It's specifically for transforming XML input files into some other
output.  It has no knowledge of PHP variables or scope.

If this line:

> <A href="LihatData1.php?i=$i&j=$j&result=$result">BLABLA</A>

Is in your XSLT stylesheet, then that line will be in the output for the
current <xsl:template> match tag.

You can pass variables from PHP to the XSLT processor as input parameters to
the stylesheet.  This is the last parameter to the xslt_process() function.

You can alternatively use PHP to generate the XSLT stylesheet (much like it
generates HTML) before running the stylesheet and substitute your variable
values appropriately.


take care,

Nik

Message #3 by "Sukma Wardhana" <hantu_maut@y...> on Sun, 2 Feb 2003 01:08:43
Sory Nik, can u give the example .. to pass the php variables to XSLT ?
I still don't find the way ...

Thanks

Sukma
Message #4 by "Nikolai Devereaux" <yomama@u...> on Mon, 3 Feb 2003 10:52:07 -0800
> Sory Nik, can u give the example .. to pass the php variables to XSLT ?
> I still don't find the way ...

Sukma,

there is an example in the first user comment on the manual page for
xslt_process().

  http://www.php.net/xslt_process

Nik


  Return to Index