45261
|
1 |
<!doctype html>
|
12005
|
2 |
<!--
|
45261
|
3 |
Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
|
12005
|
4 |
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5 |
|
|
6 |
This code is free software; you can redistribute it and/or modify it
|
|
7 |
under the terms of the GNU General Public License version 2 only, as
|
|
8 |
published by the Free Software Foundation. Oracle designates this
|
|
9 |
particular file as subject to the "Classpath" exception as provided
|
|
10 |
by Oracle in the LICENSE file that accompanied this code.
|
|
11 |
|
|
12 |
This code is distributed in the hope that it will be useful, but WITHOUT
|
|
13 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 |
version 2 for more details (a copy is included in the LICENSE file that
|
|
16 |
accompanied this code).
|
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License version
|
|
19 |
2 along with this work; if not, write to the Free Software Foundation,
|
|
20 |
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
21 |
|
|
22 |
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
23 |
or visit www.oracle.com if you need additional information or have any
|
|
24 |
questions.
|
|
25 |
-->
|
|
26 |
|
45261
|
27 |
<html>
|
12005
|
28 |
|
|
29 |
<head>
|
|
30 |
<title>javax.xml.xpath</title>
|
|
31 |
|
|
32 |
<meta name="@author" content="mailto:Jeff.Suttor@Sun.com" />
|
|
33 |
<meta name="@see" content='<a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a>' />
|
|
34 |
<meta name="@see" content='<a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>' />
|
|
35 |
<meta name="@see" content='<a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>' />
|
|
36 |
<meta name="@since" content="1.5" />
|
|
37 |
</head>
|
|
38 |
|
|
39 |
<body>
|
|
40 |
|
|
41 |
<p>XML/Java Type Mappings.</p>
|
|
42 |
|
|
43 |
<p><code>javax.xml.datatype</code>API provides XML/Java type mappings.</p>
|
|
44 |
|
|
45 |
<p>The following XML standards apply:</p>
|
|
46 |
<ul>
|
|
47 |
<li><a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a></li>
|
|
48 |
<li><a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a></li>
|
|
49 |
<li><a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li>
|
|
50 |
</ul>
|
|
51 |
|
45261
|
52 |
<hr>
|
12005
|
53 |
|
45261
|
54 |
<table class="striped">
|
|
55 |
<caption> W3C XML Schema/Java Type Mappings</caption>
|
12005
|
56 |
<thead>
|
|
57 |
<tr>
|
|
58 |
<th>W3C XML Schema Data Type</th>
|
|
59 |
<th>Java Data Type</th>
|
|
60 |
</tr>
|
|
61 |
</thead>
|
|
62 |
|
|
63 |
<tbody>
|
|
64 |
<tr>
|
|
65 |
<td>xs:date</td>
|
|
66 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
67 |
</tr>
|
|
68 |
<tr>
|
|
69 |
<td>xs:dateTime</td>
|
|
70 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
71 |
</tr>
|
|
72 |
<tr>
|
|
73 |
<td>xs:duration</td>
|
|
74 |
<td>{@link javax.xml.datatype.Duration}</td>
|
|
75 |
</tr>
|
|
76 |
<tr>
|
|
77 |
<td>xs:gDay</td>
|
|
78 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
79 |
</tr>
|
|
80 |
<tr>
|
|
81 |
<td>xs:gMonth </td>
|
|
82 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
83 |
</tr>
|
|
84 |
<tr>
|
|
85 |
<td>xs:gMonthDay</td>
|
|
86 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
87 |
</tr>
|
|
88 |
<tr>
|
|
89 |
<td>xs:gYear</td>
|
|
90 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
91 |
</tr>
|
|
92 |
<tr>
|
|
93 |
<td>xs:gYearMonth</td>
|
|
94 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
95 |
</tr>
|
|
96 |
<tr>
|
|
97 |
<td>xs:time</td>
|
|
98 |
<td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
|
|
99 |
</tr>
|
|
100 |
|
|
101 |
</tbody>
|
|
102 |
</table>
|
|
103 |
|
45261
|
104 |
<hr>
|
12005
|
105 |
|
|
106 |
|
45261
|
107 |
<table class="striped">
|
|
108 |
<caption>XQuery and XPath/Java Type Mappings</caption>
|
12005
|
109 |
<thead>
|
|
110 |
<tr>
|
|
111 |
<th>XQuery 1.0 and XPath 2.0 Data Model</th>
|
|
112 |
<th>Java Data Type</th>
|
|
113 |
</tr>
|
|
114 |
</thead>
|
|
115 |
|
|
116 |
<tbody>
|
|
117 |
<tr>
|
|
118 |
<td>xdt:dayTimeDuration</td>
|
|
119 |
<td>{@link javax.xml.datatype.Duration}</td>
|
|
120 |
</tr>
|
|
121 |
<tr>
|
|
122 |
<td>xdt:yearMonthDuration</td>
|
|
123 |
<td>{@link javax.xml.datatype.Duration}</td>
|
|
124 |
</tr>
|
|
125 |
</tbody>
|
|
126 |
</table>
|
|
127 |
|
45261
|
128 |
<hr>
|
12005
|
129 |
|
|
130 |
<p>
|
|
131 |
W3C XML Schema data types that have a "<em>natural</em>" mapping to Java types are defined by
|
|
132 |
JSR 31: Java™ Architecture for XML Binding (JAXB) Specification, Binding XML Schema to Java Representations.
|
|
133 |
JAXB defined mappings for XML Schema built-in data types include:
|
|
134 |
</p>
|
|
135 |
<ul>
|
|
136 |
<li>xs:anySimpleType</li>
|
|
137 |
<li>xs:base64Binary</li>
|
|
138 |
<li>xs:boolean</li>
|
|
139 |
<li>xs:byte</li>
|
|
140 |
<li>xs:decimal</li>
|
|
141 |
<li>xs:double</li>
|
|
142 |
<li>xs:float</li>
|
|
143 |
<li>xs:hexBinary</li>
|
|
144 |
<li>xs:int</li>
|
|
145 |
<li>xs:integer</li>
|
|
146 |
<li>xs:long</li>
|
|
147 |
<li>xs:QName</li>
|
|
148 |
<li>xs:short</li>
|
|
149 |
<li>xs:string</li>
|
|
150 |
<li>xs:unsignedByte</li>
|
|
151 |
<li>xs:unsignedInt</li>
|
|
152 |
<li>xs:unsignedShort</li>
|
|
153 |
</ul>
|
|
154 |
|
45261
|
155 |
<hr>
|
12005
|
156 |
|
|
157 |
|
|
158 |
<ul>
|
|
159 |
<li>Author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a></li>
|
|
160 |
<li>See <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a></li>
|
|
161 |
<li>See <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a></li>
|
|
162 |
<li>See <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li>
|
|
163 |
<li>Since 1.5</li>
|
|
164 |
</ul>
|
|
165 |
|
45261
|
166 |
<hr>
|
12005
|
167 |
|
|
168 |
|
|
169 |
</body>
|
|
170 |
</html>
|