You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jaroslav Pullmann <ja...@fit.fraunhofer.de> on 2008/12/10 16:38:03 UTC

[SCXML] Help with Data()

  Dear all,

  could you please give me a short hint on these questions ?

   1) where to find documentation and source code for the "Data"-function for JEXL evaluator ?
      I need to clarify which subset of XPath is supported.

   2) there is no "name" attribute on <data> in current working draft, but Data() depends on it:


       a) <data ID="foo"><foo>bar</foo></data>
       b) <data name="foo"><foo>bar</foo></data>

     the action <log expr="Data(foo,'node()')"/>

     - throws an error for a: Data(): Cannot evaluate an XPath expression in the absence of a context Node
     - returns "bar" for b)

    Will the Data() implementation be adapted to the spec ?

  3) How to address nodes in a specific namespace via Data() ?

       <data name="foo"><f:foo xmlns:f="fooNS"><baz>bar</baz></f:foo></data>
       <!-- how to address f:foo ? -->
       <log expr="Data(foo,'foo')"/>

  4) assign supports static source-URLs via @src. Is there a way to supply an srcexpr,
   or what would be the recommended way to perform and store XML data from parametrized GET-requests ?

   broken example:

     <data ID="MyId">3q495</data>
     <assign location="Data(test,'response')" expr=" 'http://localhost:8080/exist/ess/queries/getData.xqy?id=' + MyId "/>

   Many thanks !
    Jaro


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [SCXML] Help with Data()

Posted by Rahul Akolkar <ra...@gmail.com>.
On Thu, Dec 11, 2008 at 5:40 AM, Jaroslav Pullmann
<ja...@fit.fraunhofer.de> wrote:
>
>  Dear Rahul,
>
>  your quick response and dedication to the project are very appreciated!
>
>  Suprisingly the last WD does not contain the assign/@src anymore.
>  I hope this decision will be revised to preserve a standard means
>  to access remote data and assign it to the (static) data model.
>
>  Your proposal to interpret assign/@src as an expression follows
>  the way how e.g. send/@target is treated. This shortcut syntax
>  (ommiting @srcexpr) would be fine, when consistent and intuitive
>  throughout the spec. Such, exceptions like invoke/@srcexpr should
>  be removed. Could you please address this question within the
>  working group ?
>
<snip/>

I noticed the absence of assign/@src right after I sent out the email below :-)

I agree with you on both the points above (reintroduction of "src" for
<assign> and removing "srcexpr" for <invoke>). I will indeed bring
this up to the WG's attention (may take a bit of time since we are
largely on year-end break). I've opened SCXML-102 to facilitate
tracking this:

  http://issues.apache.org/jira/browse/SCXML-102

-Rahul



