use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class PredicatesTest method test_predicatesns_11.
// Evaluation of a simple predicate, that uses the "xs:float()" function. Not Schema dependent.
public void test_predicatesns_11() throws Exception {
String inputFile = "/TestSources/atomicns.xml";
String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-11.xq";
String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-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();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class PredicatesTest method test_predicatesns_8.
// Evaluation of a simple predicate, that uses the "xs:string() function. Not Schema dependent.
public void test_predicatesns_8() throws Exception {
String inputFile = "/TestSources/atomicns.xml";
String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-8.xq";
String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-8.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();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class PredicatesTest method test_predicates_11.
// Evaluation of a simple predicate, that uses the "xs:float()" function.
public void test_predicates_11() throws Exception {
String inputFile = "/TestSources/atomicns.xml";
String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-11.xq";
String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-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();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class PredicatesTest method test_predicatesns_12.
// Evaluation of a simple predicate, that uses the "xs:double()" function. Not Schema dependent.
public void test_predicatesns_12() throws Exception {
String inputFile = "/TestSources/atomicns.xml";
String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-12.xq";
String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-12.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();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
use of org.eclipse.wst.xml.xpath2.api.Function in project webtools.sourceediting by eclipse.
the class PredicatesTest method test_predicatesns_13.
// Evaluation of a simple predicate, that uses the "xs:boolean()" function. Not Schema dependent.
public void test_predicatesns_13() throws Exception {
String inputFile = "/TestSources/atomicns.xml";
String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicatesns-13.xq";
String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicatesns-13.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();
}
assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
}
Aggregations