Sequence of strings as a paramater value

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
fsteimke
Posts: 40

Sequence of strings as a paramater value

Thu May 11, 2017 8:37 am

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: 2337

Re: Sequence of strings as a paramater value

Thu May 11, 2017 10:29 am

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: 40

Solved: Sequence of strings as a paramater value

Fri May 12, 2017 8:33 am

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: 2337

Re: Sequence of strings as a paramater value

Fri May 12, 2017 4:12 pm

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

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 2 guests