[kepler-users] Extracting XML Attributes

Jon Goodall goodall at engr.sc.edu
Mon Oct 6 05:41:47 PDT 2008


Hello,

I'm trying to extract XML attributes from a web service in Kepler and
could use some help.  I've tried doing this a couple different ways.
First, I tried the following xpath query:
/timeSeriesResponse/timeSeries/values/value/@dateTime and the
exception is ...

ptolemy.kernel.util.IllegalActionException: XPath: node selected with
XPath isn't an element.
       at org.sdm.spa.XPath.fire(XPath.java:167)
       at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:398)
       at ptolemy.actor.sched.StaticSchedulingDirector.fire(StaticSchedulingDirector.java:170)
       at ptolemy.actor.CompositeActor.fire(CompositeActor.java:400)
       at ptolemy.actor.Manager.iterate(Manager.java:688)
       at ptolemy.actor.Manager.execute(Manager.java:332)
       at ptolemy.actor.Manager.run(Manager.java:1071)
       at ptolemy.actor.Manager$3.run(Manager.java:1112)

The xpath query /timeSeriesResponse/timeSeries/values/value works fine
and gives this response ..

send to channel 0: {<value dateTime="2000-01-01T00:00:00"
qualifiers="A">483</value>, <value dateTime="2000-01-02T00:00:00"
qualifiers="A">464</value> ...

I've also tried using an XMLDisassembler actor to access the dateTime
attributes, but no luck.  I was able to get the values, but unable to
get the dateTimes (I tried setting the port name to @dateTime and to
dateTime).  See attached workflow for details.

One other thing to note is that this service I'm using can return
either simple or complex types.  Right now, I'm working with the
simple type, which is a XML string.  I tried using the complex web
service actor, but still was unable to get at the dateTime attributes.
 If you want to try this yourself, the service is
http://river.sdsc.edu/wateroneflow/NWIS/DailyValues.asmx?WSDL.  The
method GetValues returns the XML string, the method GetValuesObject
returns a complex type.

The workflow is attached if you want to take a look.  The goal is
simply to create a chart of the streamflow time series.  I would
appreciate any help on this.  Thanks in advance!

Jon

Jonathan Goodall
Civil and Environmental Engineering
University of South Carolina
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plotting_wof.xml
Type: text/xml
Size: 76645 bytes
Desc: not available
URL: <http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-users/attachments/20081006/e437cc1f/attachment-0001.xml>


More information about the Kepler-users mailing list