Namelist continued

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Namelist continued

Jon Kerny
HI,

I saw that there previously has been some discussions about the namelist, and that at least in some parts my questions has been adressed. But I feel that this is quite complicated. 

In my understanding, namelist is a shorthand for param, but this name thing makes it more complicated than param where name is set explicitly in code.


Here are some examples I'd like to get comments on:

What would be the names in an Xpath scxml if the following location expressions was used in a namelist?

$var1 
$var1/children 
$var1/children[last()] 
ancestor::$var1/children[last()]"

If the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

And in the opposite direction, what would the names of an ecmascript datamodel be for the following location expressions in namelist?
var1
var1.children
var1.children.slice(-1)[0]
(I don't know how to write something similar to ancestor)

And what would happen if the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

Best regards,

Jon


Reply | Threaded
Open this post in threaded view
|

Re: Namelist continued

Jim Barnett
Jon,
   namelist is simple when it works, and useless when it doesn't.
<param> always gives you more control.

In your first Xpath example, the names of the attributes would be the
location expressions themselves as strings:
(I'll put them in single quotes to make this explicit):
'$var1'
'$var1/children'
'$var1/children[last()]'
'ancestor::$var1/children[last()]"'

If the invoked process had <data id="var1"/> as a top id, its value
would _not_ get replaced by the data passed in the invocation since
'var1' != '$var1'.  (So in this case namelist is not very useful).

In your second ecma script case the attributes would again  be the
location expressions themselves as strings:
'var1'
'var1.children'
'var1.children.slice(-1)[0]'

In the invoked process had a top level <data id="var1"/> in an ecma
script data model, it's value _would_ be replaced by the data passed in
since 'var1' == 'var1'.  The other two expressions would _not_ replace
anything since, when taken as strings, they do not match the 'id'
attributes of any top level vars.  (That is, I assume no data model
would have <data id="var1.children"/>)

The same thing would happen if the invoked process had an XPath data
model, though the values might be garbage and cause errors.

It may help to explain that SCXML inherited 'namelist' from VoiceXML and
CCXML, both of which had ecma data models. People who were familiar with
those languages found namelist useful and wanted it included in SCXML.

- Jim


On 9/26/2015 9:12 AM, Jon Kerny wrote:

> HI,
>
> I saw that there previously has been some discussions about the
> namelist, and that at least in some parts my questions has been
> adressed. But I feel that this is quite complicated.
>
> In my understanding, namelist is a shorthand for param, but this name
> thing makes it more complicated than param where name is set
> explicitly in code.
>
>
> Here are some examples I'd like to get comments on:
>
> What would be the names in an Xpath scxml if the following location
> expressions was used in a namelist?
>
> $var1
> $var1/children
> $var1/children[last()]
> ancestor::$var1/children[last()]"
>
> If the target of the invoke/send is an ecmascript scxml with the var1
> as a top most id what would the result be?
>
> If it instead is a xpath scxml what would be the result?
>
> And in the opposite direction, what would the names of an ecmascript
> datamodel be for the following location expressions in namelist?
> var1
> var1.children
> var1.children.slice(-1)[0]
> (I don't know how to write something similar to ancestor)
>
> And what would happen if the target of the invoke/send is an
> ecmascript scxml with the var1 as a top most id what would the result be?
>
> If it instead is a xpath scxml what would be the result?
>
> Best regards,
>
> Jon
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Namelist continued

Jim Barnett
In reply to this post by Jon Kerny
One further thought on the XPath data model and namelist.   The XPath
data model  _could_ be modified to say "for the purposes of passing a
namelist into invoke, the namelist attribute '$foo' shall be considered
to match <data id="foo"/>.    We didn't do that, because we didn't
expect 'namelist' to be useful everywhere. However, the XPath data mode
is not part of the final specification, and is thus not a 'standard' at
all, so people working with it have some flexibility.

- Jim

On 9/26/2015 9:12 AM, Jon Kerny wrote:

> HI,
>
> I saw that there previously has been some discussions about the
> namelist, and that at least in some parts my questions has been
> adressed. But I feel that this is quite complicated.
>
> In my understanding, namelist is a shorthand for param, but this name
> thing makes it more complicated than param where name is set
> explicitly in code.
>
>
> Here are some examples I'd like to get comments on:
>
> What would be the names in an Xpath scxml if the following location
> expressions was used in a namelist?
>
> $var1
> $var1/children
> $var1/children[last()]
> ancestor::$var1/children[last()]"
>
> If the target of the invoke/send is an ecmascript scxml with the var1
> as a top most id what would the result be?
>
> If it instead is a xpath scxml what would be the result?
>
> And in the opposite direction, what would the names of an ecmascript
> datamodel be for the following location expressions in namelist?
> var1
> var1.children
> var1.children.slice(-1)[0]
> (I don't know how to write something similar to ancestor)
>
> And what would happen if the target of the invoke/send is an
> ecmascript scxml with the var1 as a top most id what would the result be?
>
> If it instead is a xpath scxml what would be the result?
>
> Best regards,
>
> Jon
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Namelist continued

Jon Kerny
Hi, 

thanks for the clarification. I think that part of my confusion came from that it wasn't useful in the xpath model and thus it didn't make sense to me, and I felt that there was something I didn't understand.

Thanks.

/Jon

On Sat, Sep 26, 2015 at 5:58 PM, Jim Barnett <[hidden email]> wrote:
One further thought on the XPath data model and namelist.   The XPath data model  _could_ be modified to say "for the purposes of passing a namelist into invoke, the namelist attribute '$foo' shall be considered to match <data id="foo"/>.    We didn't do that, because we didn't expect 'namelist' to be useful everywhere. However, the XPath data mode is not part of the final specification, and is thus not a 'standard' at all, so people working with it have some flexibility.

- Jim

On 9/26/2015 9:12 AM, Jon Kerny wrote:
HI,

I saw that there previously has been some discussions about the namelist, and that at least in some parts my questions has been adressed. But I feel that this is quite complicated.

In my understanding, namelist is a shorthand for param, but this name thing makes it more complicated than param where name is set explicitly in code.


Here are some examples I'd like to get comments on:

What would be the names in an Xpath scxml if the following location expressions was used in a namelist?

$var1
$var1/children
$var1/children[last()]
ancestor::$var1/children[last()]"

If the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

And in the opposite direction, what would the names of an ecmascript datamodel be for the following location expressions in namelist?
var1
var1.children
var1.children.slice(-1)[0]
(I don't know how to write something similar to ancestor)

And what would happen if the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

Best regards,

Jon





Reply | Threaded
Open this post in threaded view
|

Re: Namelist continued

Jon Kerny
Hi,

I'm making the final fixes to my scxml interpreter. to make it compliant with the testcase suite. Currently there is only four testcases that fail for xpath, 241, 244, 240 and 354. (240, and 354 uses the strange data/data/data syntax)

241 uses $var1 in namelist and of invoke and tries to match to var1 in invoked machine. So from your comments earlier I think that 241 and 244 shall fail for Xpath?

Thanks again for you great job, and your patient replies.

/Jon

On Sat, Sep 26, 2015 at 6:16 PM, Jon Kerny <[hidden email]> wrote:
Hi, 

thanks for the clarification. I think that part of my confusion came from that it wasn't useful in the xpath model and thus it didn't make sense to me, and I felt that there was something I didn't understand.

Thanks.

/Jon

On Sat, Sep 26, 2015 at 5:58 PM, Jim Barnett <[hidden email]> wrote:
One further thought on the XPath data model and namelist.   The XPath data model  _could_ be modified to say "for the purposes of passing a namelist into invoke, the namelist attribute '$foo' shall be considered to match <data id="foo"/>.    We didn't do that, because we didn't expect 'namelist' to be useful everywhere. However, the XPath data mode is not part of the final specification, and is thus not a 'standard' at all, so people working with it have some flexibility.

- Jim

On 9/26/2015 9:12 AM, Jon Kerny wrote:
HI,

I saw that there previously has been some discussions about the namelist, and that at least in some parts my questions has been adressed. But I feel that this is quite complicated.

In my understanding, namelist is a shorthand for param, but this name thing makes it more complicated than param where name is set explicitly in code.


Here are some examples I'd like to get comments on:

What would be the names in an Xpath scxml if the following location expressions was used in a namelist?

$var1
$var1/children
$var1/children[last()]
ancestor::$var1/children[last()]"

If the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

And in the opposite direction, what would the names of an ecmascript datamodel be for the following location expressions in namelist?
var1
var1.children
var1.children.slice(-1)[0]
(I don't know how to write something similar to ancestor)

And what would happen if the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

Best regards,

Jon






Reply | Threaded
Open this post in threaded view
|

Re: Namelist continued

Jim Barnett
Given the unfinished state of the XPath data model, I think you are right. If we ever decide to finish it, we might add language to the effect that '$var' should be considered to match 'var' in the XPath data model.  

As it is, namelist is not useful with XPath. If you can find a way to make it useful in your implementation, feel free to go ahead even if you deviate from the language in the spec. As it stands, the XPath data model is not a standard. 

Jim Barnett
Genesys

On May 5, 2016, at 12:32 PM, Jon Kerny <[hidden email]> wrote:

Hi,

I'm making the final fixes to my scxml interpreter. to make it compliant with the testcase suite. Currently there is only four testcases that fail for xpath, 241, 244, 240 and 354. (240, and 354 uses the strange data/data/data syntax)

241 uses $var1 in namelist and of invoke and tries to match to var1 in invoked machine. So from your comments earlier I think that 241 and 244 shall fail for Xpath?

Thanks again for you great job, and your patient replies.

/Jon

On Sat, Sep 26, 2015 at 6:16 PM, Jon Kerny <[hidden email]> wrote:
Hi, 

thanks for the clarification. I think that part of my confusion came from that it wasn't useful in the xpath model and thus it didn't make sense to me, and I felt that there was something I didn't understand.

Thanks.

/Jon

On Sat, Sep 26, 2015 at 5:58 PM, Jim Barnett <[hidden email]> wrote:
One further thought on the XPath data model and namelist.   The XPath data model  _could_ be modified to say "for the purposes of passing a namelist into invoke, the namelist attribute '$foo' shall be considered to match <data id="foo"/>.    We didn't do that, because we didn't expect 'namelist' to be useful everywhere. However, the XPath data mode is not part of the final specification, and is thus not a 'standard' at all, so people working with it have some flexibility.

- Jim

On 9/26/2015 9:12 AM, Jon Kerny wrote:
HI,

I saw that there previously has been some discussions about the namelist, and that at least in some parts my questions has been adressed. But I feel that this is quite complicated.

In my understanding, namelist is a shorthand for param, but this name thing makes it more complicated than param where name is set explicitly in code.


Here are some examples I'd like to get comments on:

What would be the names in an Xpath scxml if the following location expressions was used in a namelist?

$var1
$var1/children
$var1/children[last()]
ancestor::$var1/children[last()]"

If the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

And in the opposite direction, what would the names of an ecmascript datamodel be for the following location expressions in namelist?
var1
var1.children
var1.children.slice(-1)[0]
(I don't know how to write something similar to ancestor)

And what would happen if the target of the invoke/send is an ecmascript scxml with the var1 as a top most id what would the result be?

If it instead is a xpath scxml what would be the result?

Best regards,

Jon