public NodeValue exec(NodeValue v)
{
if ( ! v.isString() )
{
Log.warn(this, "date: argument not a string: "+v) ;
throw new ExprEvalException("date: argument not a string: "+v) ;
}
String lexicalForm = v.getString() ;
// Quite picky about format
if ( ! lexicalForm.matches("\\d{4}-\\d{2}-\\d{2}") )
{
Log.warn(this, "date: argument not in date format: "+v) ;
throw new ExprEvalException("date: argument not in date format: "+v) ;
}
lexicalForm=lexicalForm+"T00:00:00Z" ;
NodeValue nv = NodeValue.makeNode(lexicalForm, XSDDatatype.XSDdateTime) ;