On 16/12/2010 21:45, Young Matthew (4004) wrote:
Saxon HE with the following xpath:
fromTimeStamp element is a xs:dateTime
If you're using Saxon HE, then the transformation is not
schema-aware, so the fact that it's an xs:dateTime is irrelevant -
Saxon sees it as xs:untypedAtomic.
and what I
am doing is parsing the Saxon expression into my own
"expression" representation that is simplified to map
the individual steps (in an xpath) to a Hibernate
query. If I don't earmark the literal with the
"xs:dateTime" function the literal is a StringValue
type. This bombs since in my Hibernate code I do a
restriction off the Java object (which unfortunately is
a String rather than a Date).
"xs:dateTime" function casts a warning:
Warning: Comparison of
xs:untypedAtomic? to xs:dateTime will fail
unless the first operand is empty
I would suggest converting both sides to xs:dateTime:
You could compare them as strings but that would have the wrong
semantics e.g. if timezones differ.
Plus the literal is
wrapped inside a TraceExpression.
That suggests that you have chosen somewhere to compile your code
with tracing enabled.
You can have the lhs automatically treated as an xs:dateTime if you
make your code schema-aware (needs Saxon-EE). Automatic conversion
of the rhs from untypedAtomic is possible, but not from string.
Anyway to write the xpath
expression without wrapping the literal (ie. it is
automatically transformed by Saxon into a