use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testAttrNode_Test5.
public void testAttrNode_Test5() throws Exception {
// Bug 298535
URL fileURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "Example/x[1]/@mesg instance of attribute(mesg, mesg_Type)";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testAttrNode_Test3.
public void testAttrNode_Test3() throws Exception {
// Bug 298535
URL fileURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "Example/x[1]/@mesg instance of attribute(*, mesg_Type)";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testStringLengthFunctionBug274471.
public void testStringLengthFunctionBug274471() throws Exception {
// Bug 274471. string-length() with arity 0
URL fileURL = bundle.getEntry("/bugTestFiles/bug274471.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "x/string-length() = 7";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("false", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testXPathDefaultNamespace.
public void testXPathDefaultNamespace() throws Exception {
// Test for the fix, for xpathDefaultNamespace
URL fileURL = bundle.getEntry("/bugTestFiles/xpathDefNamespaceTest.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
// set up XPath default namespace in Dynamic Context
setupDynamicContext(schema);
addXPathDefaultNamespace("http://xyz");
String xpath = "X/message = 'hello'";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testDefNamespaceOnbuiltInTypes.
public void testDefNamespaceOnbuiltInTypes() throws Exception {
bundle = Platform.getBundle("org.w3c.xqts.testsuite");
URL fileURL = bundle.getEntry("/TestSources/emptydoc.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
// set up XPath default namespace in Dynamic Context
setupDynamicContext(schema);
addXPathDefaultNamespace("http://www.w3.org/2001/XMLSchema");
setVariable("value", new XSString("2.5"));
String xpath = "$value castable as double";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
Aggregations