use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration in project webtools.sourceediting by eclipse.
the class FnSecondsFromDuration method expected_args.
/**
* Obtain a list of expected arguments.
*
* @return Result of operation.
*/
public static synchronized Collection expected_args() {
if (_expected_args == null) {
_expected_args = new ArrayList();
_expected_args.add(new SeqType(new XSDuration(), SeqType.OCC_QMARK));
}
return _expected_args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration in project webtools.sourceediting by eclipse.
the class FnYearsFromDuration method expected_args.
/**
* Obtain a list of expected arguments.
*
* @return Result of operation.
*/
public static synchronized Collection expected_args() {
if (_expected_args == null) {
_expected_args = new ArrayList();
_expected_args.add(new SeqType(new XSDuration(), SeqType.OCC_QMARK));
}
return _expected_args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration in project webtools.sourceediting by eclipse.
the class TestBugs method testXSDayTimeDurationMultiply.
public void testXSDayTimeDurationMultiply() throws Exception {
// Bug 279377
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();
setupDynamicContext(schema);
String xpath = "xs:dayTimeDuration('PT2H10M') * 2.1";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSDuration result = (XSDuration) rs.first();
String actual = result.getStringValue();
assertEquals("PT4H33M", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration in project webtools.sourceediting by eclipse.
the class TestBugs method testXSDayTimeDurationDivide.
public void testXSDayTimeDurationDivide() throws Exception {
// Bug 279377
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();
setupDynamicContext(schema);
String xpath = "xs:dayTimeDuration('P1DT2H30M10.5S') div 1.5";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSDuration result = (XSDuration) rs.first();
String actual = result.getStringValue();
assertEquals("PT17H40M7S", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration in project webtools.sourceediting by eclipse.
the class TestBugs method testXSYearMonthDurationMultiply.
public void testXSYearMonthDurationMultiply() throws Exception {
// Bug 279373
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();
setupDynamicContext(schema);
String xpath = "xs:yearMonthDuration('P2Y11M') * 2.3";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSDuration result = (XSDuration) rs.first();
String actual = result.getStringValue();
assertEquals("P6Y9M", actual);
}
Aggregations