LFC-$29.lzx
<canvas height="80">
<simplelayout spacing="5"/>
<dataset name="mydata">
<record> This is some text
<deeper>
<deeprecord> This is a deeper level </deeprecord>
<deeprecord> It's dark down here! </deeprecord>
<deeprecord> Last deep record </deeprecord>
</deeper>
</record>
<record> This is more text </record>
<record> Exciting no? </record>
<record> The final line of text </record>
</dataset>
<view>
<simplelayout/>
<datapointer id="mydp" xpath="mydata:/record[1]"/>
<button> Move forward with select
<handler name="onclick">
if (mydp.selectNext()) var s = mydp.getNodeText();
else var s = "hit last record; reset with xpath";
output.setText(s);
</handler>
</button>
<button> Set with XPath
<handler name="onclick">
if (mydp.getNodeName() == "record")
var xp = "mydata:/record[1]/deeper/deeprecord[1]";
else var xp = "mydata:/record[1]";
mydp.setXPath( xp ); output.setText(mydp.getNodeText());
</handler>
</button>
</view>
<text name="output" width="200">Data will appear here.</text>
</canvas>
Cross References
Named Instances