use of org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr in project webtools.sourceediting by eclipse.
the class Normalizer method make_function.
private XPathExpr make_function(QName name, Collection args) {
FunctionCall fc = new FunctionCall(name, args);
FilterExpr fe = new FilterExpr(fc, new ArrayList());
return new XPathExpr(0, fe);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr in project webtools.sourceediting by eclipse.
the class Normalizer method visit.
/**
* @param e
* is the filter expression.
* @return e
*/
public Object visit(FilterExpr e) {
PrimaryExpr pe = (PrimaryExpr) e.primary().accept(this);
e.set_primary(pe);
printCollExprs(e.iterator());
return e;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr in project webtools.sourceediting by eclipse.
the class FilterExprTest method test_filterexpressionhc6.
// Simple filter expression involving the "ge" operator.
public void test_filterexpressionhc6() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc6.xq";
String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc6.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 = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr in project webtools.sourceediting by eclipse.
the class FilterExprTest method test_filterexpressionhc15.
// Simple filter expression involving an addition expression.
public void test_filterexpressionhc15() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc15.xq";
String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc15.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 = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.FilterExpr in project webtools.sourceediting by eclipse.
the class FilterExprTest method test_filterexpressionhc21.
// Simple filter expression involving the "fn:true" function.
public void test_filterexpressionhc21() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc21.xq";
String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc21.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 = buildResultString(rs);
} catch (XPathParserException ex) {
actual = ex.code();
} catch (StaticError ex) {
actual = ex.code();
} catch (DynamicError ex) {
actual = ex.code();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
Aggregations