[Laszlo-dev] loading of datasets within a view ?

ddwoske at loraxis.com ddwoske at loraxis.com
Wed Jun 15 08:10:21 PDT 2005


Newbie here.  I know so little, I don't even know how to properly title
this thread.

My data is in several xml files and I want to combine them and look at a
summary table.

I want to see this:

id       study       experiment     status
-----------------------------------------------
1053     myStudy     MyExperiment   pending
1054     myStudy2    MyExperiment2  pending
1        myStudy3    MyExperiment3  inprogress
...

Top level file named queue.xml .. looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<queue>
	<status value="pending">
		<request id="1053" />
		<request id="1054" />
	</status>
	<status value="inprogress">
		<request id="1" />
		<request id="2" />
		<request id="3" />
	</status>
</queue>

And the details of each request are in different files based on their id. 
For now, let's just look at a file called basics.xml.

E.G.  This lives in directory requests/1053 where 1053 is the request id.
requests/1053/basics.xml

in there, we have:

<?xml version="1.0" encoding="UTF-8"?>
<request>
    <id>1</id>
    <status>pending</status>
    <experiment>MyExperiment</experiment>
    <study>MyStudy</study>
</request>

I want to change the src of the 'details' dataset depending on which item
in the queue I am currently looking at.  My first (and feeble) attempt is
this, which doesn't work for several reasons.  I apparently can't nest a
script tag like that, and the requests/@id/basics.xml doesn't do the XPath
substitution.  Obviously I have no idea what I'm doing.

<canvas>
  <dataset name="dset" src="queue.xml"/>
  <dataset name="basics" src="stubbed-out-until-i-know-what-to-load"/>

<simplelayout axis="y"/>

  <view datapath="dset:/queue/status/request">
     <script>
         var d = canvas.datasets.basics;
         d.setAttribute('src', 'requests/@id/basics.xml"/>
     </script>

    <simplelayout axis="x"/>
    <text datapath="@id"/>
    <text datapath="basics:/request/study"/>
    <text datapath="basics:/request/experiment"/>
    <text datapath="basics:/request/status"/>
  </view>
</canvas>

I couldn't find any examples to help me along these lines, and I just
don't have any idea about how to override methods, or plug into hooks, or
whatever it takes to get this done.

Thanks for any help.

Donald







More information about the Laszlo-dev mailing list