PDA

View Full Version : xpath predicate support


mschweiger
11-21-2005, 07:04 PM
There have been some previous threads on this subject. I can get the predicate function to work with the attribute. The trouble is I don't want to have to munge the data into an attribute and would prefer to keep it as an data element. I have just tried this in release 3.1.

1. In which document can I find exactly which portions of Xpath are implimented?

2. Is my Xpath predicate in the code below to select by element value correct?

<canvas>
<dataset name="help">
<help>
<helpItem topicAttr="topic 1">
<topic>Topic One</topic>
<content>Topic 1 stuff.
</content>
</helpItem>

<helpItem topicAttr="topic 2">
<topic>Topic Two</topic>
<content>Topic 2 stuff.
</content>
</helpItem>
</help>
</dataset>

<view >
<simplelayout axis="y"/>
<text>test begin</text>

<!-- search by attribute that works -->
<text datapath="help:/help/helpItem[@topicAttr='topic 1']/content/text()" />

<!-- search by element predicate that doesn't work -->
<text datapath="help:/help/helpItem[topic='Topic Two']/content/text()" />

<text>test end</text>
</view>
</canvas>

3. If the selection predicate is correct when will predicate support be implimented.