Project

Profile

Help

Bug #1576

Updated by Michael Kay almost 12 years ago

The following query (taken from W3C FOTS:fn-function-lookup-184) causes Saxon to throw an IllegalArgument Exception: 

 function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'months-from-duration'), 1)(xs:yearMonthDuration("P20Y15M")) 

 The problem applies to all functions of the form X-from-Y that access a component of a date, time, dateTime, or duration. 

 The stack trace of the exception thrown is as follows: 

 java.lang.IllegalArgumentException: Unknown component for duration: 0 
	 at net.sf.saxon.value.DurationValue.getComponent(DurationValue.java:598) 
	 at net.sf.saxon.functions.Component.evaluateItem(Component.java:113) 
	 at net.sf.saxon.expr.Expression.iterate(Expression.java:429) 
	 at com.saxonica.functions.hof.FirstClassFunction.invoke(FirstClassFunction.java:104) 
	 at com.saxonica.functions.hof.DynamicFunctionCallDefinition$DynamicFunctionCall.call(DynamicFunctionCallDefinition.java:158) 
	 at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:235) 
	 at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:341) 
	 at net.sf.saxon.s9api.XQueryEvaluator.evaluate(XQueryEvaluator.java:378) 
	 at com.saxonica.testdriver.FOTestSuiteDriver.runTestCase(FOTestSuiteDriver.java:1142)

Back