Creating Tim, ADate, Dtn, Map programatically

Friday, 30 October 2015 · 2 messages
CG
Christian Grünin reply to James Wright, 30 Oct 2015, 15:2130 Oct 2015 15:06 #
Hi James, You can have a look at our internal instantiations of atomic types [1,2]. Items of type xs:time can e.g. be created via:
  // the input string
  String string = "12:34:56";
  // comparable to string.getBytes(), but always UTF8 and faster:
  byte[] token = Token.token(string);
  // no input info available (will automatically be assigned if
  // executed Java code should raise an error)
  new Tim(token, null);
Quoted text · James Wright · 10 lines
On Fri, Oct 30, 2015 at 2:21 PM, James Wright <balugajames at gmail.com> wrote: > I have some Java methods which return time elements and or Maps and I was > trying to convert these into XQuery atomic values with no luck. Is there a > utility for these? > > Array has ``fromValues`` and all other types like ``Str`` have ``get`` but > Map, Tim, Dtn, ADate do not appear to be construct-able. > > Any help would be appreciated. > - James
JW
James Wright30 Oct 2015 15:21 #
I have some Java methods which return time elements and or Maps and I was trying to convert these into XQuery atomic values with no luck. Is there a utility for these? Array has ``fromValues`` and all other types like ``Str`` have ``get`` but Map, Tim, Dtn, ADate do not appear to be construct-able. Any help would be appreciated. - James

⚡Generated with XQuery