>  Best regards
>    Jaroslav
>
>
> Rahul Akolkar wrote:
>>
>> On Wed, Dec 10, 2008 at 10:38 AM, Jaroslav Pullmann
>> <ja...@fit.fraunhofer.de> wrote:
>>>
>>>  Dear all,
>>>
>>>  could you please give me a short hint on these questions ?
>>>
>>>  1) where to find documentation and source code for the "Data"-function
>>> for
>>> JEXL evaluator ?
>>>    I need to clarify which subset of XPath is supported.
>>>
>> <snip/>
>>
>> There is some documentation of this page (towards the bottom):
>>
>>  http://commons.apache.org/scxml/guide/datamodel.html
>>
>> Source is here, for example (trunk version):
>>
>>
>>  http://commons.apache.org/scxml/xref/org/apache/commons/scxml/Builtin.html
>>
>>
>>>  2) there is no "name" attribute on <data> in current working draft, but
>>> Data() depends on it:
>>>
>>>
>>>     a) <data ID="foo"><foo>bar</foo></data>
>>>     b) <data name="foo"><foo>bar</foo></data>
>>>
>>>   the action <log expr="Data(foo,'node()')"/>
>>>
>>>   - throws an error for a: Data(): Cannot evaluate an XPath expression in
>>> the absence of a context Node
>>>   - returns "bar" for b)
>>>
>>>  Will the Data() implementation be adapted to the spec ?
>>>
>> <snap/>
>>
>> In this case, it happens to be the other way around :-)
>>
>> The casing of the ID attribute (all uppercase) in the draft was
>> unfortunate, and this has been discussed (and in all likelihood will
>> change to lowercase in the next draft). So, please use lowercase i.e.
>>
>>  <data id="foo"><foo>bar</foo></data>
>>
>>
>>>  3) How to address nodes in a specific namespace via Data() ?
>>>
>>>     <data name="foo"><f:foo xmlns:f="fooNS"><baz>bar</baz></f:foo></data>
>>>     <!-- how to address f:foo ? -->
>>>     <log expr="Data(foo,'foo')"/>
>>>
>> <snip/>
>>
>> I'm running out of time for email, so let me point to a fairly
>> comprehensive test case SCXML document that demonstrates use of
>> namespace prefixes in XPath expressions (the bottom line is prefixes
>> in an expression are resolved based on the enclosing namespace
>> declarations at the location where the expression occurs in the
>> document -- and so these prefixes may be different from the prefixes
>> specified in the <data>). Here is the test document (long URL, may get
>> fragmented):
>>
>>
>>  http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/datamodel-03.xml
>>
>> Please feel free to bring up anything that isn't clear after going
>> through that test document.
>>
>>
>>>  4) assign supports static source-URLs via @src. Is there a way to supply
>>> an
>>> srcexpr,
>>>  or what would be the recommended way to perform and store XML data from
>>> parametrized GET-requests ?
>>>
>>>  broken example:
>>>
>>>   <data ID="MyId">3q495</data>
>>>   <assign location="Data(test,'response')" expr="
>>> 'http://localhost:8080/exist/ess/queries/getData.xqy?id=' + MyId "/>
>>>
>> <snap/>
>>
>> I think the src attribute value should be evaluated as an expression
>> (that way, there isn't any need for another srcexpr attribute and
>> static URLs / string attribute values can be surrounded by single
>> quotes if needed). This will cover usecases as illustrated by your
>> example above.
>>
>> Please open an enhancement request in JIRA [1] so we remember this,
>> thanks.
>>
>> -Rahul
>>
>> [1] http://commons.apache.org/scxml/issue-tracking.html
>>
>>
>>>  Many thanks !
>>>  Jaro
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
>
> --
> Jaroslav Pullmann
> Web Compliance Center - Fraunhofer FIT
> Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
> Phone: +49-2241-142623    Fax: +49-2241-142065
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [SCXML] Help with Data()

Posted by Jaroslav Pullmann <ja...@fit.fraunhofer.de>.
  Dear Rahul,

   your quick response and dedication to the project are very appreciated!

  Suprisingly the last WD does not contain the assign/@src anymore.
  I hope this decision will be revised to preserve a standard means
  to access remote data and assign it to the (static) data model.

  Your proposal to interpret assign/@src as an expression follows
  the way how e.g. send/@target is treated. This shortcut syntax
  (ommiting @srcexpr) would be fine, when consistent and intuitive
  throughout the spec. Such, exceptions like invoke/@srcexpr should
  be removed. Could you please address this question within the
  working group ?

   Best regards
     Jaroslav


Rahul Akolkar wrote:
> On Wed, Dec 10, 2008 at 10:38 AM, Jaroslav Pullmann
> <ja...@fit.fraunhofer.de> wrote:
>>  Dear all,
>>
>>  could you please give me a short hint on these questions ?
>>
>>  1) where to find documentation and source code for the "Data"-function for
>> JEXL evaluator ?
>>     I need to clarify which subset of XPath is supported.
>>
> <snip/>
> 
> There is some documentation of this page (towards the bottom):
> 
>   http://commons.apache.org/scxml/guide/datamodel.html
> 
> Source is here, for example (trunk version):
> 
>   http://commons.apache.org/scxml/xref/org/apache/commons/scxml/Builtin.html
> 
> 
>>  2) there is no "name" attribute on <data> in current working draft, but
>> Data() depends on it:
>>
>>
>>      a) <data ID="foo"><foo>bar</foo></data>
>>      b) <data name="foo"><foo>bar</foo></data>
>>
>>    the action <log expr="Data(foo,'node()')"/>
>>
>>    - throws an error for a: Data(): Cannot evaluate an XPath expression in
>> the absence of a context Node
>>    - returns "bar" for b)
>>
>>   Will the Data() implementation be adapted to the spec ?
>>
> <snap/>
> 
> In this case, it happens to be the other way around :-)
> 
> The casing of the ID attribute (all uppercase) in the draft was
> unfortunate, and this has been discussed (and in all likelihood will
> change to lowercase in the next draft). So, please use lowercase i.e.
> 
>   <data id="foo"><foo>bar</foo></data>
> 
> 
>>  3) How to address nodes in a specific namespace via Data() ?
>>
>>      <data name="foo"><f:foo xmlns:f="fooNS"><baz>bar</baz></f:foo></data>
>>      <!-- how to address f:foo ? -->
>>      <log expr="Data(foo,'foo')"/>
>>
> <snip/>
> 
> I'm running out of time for email, so let me point to a fairly
> comprehensive test case SCXML document that demonstrates use of
> namespace prefixes in XPath expressions (the bottom line is prefixes
> in an expression are resolved based on the enclosing namespace
> declarations at the location where the expression occurs in the
> document -- and so these prefixes may be different from the prefixes
> specified in the <data>). Here is the test document (long URL, may get
> fragmented):
> 
>   http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/datamodel-03.xml
> 
> Please feel free to bring up anything that isn't clear after going
> through that test document.
> 
> 
>>  4) assign supports static source-URLs via @src. Is there a way to supply an
>> srcexpr,
>>  or what would be the recommended way to perform and store XML data from
>> parametrized GET-requests ?
>>
>>  broken example:
>>
>>    <data ID="MyId">3q495</data>
>>    <assign location="Data(test,'response')" expr="
>> 'http://localhost:8080/exist/ess/queries/getData.xqy?id=' + MyId "/>
>>
> <snap/>
> 
> I think the src attribute value should be evaluated as an expression
> (that way, there isn't any need for another srcexpr attribute and
> static URLs / string attribute values can be surrounded by single
> quotes if needed). This will cover usecases as illustrated by your
> example above.
> 
> Please open an enhancement request in JIRA [1] so we remember this, thanks.
> 
> -Rahul
> 
> [1] http://commons.apache.org/scxml/issue-tracking.html
> 
> 
>>  Many thanks !
>>   Jaro
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


