use of org.eclipse.wst.xml.xpath2.processor.internal.Axis in project webtools.sourceediting by eclipse.
the class STAxesTest method test_ST_Axes001.
// self:: axis with explicit name test called on set of nodes which do not contain any nodes of this name.
public void test_ST_Axes001() throws Exception {
String inputFile = "/TestSources/TreeCompass.xml";
String xqFile = "/Queries/XQuery/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes001.xq";
String expectedResult = "XPST0005";
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.Axis in project webtools.sourceediting by eclipse.
the class STAxesTest method test_statictypingaxis_4.
// Evaluates static typing on parent axis. Context item not a node.
public void test_statictypingaxis_4() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/StaticTyping/STPathExpr/STSteps/STAxes/statictypingaxis-4.xq";
String expectedResult = "XPTY0019";
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.Axis in project webtools.sourceediting by eclipse.
the class STAxesTest method test_statictypingaxis_5.
// Evaluates static typing on descendant axis. Context item not a node.
public void test_statictypingaxis_5() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/StaticTyping/STPathExpr/STSteps/STAxes/statictypingaxis-5.xq";
String expectedResult = "XPTY0019";
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.Axis in project webtools.sourceediting by eclipse.
the class STAxesTest method test_statictypingaxis_1.
// Evaluates static typing on child axis. Context item not a node.
public void test_statictypingaxis_1() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/StaticTyping/STPathExpr/STSteps/STAxes/statictypingaxis-1.xq";
String expectedResult = "XPTY0019";
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.Axis in project webtools.sourceediting by eclipse.
the class STAxesTest method test_statictypingaxis_2.
// Evaluates static typing on self axis. Context item not a node.
public void test_statictypingaxis_2() throws Exception {
String inputFile = "/TestSources/emptydoc.xml";
String xqFile = "/Queries/XQuery/StaticTyping/STPathExpr/STSteps/STAxes/statictypingaxis-2.xq";
String expectedResult = "XPTY0019";
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