Leave that questions to the gods and be happy that it works, is my suggestion...

Am 12.06.2014 12:10, schrieb Christian Schwaderer:
Thanks again!

It works now for me, but only if I add the empty parameter value '' in setParameter like
$proc->setParameter('','name_as_string',$just_created_XdmValue);

So, what is this strange first parameter of setParameter?


Date: Thu, 12 Jun 2014 11:22:46 +0200
From: ruprecht.waldenfels@gmail.com
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] Saxon/C PHP API setParameter

Hi,
again, I had the same problem :-)
you first have to construct the XdmValue from the string. You cannot just pass a string.
So to set two values (as sting in $viztype and $vizsubtype) you go as below:

$xdmvalue = $proc->createXdmValue(strval($viztype));
$proc->setParameter('mode', $xdmvalue);
$xdmvalue1 = $proc->createXdmValue($vizsubtype);
$proc->setParameter('types', $xdmvalue1);

strangely enough, I needed to give separate variables for the two calls. But now it works.

Best, R


Am 12.06.2014 10:10, schrieb Christian Schwaderer:
Hi all,

I finally managed to get Saxon/C PHP extension to work! (Thanks again to O'Neil and Ruprecht!)

But I didn't succede in passing Parameters to Saxon.

In my stylesheet a parameter is defined like this:

<xsl:param name="is_default" as="xs:string" select="'true'"/>

I tried to set the parameter in PHP with
$xslt_processor_instance->setParameter('is_default', 'false');

But calling a test XLST file with the line
<xsl:value-of select="$is_default"/>
resulted in the default value "true" instead of the passed value "false".

So, obviously the parameter passing didn't work.

In the documentation the function setParameter is explained:
void setParameter(string $name, XdmValue $value)
There are just two parameters

But in the sample files there is for example the line
$proc->setParameter('', 'assertion', $xdmValue);

What is that empty first parameter '' ?

By the way, I also tried
$xslt_processor_instance->setParameter('','is_default', 'false');
but with the same result.

What do I wrong?

Thanks in advance!


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help