Question

I am currently looking to integrate VTD-XML in to our project (as a replacement of a Stax based system).

Our xml files are mostly structured like this:

<header>
  <entry1 timestamp="0"/>
  <entry2 timestamp="1"/>
  <entry1 timestamp="2"/>
  <entry2 timestamp="3"/>
</header>

Is there a way to get VTD-XML to recognize that the timestamps are strictly ordered and to abort a xpath query like /header/*[@timestamp < 2] early?

Was it helpful?

Solution

not that i'm aware of. But you could select the last node:

/header/*[@timestamp = 2]

and then use selectPrecedingNode()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top