Page 1 of 1

external parameters always string ?

Posted: Wed Jul 14, 2010 4:10 pm
by PaulHermans
XQuery

Code: Select all

declare variable $param external;
declare variable $param2 := doc('nvp.xml');

<ids>
{$param}{$param2}
</ids>
where parameter $param is set to doc("nvp.xml") using the Configure Parameters screen but afterwards appearing between quotes as 'doc("nvp.xml")'.

Result

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<ids>doc("nvp.xml")
<nvp>
<collection>71022A00</collection>
</nvp>
</ids>
What to do to have the $param parameter as node() not as xs:string?

Re: external parameters always string ?

Posted: Wed Jul 14, 2010 4:40 pm
by adrian
Hello,

Unfortunately Oxygen allows only string parameters for a transformation, so there is currently no way to set a parameter as node(). We already have this on our issue tracking tool and we plan to resolve it in a future version. I'll increase the issue's priority.

Regards,
Adrian

Re: external parameters always string ?

Posted: Mon Apr 04, 2011 2:42 pm
by sorin_ristache
Hello,

Starting with Oxygen 12.2 which will be released in April 2011 each parameter from the XSLT and XQuery transformation scenarios will have an XPath checkbox that will allow setting the type of the parameter to XPath. That means you will select the XPath checkbox for your parameter and will set doc("nvp.xml") as value. The expression doc("nvp.xml") will be evaluated as XPath expression and the result will be passed to your transformation. It will work for the processors that support XPath parameters: Saxon 9 and XSLTProc for XSLT, Saxon 9 for XQuery.


Regards,
Sorin