Page 1 of 1

Sequence of strings as a paramater value

Posted: Thu May 11, 2017 8:37 am
by fsteimke
Hi,
how can i specify a sequence of strings as a Parameter value in a Transformation Scenario?
In my XSL transformation i have declared a global Parameter of type xs:string* with a default value:

Code: Select all

<xsl:param name="profile.audience" as="xs:string+" select="('intern', 'expert')"/>
The number of items in this sequence is 2.
I'd like to overwrite this value in my transformation Scenario, so i set the value of this parameter to the string

Code: Select all

('intern', 'extern')
in the Dialog box, but when i check the number of items, i get 1 instead of 2.
What would be the correct Syntax to set a sequence of strings as the value of this Parameter?
Thanks in advance,
Frank

Re: Sequence of strings as a paramater value

Posted: Thu May 11, 2017 10:29 am
by adrian
Hello,
fsteimke wrote:I'd like to overwrite this value in my transformation Scenario, so i set the value of this parameter to the string

Code: Select all

('intern', 'extern')
in the Dialog box, but when i check the number of items, i get 1 instead of 2.
What would be the correct Syntax to set a sequence of strings as the value of this Parameter?
The syntax seems correct, you just need to check the Evaluate as XPath box from the Edit Parameter dialog.

Regards,
Adrian

Solved: Sequence of strings as a paramater value

Posted: Fri May 12, 2017 8:33 am
by fsteimke
Hi Adrian,

yes it works. Thank you.

I always thougt that xpath is only mode for the hierarchic addressing of the nodes in an XML tree. Thats why i did not care about the checkbox in this case.

But in fact it is an expression language that allows the processing of values conforming to the data model defined in XQuery and XPath Data Model .

Thanks again,
Frank

Re: Sequence of strings as a paramater value

Posted: Fri May 12, 2017 4:12 pm
by adrian
Hi,

By default a transformation parameter value is treated as a plain string. When you use "Evaluate as XPath" it's treated as an XPath expression, it's evaluated and the result of the evaluation is fed to that parameter as value. So Oxygen is using XPath via this option as a way of providing any type of value to a transformation parameter. You can do much more with it, but that is the main use case.

Regards,
Adrian