Sequence of strings as a paramater value

Having trouble installing Oxygen? Got a bug to report? Post it all here.
fsteimke
Posts: 80
Joined: Tue Jan 01, 2013 3:19 pm

Sequence of strings as a paramater value

Post 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
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Sequence of strings as a paramater value

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
fsteimke
Posts: 80
Joined: Tue Jan 01, 2013 3:19 pm

Solved: Sequence of strings as a paramater value

Post 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
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Sequence of strings as a paramater value

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply