commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ingmar Kliche" <ingmar.kli...@googlemail.com>
Subject [SCXML] Difficulties with XPath expression on XML attributes
Date Fri, 13 Jul 2007 20:21:22 GMT
I have difficuties to select a node using XPath. I use an EMMA XML
repesented input:

<emma:emma version="1.0"
    xmlns:emma="http://www.w3.org/2003/04/emma"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3.org/2003/04/emma
     http://www.w3.org/TR/2007/WD-emma-20070409/emma.xsd"
    xmlns="http://www.example.com/example">
  <emma:one-of id="r1" emma:start="1087995961542" emma:end="1087995963542">
    <emma:interpretation id="int1" emma:confidence="0.75"
    emma:tokens="flights from boston to denver">
      <origin>Boston</origin>
      <destination>Denver</destination>
    </emma:interpretation>

    <emma:interpretation id="int2" emma:confidence="0.68"
    emma:tokens="flights from austin to denver">
      <origin>Austin</origin>
      <destination>Denver</destination>
    </emma:interpretation>
  </emma:one-of>
</emma:emma>

taken from [1]. This EMMA document is parsed into its DOM and passed into
the engine (attached to the eventdata). Now I'd like to select the <origin>
out of the first interpretation. I tried to use the following statement:

<transition event="emma" xmlns:emma=http://www.w3.org/2003/04/emma
cond="Data(_eventdata.emma,'/emma:emma/emma:one-of/emma:interpretation[@id='int1']/origin')
eq 'Boston'" target="twenty" />

I think the XPath itself is correct, but unfortunately the overall statement
is not a valid JEXL statement anymore (as of the ' around "int1"). How
should I select the value of the attribute to make it a valid statement? I
tried to escape using \ , but it did not work.

Any suggestion?

- Ingmar.

[1] http://www.w3.org/TR/emma

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message