use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.
the class FileSystemWatcher method findNode.
/**
* Find node corresponding to the path. The {@link XdmNodeWriteTrx} globally used is moved to the
* found node.
*
* @param query xpath expression
* @throws SirixXPathException if expression isn't valid
* @throws NullPointerException if {@code pXPath} is {@code null}
*/
private void findNode(final String query) throws SirixXPathException {
final Axis axis = new XPathAxis(mWtx, checkNotNull(query));
int countResults = 0;
long resultNodeKey = Fixed.NULL_NODE_KEY.getStandardProperty();
while (axis.hasNext()) {
resultNodeKey = axis.next();
countResults++;
assert countResults == 1 : "At maximum one item should be found!";
}
mWtx.moveTo(resultNodeKey);
}
use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.
the class FunctionsXMarkTest method testDistinctValues.
/**
* Test function distinct-values().
*
* @throws SirixXPathException
*/
@Ignore
@Test
public final void testDistinctValues() throws SirixXPathException {
final String query = "fn:distinct-values(/site/open_auctions/open_auction/bidder[personref[@person=\"person2436\"]]/increase)";
final String result = "12.00";
XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.
the class FunctionsXMarkTest method testId.
/**
* Test function id().
*
* @throws SirixXPathException
*/
@Ignore
@Test
public final void testId() throws SirixXPathException {
final String query = "fn:id(/site/people/person[@id=\"person1\"]/watches/watch/@open_auction)";
final String result = "";
XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.
the class FunctionsXMarkTest method testPosition.
/**
* Test function position().
*
* @throws SirixXPathException
*/
@Ignore
@Test
public final void testPosition() throws SirixXPathException {
final String query = "/site/open_auctions/open_auction/bidder/increase[position()=1]";
final String result = "<increase>10.50</increase>";
XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
use of org.sirix.service.xml.xpath.XPathAxis in project sirix by sirixdb.
the class FunctionsXMarkTest method testString.
/**
* Test function string().
*
* @throws SirixXPathException
*/
@Ignore
@Test
public final void testString() throws SirixXPathException {
final String query = "fn:string(/site/people/person[@id=\"person3\"]/name)";
final String result = "Limor Simone";
XPathStringChecker.testIAxisConventions(new XPathAxis(holder.getReader(), query), new String[] { result });
}
Aggregations