commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudeep Gandhe <gan...@usc.edu>
Subject [SCXML] problems with Data() function in Jexl
Date Sun, 09 Dec 2007 01:46:05 GMT
I tried the following scxml file with the StandaloneJexlExpressions. I don't get the correct
value for "Data(d, '//tar/@name')". Can you explain, what's wrong ?

-- Sudeep

SCXML file :

<?xml version="1.0"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"  version="1.0" initialstate="first">

<datamodel>
         <data name="d">
                 <foo xmlns="">
                         <bar>
                                 <tar name="po">12</tar>
                         </bar>
                 </foo>
         </data>
         <data name="p">
                 <one xmlns=""/>
         </data>
</datamodel>

<state id="first">
         <onentry>
                 <log label="//tar" expr="Data(d, '//tar')"/>
                 <!-- //tar/@name doesn't work -->
                 <log label="//tar/@name" expr="Data(d, '//tar/@name')"/>
                 <log label="foo/bar/tar" expr="Data(d, 'foo/bar/tar')"/>
                 <!-- foo/bar/tar/@name  works -->
                 <log label="foo/bar/tar/@name" expr="Data(d, 'foo/bar/tar/@name')"/>
         </onentry>
         <transition event="first.done" target="second"/>
         <onexit>
                 <assign location="Data(p, 'one')" expr="Data(d, '//bar')"/>
         </onexit>
</state>

<state id="second" final="true">
         <onentry>
                 <log label="//tar" expr="Data(p, '//tar')"/>
                 <!-- //tar/@name doesn't work -->
                 <log label="//tar/@name" expr="Data(p, '//tar/@name')"/>
                 <!-- one/tar/@name  works -->
                 <log label="one/tar/@name" expr="Data(p, 'one/tar/@name')"/>
         </onentry>
</state>
</scxml>



Mime
View raw message