Changes

Jump to navigation Jump to search
2,558 bytes added ,  14:05, 2 July 2021
==Data Types==
===Conversion to Java=== Before a Java constructor or function is called, the arguments are converted to Java values, as depicted in the first and second column of the table below. ===Conversion to XQuery=== The result of a Java call is converted back to XQuery, as depicted in the second and third column of the table. As there are too many differences between XQuery and Java types are mapped as follows:, no bidirectional mapping is possible. The chosen mapping is a compromise between usability and conformity.
{| class="wikitable"
|- valign="top"
! Accepted/returned Java value (and subtypes)! XQuery Typeinput (and subtypes)! Java TypeXQuery output
|- valign="top"
| <code>item()*</code> (no conversion)
| <code>org.basex.query.value.Value</code>
| <code>item()*</code> (no conversion)
|- valign="top"
| <code>xs:string</code>, <code>xs:untypedAtomic</code>
| <code>String</code>
| <code>xs:string</code>
|- valign="top"
| <code>xs:string</code> with single character, <code>xs:unsignedShort</code>
| <code>char</code>, <code>Character</code>
| <code>xs:string</code>
| <code>String</code>, <code>char</code>, <code>Character</code>
|- valign="top"
| <code>xs:boolean</code>
| <code>boolean</code>, <code>Boolean</code>
| <code>xs:boolean</code>
|- valign="top"
| <code>xs:byte</code>
| <code>byte</code>, <code>Byte</code>
| <code>xs:byte</code>
|- valign="top"
| <code>xs:short</code>
| <code>short</code>, <code>Short</code>
| <code>xs:short</code>
|- valign="top"
| <code>xs:int</code>
| <code>int</code>, <code>Integer</code>
| <code>xs:int</code>
|- valign="top"
| <code>xs:integer</code>, <code>xs:long</code>
| <code>long</code>, <code>Long</code>
| <code>xs:integer</code>
|- valign="top"
| <code>xs:unsignedLong</code>
| <code>java.math.BigInteger</code>
| <code>xs:unsignedLong</code> (lossy)
|- valign="top"
| <code>xs:decimal</code>
| <code>java.math.BigDecimal</code>
| <code>xs:decimal</code>
|- valign="top"
| <code>xs:float</code>
| <code>float</code>, <code>Float</code>
| <code>xs:float</code>
|- valign="top"
| <code>xs:double</code>
| <code>double</code>, <code>Double</code>
|- valign="top"| <code>xs:decimal</code>| <code>java.math.BigDecimal</code>|- valign="top"| <code>xs:integer</code>| <code>java.math.BigIntegerdouble</code>
|- valign="top"
| <code>xs:QName</code>
| <code>javax.xml.namespace.QName</code>
| <code>xs:QName</code>
|- valign="top"
| <code>xs:anyURI</code>
| <code>java.net.URI</code>, <code>java.net.URL</code>
| <code>xs:anyURI</code>
|- valign="top"
| <code>xs:date</code>
| <code>javax.xml.datatype.XMLGregorianCalendar</code>
| <code>xs:date</code>
|- valign="top"
| <code>xs:duration</code>
| <code>javax.xml.datatype.Duration</code>
| <code>xs:duration</code>
|- valign="top"
| <code>node()</code>
| <code>org.w3c.dom.Node</code>
| <code>node()</code>
|- valign="top"
| <code>array(xs:boolean)</code>
| <code>boolean[]</code>
| <code>xs:boolean*</code>
|- valign="top"
| <code>array(xs:string)</code>
| <code>String[]</code>
| <code>xs:string*</code>
|- valign="top"
| <code>array(xs:unsignedShort)</code>
| <code>char[]</code>
| <code>xs:string</code>
|- valign="top"
| <code>array(xs:short)</code>
| <code>short[]</code>
| <code>xs:short*</code>
|- valign="top"
| <code>array(xs:int)</code>
| <code>int[]</code>
| <code>xs:int*</code>
|- valign="top"
| <code>array(xs:integer)</code>, <code>array(xs:long)</code>
| <code>long[]</code>
| <code>xs:integer*</code>
|- valign="top"
| <code>array(xs:float)</code>
| <code>float[]</code>
| <code>xs:float*</code>
|- valign="top"
| <code>array(xs:double)</code>
| <code>double[]</code>
| <code>xs:double*</code>
|- valign="top"
| <code>Object[]</code> (others)
| <code>item()*</code>
| <code>array(*)</code> (others)
|- valign="top"
| <code>java.util.HashMap</code>
| Wrapped Java object
| <code>map(*)</code>
|- valign="top"
| –
| <code>char[][]</code>
| <code>xs:string*</code>
|- valign="top"
| ''empty sequence''
| <code>null</code>
| <code>empty-sequence()</code>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu