Hello everyone,
This is a rather simple question, but I am not sure how to deal with it.
I have an attribute called “interval” for one of my elements and it is of type xs:duration.
This type is perfect for what I need to do with it.
I can insert something like this as a value: “P2D” (which means duration of 2 days).
When I check in Xplorer, it is stored as “P2D”.
However, when I retrieve it with XQuery, I get this back: interval=“P0Y0M2DT0H0M0.0S”
The Xquery appends and prepends the “missing” components of the duration with their values being 0.
One of my applications expect a numerical value, since it doesn’t understand schema types. Is there a way in XQuery to strip away the characters if one knows the value will be days only, for example?
Thank you,
Peter Endisch
---------------------------------------
I’m a Zen Garden Maintenance Engineer
---------------------------------------
Hello,
in 4.2 Tamino XQuery supports some substring
functions, which you can use for that purpose,
e.g.
declare namespace xs = “XML Schema”
substring-before( string (xs:duration(“P2D”)), “T” )
Best regards
Walter