-- 
Jaroslav Pullmann
Web Compliance Center - Fraunhofer FIT
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142623    Fax: +49-2241-142065

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [SCXML] Help with Data()

Posted by Rahul Akolkar <ra...@gmail.com>.
On Wed, Dec 10, 2008 at 10:38 AM, Jaroslav Pullmann
<ja...@fit.fraunhofer.de> wrote:
>
>  Dear all,
>
>  could you please give me a short hint on these questions ?
>
>  1) where to find documentation and source code for the "Data"-function for
> JEXL evaluator ?
>     I need to clarify which subset of XPath is supported.
>
<snip/>

There is some documentation of this page (towards the bottom):

  http://commons.apache.org/scxml/guide/datamodel.html

Source is here, for example (trunk version):

  http://commons.apache.org/scxml/xref/org/apache/commons/scxml/Builtin.html


>  2) there is no "name" attribute on <data> in current working draft, but
> Data() depends on it:
>
>
>      a) <data ID="foo"><foo>bar</foo></data>
>      b) <data name="foo"><foo>bar</foo></data>
>
>    the action <log expr="Data(foo,'node()')"/>
>
>    - throws an error for a: Data(): Cannot evaluate an XPath expression in
> the absence of a context Node
>    - returns "bar" for b)
>
>   Will the Data() implementation be adapted to the spec ?
>
<snap/>

In this case, it happens to be the other way around :-)

The casing of the ID attribute (all uppercase) in the draft was
unfortunate, and this has been discussed (and in all likelihood will
change to lowercase in the next draft). So, please use lowercase i.e.

  <data id="foo"><foo>bar</foo></data>


>  3) How to address nodes in a specific namespace via Data() ?
>
>      <data name="foo"><f:foo xmlns:f="fooNS"><baz>bar</baz></f:foo></data>
>      <!-- how to address f:foo ? -->
>      <log expr="Data(foo,'foo')"/>
>
<snip/>

I'm running out of time for email, so let me point to a fairly
comprehensive test case SCXML document that demonstrates use of
namespace prefixes in XPath expressions (the bottom line is prefixes
in an expression are resolved based on the enclosing namespace
declarations at the location where the expression occurs in the
document -- and so these prefixes may be different from the prefixes
specified in the <data>). Here is the test document (long URL, may get
fragmented):

  http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/datamodel-03.xml

Please feel free to bring up anything that isn't clear after going
through that test document.


>  4) assign supports static source-URLs via @src. Is there a way to supply an
> srcexpr,
>  or what would be the recommended way to perform and store XML data from
> parametrized GET-requests ?
>
>  broken example:
>
>    <data ID="MyId">3q495</data>
>    <assign location="Data(test,'response')" expr="
> 'http://localhost:8080/exist/ess/queries/getData.xqy?id=' + MyId "/>
>
<snap/>

I think the src attribute value should be evaluated as an expression
(that way, there isn't any need for another srcexpr attribute and
static URLs / string attribute values can be surrounded by single
quotes if needed). This will cover usecases as illustrated by your
example above.

Please open an enhancement request in JIRA [1] so we remember this, thanks.

-Rahul

[1] http://commons.apache.org/scxml/issue-tracking.html


>  Many thanks !
>   Jaro
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org