use of org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis in project webtools.sourceediting by eclipse.
the class DefaultEvaluator method root_self_node.
private ResultSequence root_self_node() {
Axis axis = new SelfAxis();
ResultBuffer buffer = new ResultBuffer();
// XXX the cast!!!
axis.iterate((NodeType) focus().context_item(), buffer, _dc.getLimitNode());
ResultSequence rs = kind_test(buffer.getSequence(), NodeType.class);
List records = new ArrayList();
records.add(rs);
rs = FnRoot.fn_root(records, _ec);
return rs;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.SelfAxis in project webtools.sourceediting by eclipse.
the class ancestorOrSelfAxisTest method test_unabbreviatedSyntax_11.
// Evaluates unabbreviated syntax - ancestor-or-self::employee - Selects all the "employee" ancestors of the context node (selects employee, if the context node is "employee").
public void test_unabbreviatedSyntax_11() throws Exception {
String inputFile = "/TestSources/works-mod.xml";
String xqFile = "/Queries/XQuery/FullAxis/ancestor-or-selfAxis/unabbreviatedSyntax-11.xq";
String resultFile = "/ExpectedTestResults/FullAxis/ancestor-or-selfAxis/unabbreviatedSyntax-11.txt";
String expectedResult = getExpectedResult(resultFile);
URL fileURL = bundle.getEntry(inputFile);
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = extractXPathExpression(xqFile, inputFile);
String actual = null;
try {
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
actual = buildXMLResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
Aggregations