You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ra...@apache.org on 2005/11/18 00:29:29 UTC

svn commit: r345361 [3/181] - in /xmlbeans/site: build/site/docs/2.1.0/ build/site/docs/2.1.0/guide/ build/site/docs/2.1.0/images/ build/site/docs/2.1.0/reference/ build/site/docs/2.1.0/reference/javax/ build/site/docs/2.1.0/reference/javax/xml/ build/...

Added: xmlbeans/site/build/site/docs/2.1.0/guide/conSelectingXMLwithXQueryPathXPath.html
URL: http://svn.apache.org/viewcvs/xmlbeans/site/build/site/docs/2.1.0/guide/conSelectingXMLwithXQueryPathXPath.html?rev=345361&view=auto
==============================================================================
--- xmlbeans/site/build/site/docs/2.1.0/guide/conSelectingXMLwithXQueryPathXPath.html (added)
+++ xmlbeans/site/build/site/docs/2.1.0/guide/conSelectingXMLwithXQueryPathXPath.html Thu Nov 17 15:28:26 2005
@@ -0,0 +1,338 @@
+<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
+
+<!-- Copyright 2004 The Apache Software Foundation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+<html>
+<head>
+<!-- InstanceBeginEditable name="doctitle" -->
+<title>Selecting XML with XQuery and XPath</title>
+<!-- InstanceEndEditable -->
+<!--(Meta)==========================================================-->
+
+<meta http-equiv=Content-Type content="text/html; charset=$CHARSET;">
+
+
+<!-- InstanceBeginEditable name="metatags" -->
+
+<meta content="your name" name="author">
+<meta content="A description of the topic contents." name="description">
+<meta content="keywords to help in searches" name="keywords">
+<meta content="10/25/02" name="date last modified">
+<!-- InstanceEndEditable -->
+
+<!--(Links)=========================================================-->
+<!-- InstanceBeginEditable name="head" -->
+<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
+<!-- InstanceEndEditable -->
+<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
+<a href="../../../core/index.html" id="index"></a>
+<script language="JavaScript" src="../../../core/topicInfo.js"></script>
+<script language="JavaScript" src="../../../core/CookieClass.js"></script>
+<script language="JavaScript" src="../../../core/displayContent.js"></script>
+</head>
+
+<!--(Body)==========================================================-->
+<body>
+<script language="JavaScript">
+
+</script>
+<!-- InstanceBeginEditable name="body" -->
+<h1> Selecting XML with XQuery and XPath</h1>
+<div id="topictext">
+    <p>You can use XPath and XQuery to retrieve specific pieces of XML as you might
+        retrieve data from a database. XQuery and XPath provide a syntax for specifying
+        which elements and attributes you're interested in. The XMLBeans API provides
+        two methods for executing XQuery and XPath expressions, and two ways to use them. The methods are <span class="langinline">selectPath</span>
+        for XPath and <span class="langinline">execQuery</span> for XQuery. </p>
+    <p>You can call them from and <a href="../reference/org/apache/xmlbeans/XmlObject.html"><span class="langinline"> XmlObject</span></a> instance (or a generated type inheriting from it) or an <a href="../reference/org/apache/xmlbeans/XmlCursor.html"><span class="langinline">XmlCursor</span></a> instance.
+            As noted below, each of the four methods works slightly differently; be sure to keep these differences in mind when choosing your approach.</p>
+    <p class="notepara"><strong>Note:</strong> Both XQuery and complex XPath expressions require additional classes on the class path, as noted in the sections that follow. Also, be sure to see the XMLBeans <a href="../../../documentation/conInstallGuide.html">installation instructions</a>. </p>
+    <h2><a name="xpath_selectpath"></a>Using XPath with the selectPath Method</h2>
+</div>
+<div>
+  <p>You can execute XPath expressions use the <span class="langinline">selectPath</span> method. When you use XPath with the <span class="langinline">selectPath</span>
+    method, the value returned is view of values from the <em>current document</em> &#8212; not a copy of those values. In other words, changes your code makes to XML returned by the selectPath method change the XML in the document queried against. In contrast, with XQuery executed using the <span class="langinline">execQuery</span> method, the value returned is a <em>copy of values in the XML queried against</em>.</p>
+    <p> Note that XPath itself does not provide syntax for declaring prefix to URI bindings. For user convenience, we allow XQuery syntax to be used for such purposes. You can consult the latest XQuery draft when using syntax for declaring namespaces.</p>
+    <blockquote>
+        <p><strong>Note:</strong> By default, XMLBeans supports only very simple XPath expressions. To execute complex expressions &#8212; such as those with predicates, function calls, and the like &#8212; you will need xbean_xpath.jar on your class path. This JAR is among those created when you build XMLBeans from source.</p>
+    </blockquote>
+    <h3>Calling XmlObject.selectPath</h3>
+  <p>When called from <span class="langinline">XmlObject</span> (or a type that
+    inherits from it), the <code>selectPath</code> method returns an array of objects. If the expression
+    is executed against types generated from schema, then the type for the returned
+    array is one of the Java types corresponding to the schema, and you can cast it accordingly. </p>
+  <p>For example, imagine you have the following XML containing employee information.
+    You've compiled the schema describing this XML and the types generated from
+    schema are available to your code.</p>
+<pre>
+&lt;xq:employees xmlns:xq=&quot;http://xmlbeans.apache.org/samples/xquery/employees&quot;&gt;
+    &lt;xq:employee&gt;
+        &lt;xq:name&gt;Fred Jones&lt;/xq:name&gt;
+        &lt;xq:address location=&quot;home&quot;&gt;
+            &lt;xq:street&gt;900 Aurora Ave.&lt;/xq:street&gt;
+            &lt;xq:city&gt;Seattle&lt;/xq:city&gt;
+            &lt;xq:state&gt;WA&lt;/xq:state&gt;
+            &lt;xq:zip&gt;98115&lt;/xq:zip&gt;
+        &lt;/xq:address&gt;
+        &lt;xq:address location=&quot;work&quot;&gt;
+            &lt;xq:street&gt;2011 152nd Avenue NE&lt;/xq:street&gt;
+            &lt;xq:city&gt;Redmond&lt;/xq:city&gt;
+            &lt;xq:state&gt;WA&lt;/xq:state&gt;
+            &lt;xq:zip&gt;98052&lt;/xq:zip&gt;
+        &lt;/xq:address&gt;
+        &lt;xq:phone location=&quot;work&quot;&gt;(425)555-5665&lt;/xq:phone&gt;
+        &lt;xq:phone location=&quot;home&quot;&gt;(206)555-5555&lt;/xq:phone&gt;
+        &lt;xq:phone location=&quot;mobile&quot;&gt;(206)555-4321&lt;/xq:phone&gt;
+    &lt;/xq:employee&gt;
+&lt;/xq:employees&gt;
+</pre>
+  If you wanted to find the phone numbers whose area code was 206, you could capture
+  the XPath expression in this way:
+  <pre>
+String queryExpression =
+    &quot;declare namespace xq='http://xmlbeans.apache.org/samples/xquery/employees';&quot; +
+    &quot;$this/xq:employees/xq:employee/xq:phone[contains(., '(206)')]&quot;;
+</pre>
+  <p>Notice in the query expression that the variable <span class="langinline">$this</span>
+    represents the current context node (the <span class="langinline">XmlObject</span>
+    that you are querying from). In this example you are querying from the document
+    level <span class="langinline">XmlObject</span>.</p>
+  <p>You could then print the results with code such as the following:</p>
+  <pre>// Retrieve the matching phone elements and assign the results to the corresponding
+// generated type.
+PhoneType[] phones = (PhoneType[])empDoc.selectPath(queryExpression);
+
+// Loop through the results, printing the value of the phone element.
+for (int i = 0; i < phones.length; i++)
+{
+    System.out.println(phones[i].stringValue());
+}</pre>
+
+  <h3>Calling XmlCursor.selectPath</h3>
+  <p>When called from an <span class="langinline">XmlCursor</span> instance, the
+    <span class="langinline">selectPath</span> method retrieves a list of <em>selections</em>,
+    or locations in the XML. The selections are remembered by the cursor instance.
+    You can use methods such as <span class="langinline">toNextSelection</span>
+    to navigate among them.</p>
+  <div>
+    <p>The <span class="langinline">selectPath</span> method takes an XPath expression.
+      If the expression returns any results, each of those results is added as
+      a selection to the cursor's list of selections. You can move through these
+      selections in the way you might use <span class="langinline">java.util.Iterator</span>
+      methods to move through a collection.</p>
+    <p> For example, for a path such as <span class="langinline">$this/employees/employee</span>,
+      the cursor instance from which you called <code>selectPath</code> would include a selection for each employee element found by
+      the expression. Note that the variable <span class="langinline">$this</span>
+      is always bound to the current context node, which in this example is the
+      document. After calling the <span class="langinline">selectPath</span> method,
+      you would use various &quot;selection&quot;-related methods to work with
+      the results. These methods include:</p>
+  </div>
+  <ul>
+    <li>
+      <div><span class="langinline">getSelectionCount() </span>to retrieve the
+        number of selections resulting from the query.</div>
+    </li>
+    <li>
+      <div> <span class="langinline">toNextSelection()</span> to move the cursor
+        to the next selection in the list (such as to the one pointing at the
+        next employee element found).</div>
+    </li>
+    <li>
+      <div> <span class="langinline">toSelection(int)</span> to move the cursor
+        to the selection at the specified index (such as to the third employee
+        element in the selection).</div>
+    </li>
+    <li>
+      <div> <span class="langinline">hasNextSelection()</span> to find out if
+        there are more selections after the cursor's current position.</div>
+    </li>
+    <li>
+      <div><span class="langinline"> clearSelections()</span> clears the selections
+        from the current cursor. This doesn't modify the document (in other words,
+        it doesn't delete the selected XML); it merely clears the selection list
+        so that the cursor is no longer keeping track of those positions.</div>
+    </li>
+  </ul>
+  <div>
+    <p>The following example shows how you might use <span class="langinline">selectPath</span>,
+      in combination with the <span class="langinline">push</span> and <span class="langinline">pop</span>
+      methods, to maneuver through XML, retrieving specific values. </p>
+    <pre>
+public void printZipsAndWorkPhones(XmlObject xml)
+{
+    // Declare the namespace that will be used.
+    String xqNamespace =
+        &quot;declare namespace xq='http://xmlbeans.apache.org/samples/xquery/employees';&quot;;
+
+    // Insert a cursor and move it to the first element.
+    XmlCursor cursor = xml.newCursor();
+    cursor.toFirstChild();
+
+    // Save the cursor's current location by pushing it
+    // onto a stack of saved locations.
+    cursor.push();
+    // Query for zip elements.
+    cursor.selectPath(xqNamespace + &quot;$this//xq:zip&quot;);
+
+    // Loop through the list of selections, getting the value of
+    // each element.
+    while (cursor.toNextSelection())
+    {
+        System.out.println(cursor.getTextValue());
+    }
+    // Pop the saved location off the stack.
+    cursor.pop();
+    // Query again from the top, this time for work phone numbers.
+    cursor.selectPath(xqNamespace + &quot;$this//xq:phone[@location='work']&quot;);
+
+    // Move the cursor to the first selection, then print that element's
+    // value.
+    cursor.toNextSelection();
+    System.out.println(cursor.getTextValue());
+    // Dispose of the cursor.
+    cursor.dispose();
+}
+</pre>
+    <p>Using selections is somewhat like tracking the locations of multiple cursors
+      with a single cursor. This becomes especially clear when you remove the
+      XML associated with a selection. When you do so the selection itself remains
+      at the location where the removed XML was, but now the selection's location
+      is immediately before the XML that was after the XML you removed. In other
+      words, removing XML created a kind of vacuum that was filled by the XML
+      after it, which shifted up into the space &#8212; up into position immediately
+      after the selection location. This is exactly the same as if the selection
+      had been another cursor.</p>
+    <p>Finally, when using selections keep in mind that the list of selections
+      is in a sense &quot;live&quot;. The cursor you're working with is keeping
+      track of the selections in the list. In other words, be sure to call the
+      <span class="langinline">clearSelections</span> method when you're finished
+      with the selections, just as you should call the <span class="langinline">XmlCursor.dispose()</span>
+      method when you're finished using the cursor.</p>
+  </div>
+  <h2><a name="xquery_execquery"></a>Using XQuery with the execQuery Method</h2>
+  <p>You use the <span class="langinline">execQuery</span> method to execute XQuery
+    expressions. With XQuery expressions, XML returned is a copy of XML in the document queried against. In other words, changes your code makes to the values returned by <code>execQuery</code> are not reflected in the document queried against.</p>
+  <blockquote>
+      <p><strong>Note:</strong> To execute XQuery expressions, you must have the Saxon 8.1.1 JAR on your class path. Look for the download at the <a href="http://sourceforge.net/project/showfiles.php?group_id=29872&package_id=21888">Saxon web site</a>. This JAR is also included in the lib directory when you build XMLBeans from source.</p>
+  </blockquote>
+  <h3>Calling XmlObject.execQuery</h3>
+  <p>As with <span class="langinline">selectPath</span>, calling <span class="langinline">execQuery</span>
+    from an <span class="langinline">XmlObject</span> instance will return an
+    <span class="langinline">XmlObject</span> array.</p>
+  <p> The following example retrieves work <code>&lt;zip&gt;</code> elements from the incoming XML, adding the elements as children to a new <code>&lt;zip-list&gt;</code> element.</p>
+   <pre>public boolean collectZips(XmlObject empDoc)
+{
+    String namespaceDeclaration = 
+        "declare namespace xq='http://xmlbeans.apache.org/samples/xquery/employees';";
+    // The query is designed to return results, so return
+    // true if it does.
+    boolean hasResults = false;
+
+    // The expression: Get the &lt;zip> elements and return them as children 
+    // of a new &lt;zip-list> element.
+    String queryExpression =
+        "let $e := $this/xq:employees " +
+        "return " +
+        "&lt;zip-list> " +
+            "{for $z in $e/xq:employee/xq:address/xq:zip " +
+            "return $z} " +
+        "&lt;/zip-list>";
+
+    // Execute the query. Results will be copies of the XML queried against,
+    // stored as members of an XmlObject array.
+    XmlObject[] results = 
+        empDoc.execQuery(namespaceDeclaration + queryExpression);
+
+    // Print the results.
+    if (results.length > 0)
+    {
+        hasResults = true;
+        System.out.println("The query results: \n");
+        System.out.println(results[0].toString() + "\n");
+    }
+    return hasResults;
+}</pre>
+  <h3>Calling  XmlCursor.execQuery</h3>
+</div>
+
+<div>
+  <p>Unlike the <code>selectPath</code> method called from a cursor, the <span class="langinline">execQuery</span> method doesn't return <code>void</code>. Instead it returns an <span class="langinline">XmlCursor</span> instance positioned at the beginning of a new XML document representing
+    the query results. Rather than accessing results as selections, you use the cursor to move through the results in typical cursor fashion (for more information, see <a href="conNavigatingXMLwithCursors.html">Navigating
+    XML with Cursors</a>). The models are very different.</p>
+  <p>As always, you can cast the results to a type generated from schema if you know that the results conform to that type.</p>
+  <p>The following example retrieves work <code>&lt;phone&gt;</code> elements from the incoming XML, then changes the number in the results.</p>
+   <pre>public boolean updateWorkPhone(XmlObject empDoc)
+{
+    boolean hasResults = false;
+      
+    // A cursor instance to query with.
+    XmlCursor empCursor = empDoc.newCursor();
+    empCursor.toNextToken();
+
+    // The expression: Get the <employee> elements with <state> elements whose
+    // value is "WA".
+    String queryExpression =
+        "for $e in $this/xq:employees/xq:employee " +
+        "let $s := $e/xq:address/xq:state " +
+        "where $s = 'WA' " +
+        "return $e//xq:phone[@location='work']";
+
+    // Execute the query. Results, if any, will be available at 
+    // the position of the resultCursor in a new XML document.
+    XmlCursor resultCursor = 
+        empCursor.execQuery(namespaceDeclaration + queryExpression);
+    
+    System.out.println("The query results, element copies made " +
+		"from the received document: \n");
+    System.out.println(resultCursor.getObject().toString() + "\n");
+        
+    // If there are results, the results will be children of the fragment root
+    // where the new cursor is positioned. This statement tests for children
+    // and moves the cursor if to the first if it exists.
+    if (resultCursor.toFirstChild())
+    {
+        hasResults = true;
+        // Use the cursor to loop through the results, printing each sibling
+        // <employee>element returned by the query.
+        int i = 0;
+	    do 
+	    {
+	        // Change the phone numbers.
+            XmlCursor editCursor = resultCursor.newCursor();
+	        editCursor.toLastAttribute();
+	        editCursor.toNextToken();
+	        editCursor.removeXml();
+	        editCursor.insertChars("(206)555-1234");
+	    } while (resultCursor.toNextSibling());
+
+	    resultCursor.toStartDoc();
+	    System.out.println("The query results after changes: \n");
+	    System.out.println(resultCursor.getObject().toString() + "\n");
+
+    	System.out.println("The received document -- note that it is unchanged. " +
+            "Changes were made to the copy created by the execQuery method. \n");
+    	System.out.println(empDoc + "\n");
+    }
+    return hasResults;
+}</pre>
+   <h2>Related Topics</h2>
+</div>
+<p><a href="conGettingStartedwithXMLBeans.html">Getting Started with XMLBeans</a></p>
+<!-- InstanceEndEditable -->
+<script language="JavaScript">
+
+</script>
+</body>
+</html>

Added: xmlbeans/site/build/site/docs/2.1.0/guide/conUnderstandingXMLTokens.html
URL: http://svn.apache.org/viewcvs/xmlbeans/site/build/site/docs/2.1.0/guide/conUnderstandingXMLTokens.html?rev=345361&view=auto
==============================================================================
--- xmlbeans/site/build/site/docs/2.1.0/guide/conUnderstandingXMLTokens.html (added)
+++ xmlbeans/site/build/site/docs/2.1.0/guide/conUnderstandingXMLTokens.html Thu Nov 17 15:28:26 2005
@@ -0,0 +1,189 @@
+<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
+
+<!-- Copyright 2004 The Apache Software Foundation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+<html>
+<head>
+<!-- InstanceBeginEditable name="doctitle" -->
+<title>Understanding XML Tokens</title>
+<!-- InstanceEndEditable -->
+<!--(Meta)==========================================================-->
+
+<meta http-equiv=Content-Type content="text/html; charset=$CHARSET;">
+
+
+<!-- InstanceBeginEditable name="metatags" -->
+
+<meta name="component" content="">
+<!-- In the description metatag, please provide a BRIEF description of the topic contents. -->
+<meta name="description" content="">
+<!-- In the component metatag, please list keywords that will help a user search for this topic. -->
+<meta name="keywords" content="">
+<!-- InstanceEndEditable -->
+
+<!--(Links)=========================================================-->
+<!-- InstanceBeginEditable name="head" -->
+<!-- InstanceEndEditable -->
+<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
+<a href="../../../core/index.html" id="index"></a>
+<script language="JavaScript" src="../../../core/topicInfo.js"></script>
+<script language="JavaScript" src="../../../core/CookieClass.js"></script>
+<script language="JavaScript" src="../../../core/displayContent.js"></script>
+</head>
+
+<!--(Body)==========================================================-->
+<body>
+<script language="JavaScript">
+
+</script>
+<!-- InstanceBeginEditable name="body" -->
+<div id=topictitle>
+  <p class=Title>Understanding XML Tokens</p>
+</div>
+<div id=topictext>
+  <p>An XML cursor (an instance of the <a href="../reference/org/apache/xmlbeans/XmlCursor.html"><span class="langinline">XmlCursor</span></a>
+    interface) moves from token to token as your code moves the cursor. When you
+    move a cursor using a method such as <span class="langinline">toParent</span>,
+    <span class="langinline">toFirstAttribute</span>, <span class="langinline">toPrevSibling</span>,
+    and so on, the cursor moves to the token fitting the description. If there
+    is no appropriate token to move to, the cursor remains where it is, and <span class="langinline">false</span>
+    is returned to indicate that it didn't move. For example, if the cursor is
+    at the ENDDOC token (the last tag in the document), a call to the <span class="langinline">toNextSibling</span>
+    method will not move the cursor and will return <span class="langinline">false</span>
+    to indicate that the move was unsuccessful.</p>
+  <p>Note that while you can call the <span class="langinline">XmlCursor.currentTokenType</span>
+    method to find out which token type the cursor is at, you might find it more
+    convenient to use a method such as <span class="langinline">isEnddoc</span>.
+    The <span class="langinline">XmlCursor</span> interface provides several methods
+    that make it easy to discover whether the cursor you're moving is at the token
+    you're looking for. These methods, such as <span class="langinline">isStart</span>,
+    <span class="langinline">isAttr</span>, <span class="langinline">isText</span>,
+    and so on, return a <span class="langinline">boolean</span> value that indicates
+    whether the cursor is at the token type in question.</p>
+  <P>Tokens are represented by constants in the <span class="langinline"><a href="../reference/org/apache/xmlbeans/XmlCursor.TokenType.html">TokenType</a></span>
+    class, an inner class of the <span class="langinline">XmlCursor</span> interface.
+    Each has a constant you can use in switch statements to perform by-token actions.
+    The following table lists the token types:</P>
+  <TABLE id="Table1">
+    <TR>
+      <TD><STRONG>Token Type</STRONG></TD>
+      <TD><STRONG>Switch Constant</STRONG></TD>
+      <TD><STRONG>Description</STRONG></TD>
+    </TR>
+    <TR>
+      <TD>STARTDOC</TD>
+      <TD>INT_STARTDOC</TD>
+      <TD>Represents the start of the XML. Always the first token. The document
+        element itself is represented by a START token, not the STARTDOC token.</TD>
+    </TR>
+    <TR>
+      <TD>ENDDOC </TD>
+      <TD>INT_ENDDOC</TD>
+      <TD>Represents the end of the XML. Always the last token.</TD>
+    </TR>
+    <TR>
+      <TD>START </TD>
+      <TD>INT_START</TD>
+      <TD>Represents the start of an element.</TD>
+    </TR>
+    <TR>
+      <TD>END </TD>
+      <TD>INT_END</TD>
+      <TD>Represents the end of an element. The END token has no value, but marks
+        the element's end.</TD>
+    </TR>
+    <TR>
+      <TD>TEXT</TD>
+      <TD>INT_TEXT</TD>
+      <TD>Represents text.</TD>
+    </TR>
+    <TR>
+      <TD>ATTR </TD>
+      <TD>INT_ATTR</TD>
+      <TD>Represents an attribute. ATTR tokens are allowed to appear after a STARTDOC
+        or START token.</TD>
+    </TR>
+    <TR>
+      <TD>NAMESPACE</TD>
+      <TD>INT_NAMESPACE</TD>
+      <TD>Represents a namespace (xmlns) attribute. Also only allowed after START
+        or STARTDOC tokens.</TD>
+    </TR>
+    <TR>
+      <TD>COMMENT </TD>
+      <TD>INT_COMMENT</TD>
+      <TD>Represents a comment.</TD>
+    </TR>
+    <TR>
+      <TD>PROCINST </TD>
+      <TD>INT_PROCINST</TD>
+      <TD>Represents a processing instruction.</TD>
+    </TR>
+  </TABLE>
+  <P>As you use a cursor to navigate through XML, you can use one of the convenience
+    methods described above to discover whether you're at the token you're looking
+    for, or use the <span class="langinline">XmlCursor.currentTokenType</span>&nbsp;method
+    to discover the current token's type. The following figure illustrates example
+    locations for token types:</P>
+  <P><IMG src="../images/conCursorTokenLocations.gif" width="727" height="532">
+  <h2>Switching to Test for Token Types</h2>
+  <p>Here's a bit of code illustrating how you might use a Java <span class="langinline">switch</span>
+    statement to test for the START token type.</p>
+  <pre>
+// Take an incoming XmlObject and insert a cursor.
+XmlCursor documentCursor = xmlDoc.newCursor();
+
+/*
+ * Loop through the document, passing the cursor when it stops at each token
+ * to a function designed to discover the token type. Continue the loop
+ * as long at the cursor is at a token (until it reaches the end).
+ */
+while (!documentCursor.toNextToken().isNone())
+{
+    /*
+     * Use the intValue method to return the int corresponding to the
+	 * current token type. If it is the value for INT_START,
+	 * then you have a match.
+	 */
+    switch (cursor.currentTokenType().intValue())
+    {
+        case TokenType.INT_START:
+        // Print out the token type and a message.
+        System.out.println(cursor.currentTokenType() +
+            "; cursor is at the start of an element.");
+        break;
+    }
+}
+// Be sure to dispose of a cursor when you're finished.
+documentCursor.dispose();
+</pre>
+  <p>The scope of an XML cursor is the XML document in which it is created. For
+    example, you can create a cursor at the orderItem element in the example earlier
+    in this topic. If you then use that <span class="langinline">XmlCursor</span>
+    instance's <span class="langinline">toNextToken</span> method to move the
+    cursor until it won't move any further, you'll have reached the ENDDOC token.
+    In this example, that's at the <span class="langinline">&lt;/batchWidgetOrder&gt;</span>
+    tag. In other words, the cursor's scope is not limited to the element at which
+    it was created.</p>
+  <p class=relatedtopics>Related Topics</p>
+  <p><a href="../reference/org/apache/xmlbeans/XmlCursor.TokenType.html">XmlCursor.TokenType
+    Class</a></p>
+  <p><a href="conNavigatingXMLwithCursors.html">Navigating XML with Cursors</a></p>
+</div>
+<!-- InstanceEndEditable -->
+<script language="JavaScript">
+
+</script>
+</body>
+</html>

Added: xmlbeans/site/build/site/docs/2.1.0/guide/conUsingBookmarksToAnnotateXML.html
URL: http://svn.apache.org/viewcvs/xmlbeans/site/build/site/docs/2.1.0/guide/conUsingBookmarksToAnnotateXML.html?rev=345361&view=auto
==============================================================================
--- xmlbeans/site/build/site/docs/2.1.0/guide/conUsingBookmarksToAnnotateXML.html (added)
+++ xmlbeans/site/build/site/docs/2.1.0/guide/conUsingBookmarksToAnnotateXML.html Thu Nov 17 15:28:26 2005
@@ -0,0 +1,97 @@
+<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
+
+<!-- Copyright 2004 The Apache Software Foundation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+<html>
+<head>
+<!-- InstanceBeginEditable name="doctitle" -->
+<title>Using Bookmarks to Annotate XML</title>
+<!-- InstanceEndEditable -->
+<!--(Meta)==========================================================-->
+
+<meta http-equiv=Content-Type content="text/html; charset=$CHARSET;">
+
+
+<!-- InstanceBeginEditable name="metatags" -->
+
+<meta name="component" content="">
+<!-- In the description metatag, please provide a BRIEF description of the topic contents. -->
+<meta name="description" content="">
+<!-- In the component metatag, please list keywords that will help a user search for this topic. -->
+<meta name="keywords" content="">
+<!-- InstanceEndEditable -->
+
+<!--(Links)=========================================================-->
+<!-- InstanceBeginEditable name="head" -->
+<!-- InstanceEndEditable -->
+<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
+<a href="../../../core/index.html" id="index"></a>
+<script language="JavaScript" src="../../../core/topicInfo.js"></script>
+<script language="JavaScript" src="../../../core/CookieClass.js"></script>
+<script language="JavaScript" src="../../../core/displayContent.js"></script>
+</head>
+
+<!--(Body)==========================================================-->
+<body>
+<script language="JavaScript">
+
+</script>
+<!-- InstanceBeginEditable name="body" -->
+<div id=topictitle>
+  <p class=Title>Using Bookmarks to Annotate XML</p>
+</div>
+<div id=topictext>
+  <p>You can use a cursor to insert bookmarks that annotate XML with markers containing
+    information you design. These bookmarks aren't written into the XML itself,
+    but in a sense "hang" from the location where it was inserted. In this way
+    you can associate arbitrary pieces of information with specific parts of the
+    XML.</p>
+  <P>You design your own bookmark classes by extending <span class="langinline"><a href="../reference/org/apache/xmlbeans/XmlCursor.XmlBookmark.html">XmlBookmark</a></span>,
+    a nested class of <span class="langinline"><a href="../reference/org/apache/xmlbeans/XmlCursor.html">XmlCursor</a></span>.
+    You can design your bookmark class to contain information specific to your
+    needs. </P>
+  <P>In the following example, <span class="langinline">OrderBookmark</span> is
+    an inner class that extends <span class="langinline">XmlCursor.XmlBookmark</span>.
+    It merely stores a piece of text.</P>
+  <PRE>
+/*
+ * The OrderBookmark class includes a constructor through which you will
+ * insert your bookmark's content. It also includes get and set methods
+ * you can use to retrieve and change the content.
+ */
+static class OrderBookmark extends XmlCursor.XmlBookmark {
+    public OrderBookmark (String text) { TEXT = text; }
+    public String TEXT;
+    public String getText() { return TEXT; }
+    public void setText(String newText) { TEXT = newText; }
+}
+</PRE>
+  <p>You can use instances of this class to store bookmarks at places in your
+    XML. The following excerpt of code creates a cursor and an instance of the
+    <span class="langinline">OrderBookmark</span> class. Then it uses the cursor
+    to insert the bookmark at the cursor's current location.</p>
+  <pre>
+    XmlCursor orderCursor = xmlDoc.newCursor();
+    OrderBookmark thisBookmark = new OrderBookmark("foo");
+    orderCursor.setBookmark(thisAnnotation);
+</pre>
+  <p class=relatedtopics>Related Topics</p>
+  <p><a href="conNavigatingXMLwithCursors.html">Navigating XML with Cursors</a></p>
+</div>
+<!-- InstanceEndEditable -->
+<script language="JavaScript">
+
+</script>
+</body>
+</html>

Added: xmlbeans/site/build/site/docs/2.1.0/guide/conValidationWithXmlBeans.html
URL: http://svn.apache.org/viewcvs/xmlbeans/site/build/site/docs/2.1.0/guide/conValidationWithXmlBeans.html?rev=345361&view=auto
==============================================================================
--- xmlbeans/site/build/site/docs/2.1.0/guide/conValidationWithXmlBeans.html (added)
+++ xmlbeans/site/build/site/docs/2.1.0/guide/conValidationWithXmlBeans.html Thu Nov 17 15:28:26 2005
@@ -0,0 +1 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Copyright 2004 The Apache Software Foundation

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>XMLBeans Tools</title>
<!-- InstanceEndEditable -->
<!--(Meta)==========================================================-->
<meta http-eq
 uiv=Content-Type content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="metatags" -->
<meta name="author" content="your name" />
<meta name="Description" content="A description of the topic contents." />
<meta name="Keywords" content="keywords to help in searches" />
<meta name="date last modified" content="10/25/02" />
<!-- InstanceEndEditable -->
<!--(Links)=========================================================-->
<!-- InstanceBeginEditable name="head" -->
<link href="../xmlbeans.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../../../core/topicInfo.js"></script>
<script language="JavaScript" src="../../../core/CookieClass.js"></script>
<script language="JavaScript" src="../../../core/displayContent.js"></script>
</head>
<!--(Body)==========================================================-->
<body>
<script language="JavaScript">

</
 script>
<!-- InstanceBeginEditable name="body" -->
<h1> Validation with XMLBeans </h1>
<p>An essential part of schema-related work is validating instances based on the schema. XMLBeans provides a number of ways for you to ensure your instances are valid, both at the command line and programmatically at run time. </p>
<h2>Validation, XMLBeans-Style</h2>
<p>XMLBeans' schema-oriented approach to handling XML makes validation an important part of its work. However, XMLBeans has a specific approach to validation that's helpful to keep in mind when you're working.</p>
<p>Validation features include the following: </p>
<ul>
    <li>Generally, XMLBeans validates when you ask it to. It <a href="#no_parsing_validation">doesn't validate while parsing</a> -- nor, by default, while your code is updating the bound instance along the way through, say, set* methods (although you can change this behavior).</li>
    <li>You can <a href="#validation_apis">validate programmatically</a> or by us
 ing one of the <a href="#command_line_validation">command-line tools</a> provided by XMLBeans. </li>
    <li>The <code>validate</code> methods return <code>true</code> or <code>false</code> to indicate whether the instance is valid. You can also <a href="#retrieving_error_messages">capture error information</a> if you want to when validating programmatically. To do this, you specify an error listener.</li>
    <li>You can tell XMLBeans at parse time that it <a href="#validation_as_you_go">should validate during calls to set* methods</a>. Note that this means validation <em>after</em> parsing, not during, and that it can slow performance. Also note validation would not occur as changes are made by a cursor.</li>
    <li>XMLBeans does validate <em>schema</em> when compiling the schema through scomp or the xmlbean Ant task. (When you're compiling schema programmatically, you can disable validation with the <code>XmlOptions.setCompileNoValidation</code> method.)</li>
</ul>
<h2>X
 MLBeans Validates Only When You Ask It To &#8212; Generally</h2>
<p>Given XMLBeans' focus on schema-oriented work, it's natural to assume that it might check up on you as your code is making changes to an instance &#8212; that it might prevent your code from doing something that would render the instance invalid along the way. But, by default, it doesn't. The design of XMLBeans assumes that an XML instance might go through multiple invalid states before changes are complete. As a result, generally speaking, XMLBeans keeps quiet while changes are occurring.</p>
<blockquote>
    <p><span class="notepara"><strong>Note:</strong> The exception to this rule is that XMLBeans validates your schema when you're compiling it using scomp or the xmlbean Ant task.</span></p>
</blockquote>
<h3><a name="no_parsing_validation" id="no_parsing_validation"></a>XMLBeans Does Not Validate an Instance While Parsing It</h3>
<p>But it's not hard to get the impression that it does. For example, imagi
 ne that you're parsing an XML instance using a statement such as the following:</p>
<blockquote>
    <pre>MyXmlSchemaType myXmlBean = MyXmlSchemaType.Factory.parse(myXml);</pre>
</blockquote>
<p>If the namespace declared in the myXml instance doesn't match the target namespace of the schema from which MyXmlSchemaType was generated, parsing will fail with an error message. Likewise, you'll get messages for other mismatches between the shape of myXml and the XML shape described by the schema.</p>
<p>But these failures and messages don't result from validation. Instead, all XMLBeans is doing is a not-very-deep check to see if the instance <em>shouldn't be bound</em> to the XMLBeans type generated from schema. In other words, the checking done at the parsing stage is simply a &quot;low bar&quot; effort to avoid trouble down the road.</p>
<p>Validation, on the other hand, is designed to verify that the instance conforms completely to the schema.</p>
<p>So you can validate in any 
 of three ways:</p>
<ul>
    <li>On request, using a validate method.</li>
    <li>On the fly, using the &quot;validate on set&quot; option.</li>
    <li>Using one of the command-line tools. </li>
</ul>
<h2>Tools for Validating</h2>
<p>XMLBeans tools for validation include command-line tools and APIs. </p>
<h3><a name="command_line_validation" id="command_line_validation"></a>Command-line Tools for Validation </h3>
<p>Among the many <a href="tools.html">command-line tools</a> XMLBeans provides, you'll find two that are specifically for validation. </p>
<ul>
    <li><a href="tools.html#validate">validate</a> tool &#8212; A validation command-line tool
in which you specify the instance to validate and the schema to validate it against.
        <p>You'll find the <code>validate</code> tool in the bin directory of your XMLBeans installation. </p>
    </li>
    <li><a href="tools.html#svalidate">svalidate</a> tool &#8212; Identical to the validate tool, except that svalidate uses 
 a streaming model that supports validation against much larger schemas.
        <p>You'll find the <code>svalidate</code> tool in the bin directory of your XMLBeans installation. </p>
    </li>
</ul>
<h3><a name="validation_apis" id="validation_apis"></a>APIs for Validation </h3>
<p>XMLBeans APIs provide ways for you to <a href="#validation_when_you_ask">validate on request</a> &#8212; say, after your code has finished editing an instance and before it passes the instance elsewhere. You can also specify that your calls to set* methods should <a href="#validation_as_you_go">validate on-the-fly</a> the instance that is being edited; you do this as an option when your code creates the XMLBeans schema type instance.</p>
<h4><a name="validation_when_you_ask" id="validation_when_you_ask"></a>Validation When You Ask for It</h4>
<p>Both the <code>validate</code> methods described here are available from any XMLBeans type generated from schema during schema compilation (because all s
 uch types inherit from <code>XmlObject</code>). Both methods are designed to validate the instance that is bound to the type from which the method is called. For example, if your schema defines a <code>&lt;purchase-order&gt;</code> element with <code>&lt;item&gt;</code> children, calling the <code>myItem.validate()</code> method will validate the <code>&lt;item&gt;</code> instance bound to <code>Item</code>. This includes the <code>&lt;item&gt;</code> element's children, but not the <code>&lt;purchase-order&gt;</code> element or the <code>&lt;item&gt;</code> element's siblings.</p>
<p>Both methods return a <code>boolean</code> to indicate validity, and one of the methods lets you specify options for validation, such as capturing messages about why an invalid instance is invalid.</p>
<ul>
    <li><code>XmlObject.validate()</code> &#8212; Returns <code>true</code> if the instance is valid.</li>
    <li><code>XmlObject.validate(XmlOptions)</code> &#8212; Returns <code>true</cod
 e> if the instance is valid, using the specified <code>XmlOptions</code> instance to customize validation.
        <p>In particular, you can use the <code>XmlOptions.setErrorListener</code> method to specify a <code>Collection</code> instance with which to capture messages pertaining to invalid instances. For an example, see the Javadoc for this method. </p>
        <p>Through the <code>XmlOptions</code> class, you can specify options to use during validation. The options include the following: </p>
    </li>
    <li>XmlOptions.setErrorListener -- Specifies a Collection instance that XMLBeans should use to store errors that occur during validation (or, in other contexts, during parsing and compilation). </li>
    <li>XmlOptions.setValidateTreatLaxAsSkip -- Tells XMLBeans that it should skip elements matching an particle with contentModel=&quot;lax&quot; during validation. </li>
</ul>
<p>Also, see the <a href="#validation_as_you_go">section on validating as you go</a> for inf
 ormation about using the <code>XmlOptions.setValidateOnSet</code> method.</p>
<h3><a name="retrieving_error_messages" id="retrieving_error_messages"></a>Retrieving Error Messages About Invalid XML</h3>
<p>When you'll be validating with one of the <code>validate</code> methods, you can specify a <code>java.util.Collection</code> implementation as an error listener. As validation occurs, errors are added to the listener. After validation (and if the instance is found to be invalid) you can examine the errors. Here's an example:</p>
<pre>// Set up the validation error listener.
ArrayList validationErrors = new ArrayList();
XmlOptions validationOptions = new XmlOptions();
validationOptions.setErrorListener(validationErrors);

MyDocument myDoc = MyDocument.Factory.parse(pathToXml);

// Do some editing to myDoc.

// During validation, errors are added to the ArrayList for
// retrieval and printing by the printErrors method.
boolean isValid = myDoc.validate(validationOptions);

// 
 Print the errors if the XML is invalid.
if (!isValid)
{
    Iterator iter = validationErrors.iterator();
    while (iter.hasNext())
    {
        System.out.println(">> " + iter.next() + "\n");
    }
}</pre>
<h3><a name="validation_as_you_go" id="validation_as_you_go"></a>Validation As You Go</h3>
<p>By default, an XML instance will not be validated at run time as your code makes changes. However, you can change this behavior for limited on-the-fly validation. To do this, you specify the &quot;validate on set&quot; option when you create the XMLBeans type instance &#8212; you do this with the <code>XmlOptions.setValidateOnSet</code> method. </p>
<p>When you specify this option, XMLBeans with throw an exception when your code invalidates the XML through a set* method. Note that you can't specify an error listener for use in conjunction with this means of validating. Also, with &quot;validate on set,&quot; only simple schema types will be validated. Schema types not validated 
 by this approach include, for example, those defining elements with attributes or elements with children.</p>
<p>Because its functionality is limited to simple schema types and it validates for set* method calls, you should regard this validation approach as a debugging tool, rather than an alternative to using a <code>validate</code> method. For example, you might use it to determine which errant bit of code is creating an invalid chunk of XML.</p>
<p class="notepara"><strong>Note:</strong> This sort of validation is not supported during changes you make using an <code>XmlCursor</code> instance.</p>
<p>Among the methods you can use to create an XMLBeans instance &#8212; the <code>parse</code> methods and the <code>newInstance</code> method &#8212; you'll find versions that take an <code>XmlOptions</code> instance as a parameter. Specifying this option would look something like the following: </p>
<pre>XmlOptions validateOptions = new XmlOptions();

// Tell XMLBeans you want
  to validate on the fly.
validateOptions.setValidateOnSet();
// Create the new instance, specifying the option.
PurchaseOrder newPo = PurchaseOrder.Factory.newInstance(validateOptions);

// ... Code to edit the instance via get and set methods ... </pre>
<div>
    <p class="relatedtopics"> Related Topics </p>
    <p> <a href="conGettingStartedwithXMLBeans.html">Getting Started with XMLBeans</a> </p>
</div>
<!-- InstanceEndEditable -->
<script language="JavaScript">

</script>
</body>
</html>
\ No newline at end of file

Added: xmlbeans/site/build/site/docs/2.1.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html
URL: http://svn.apache.org/viewcvs/xmlbeans/site/build/site/docs/2.1.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html?rev=345361&view=auto
==============================================================================
--- xmlbeans/site/build/site/docs/2.1.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html (added)
+++ xmlbeans/site/build/site/docs/2.1.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html Thu Nov 17 15:28:26 2005
@@ -0,0 +1,343 @@
+<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
+
+<!-- Copyright 2004 The Apache Software Foundation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+<html>
+<head>
+<!-- InstanceBeginEditable name="doctitle" -->
+<title>Java Types for XML Schema</title>
+<!-- InstanceEndEditable -->
+<!--(Meta)==========================================================-->
+
+<meta http-equiv=Content-Type content="text/html; charset=$CHARSET;">
+
+
+<!-- InstanceBeginEditable name="metatags" -->
+
+<meta name="author" content="your name">
+<meta name="description" content="A description of the topic contents.">
+<meta name="keywords" content="keywords to help in searches">
+<meta name="date last modified" content="10/25/02">
+<!-- InstanceEndEditable -->
+
+<!--(Links)=========================================================-->
+<!-- InstanceBeginEditable name="head" -->
+<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
+<!-- InstanceEndEditable -->
+<link href="../xmlbeans.css" rel="stylesheet" type="text/css">
+<a href="../../../core/index.html" id="index"></a>
+<script language="JavaScript" src="../../../core/topicInfo.js"></script>
+<script language="JavaScript" src="../../../core/CookieClass.js"></script>
+<script language="JavaScript" src="../../../core/displayContent.js"></script>
+</head>
+
+<!--(Body)==========================================================-->
+<body>
+<script language="JavaScript">
+
+</script>
+<!-- InstanceBeginEditable name="body" -->
+<h1> XMLBeans Support for Built-In Schema Types</h1>
+<p>Just as with types in XML schema, the XMLBeans types based on schema are arranged
+  in a hierarchy. In general, the hierarchy of XMLBean types mirrors the hierarchy
+  of the schema types themselves. XML schema types all inherit from <span class="langinline">xs:anyType</span>
+  (which is at the root of the hierarchy); XMLBeans types inherit from <span class="langinline">XmlObject</span>.</p>
+<p>In XML schema, <span class="langinline">xs:anyType</span> is the root type
+  for two type categories: built-in and user-derived. Built-in schema types are
+  common types defined by the XML schema specification. User-derived types are
+  those you define in your schema. This topic lists the built-in types provided
+  with XMLBeans. For information about user-derived types and the Java types generated
+  from them, see <a href="conJavaTypesGeneratedFromUserDerived.html">Java Types Generated
+  from User-Derived Schema Types</a>.</p>
+<p>The following figure illustrates the hierarchy of types, showing both built-in
+  schema types and their XMLBeans parallels. Notice, too, that nearly all of the
+  built-in types are also available as natural Java types.</p>
+<p><img src="../images/conXMLTypeHierarchy.gif" width="865" height="887"> </p>
+<h1>Java Types Representing Built-In Schema Types</h1>
+<p>As you can see from the figure above, all 46 built-in schema types are represented
+  by an XMLBean type provided with XMLBeans. When using built-in XMLBean types,
+  keep in mind that:</p>
+<ul>
+  <li> Since <span class="langinline">XmlObject</span> corresponds to the <span class="langinline">xs:anyType</span>,
+    all Java XMLBean types inherit from <span class="langinline">XmlObject</span>.
+    Therefore all XMLBean types share the <span class="langinline">XmlObject</span>
+    interface’s ability to create an <span class="langinline">XmlCursor</span>
+    at the position of the object. They can also render the XML as strings or
+    streams.
+  <li>
+    <div>Where there is a corresponding natural Java type, the XMLBeans type provides
+      a way to get the underlying XML's value as the natural type. See the table
+      in this topic for information on how natural Java types map to XMLBeans
+      types. </div>
+
+  <li> Values assigned to built-in XMLBeans types are validated in keeping with
+    the rules of the schema type they represent. So, for example, an attempt to
+    assign a negative integer value to an <span class="langinline">XmlPositiveInteger</span>
+    will throw an <span class="langinline">XmlValueOutOfRange</span> exception.</li>
+</ul>
+<div>
+  <p>The following table lists the built-in schema types, along with their XMLBeans
+    and natural Java parallels. Unless otherwise noted, natural Java types are
+    in the <span class="langinline">java.lang</span> package; XMLBean types are
+    in the <span class="langinline">org.apache.xmlbeans</span> package.</p>
+</div>
+<div id="topictext">
+  <table>
+    <tr>
+      <td width="30%"><strong>Built-In Schema Type</strong></td>
+      <td width="31%"><strong>XMLBean Type</strong></td>
+      <td width="39%"><strong>Natural Java Type</strong></td>
+    </tr>
+    <tr>
+      <td>xs:anyType</td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlObject.html">XmlObject</a></td>
+      <td> <a href="../reference/org/apache/xmlbeans/XmlObject.html">org.apache.xmlbeans.XmlObject</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType" target="_blank">xs:anySimpleType</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlAnySimpleType.html">XmlAnySimpleType</a></td>
+      <td> <a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#anyURI" target="_blank">xs:anyURI</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlAnyURI.html">XmlAnyURI</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#base64Binary" target="_blank">xs:base64Binary</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlBase64Binary.html">XmlBase64Binary</a></td>
+      <td>byte[]</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#boolean" target="_blank">xs:boolean</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlBoolean.html">XmlBoolean</a></td>
+      <td>boolean</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#byte" target="_blank">xs:byte</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlByte.html">XmlByte</a></td>
+      <td>byte</td>
+    </tr>
+    <tr>
+      <td height="17"><a href="http://www.w3.org/TR/xmlschema-2/#date" target="_blank">xs:date</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlDate.html">XmlDate</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#dateTime" target="_blank">xs:dateTime</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlDateTime.html">XmlDateTime</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#decimal" target="_blank">xs:decimal</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlDecimal.html">XmlDecimal</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigDecimal.html" target="_blank">java.math.BigDecimal</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#double" target="_blank">xs:double</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlDouble.html">XmlDouble</a></td>
+      <td>double</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#duration" target="_blank">xs:duration</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlDuration.html">XmlDuration</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/GDuration.html">org.apache.xmlbeans.GDuration</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#ENTITIES" target="_blank">xs:ENTITIES</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlENTITIES.html">XmlENTITIES</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#ENTITY" target="_blank">xs:ENTITY</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlENTITY.html">XmlENTITY</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#float" target="_blank">xs:float</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlFloat.html">XmlFloat</a></td>
+      <td>float</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#gDay" target="_blank">xs:gDay</a></td>
+      <td><p><a href="../reference/org/apache/xmlbeans/XmlGDay.html">XmlGDay</a></p></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#gMonth" target="_blank">xs:gMonth</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlGMonth.html">XmlGMonth</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#gMonthDay" target="_blank">xs:gMonthDay</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlGMonthDay.html">XmlGMonthDay</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#gYear" target="_blank">xs:gYear</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlGYear.html">XmlGYear</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#gYearMonth" target="_blank">xs:gYearMonth</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlGYearMonth.html">XmlGYearMonth</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#hexBinary" target="_blank">xs:hexBinary</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlHexBinary.html">XmlHexBinary</a></td>
+      <td>byte[]</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#ID" target="_blank">xs:ID</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlID.html">XmlID</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#IDREF" target="_blank">xs:IDREF</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlIDREF.html">XmlIDREF</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#IDREFS" target="_blank">xs:IDREFS</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlIDREFS.html">XmlIDREFS</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#int" target="_blank">xs:int</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlInt.html">XmlInt</a></td>
+      <td>int</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#integer" target="_blank">xs:integer</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlInteger.html">XmlInteger</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html" target="_blank">java.math.BigInteger</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#language" target="_blank">xs:language</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlLanguage.html">XmlLanguage</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#long" target="_blank">xs:long</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlLong.html">XmlLong</a></td>
+      <td>long</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#Name" target="_blank">xs:Name</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlName.html">XmlName</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#NCName" target="_blank">xs:NCName</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNCName.html">XmlNCNAME</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#negativeInteger" target="_blank">xs:negativeInteger</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNegativeInteger.html">XmlNegativeInteger</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html" target="_blank">java.math.BigInteger</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#NMTOKEN" target="_blank">xs:NMTOKEN</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNMTOKEN.html">XmlNMTOKEN</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#NMTOKENS" target="_blank">xs:NMTOKENS</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNMTOKENS.html">XmlNMTOKENS</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger" target="_blank">xs:nonNegativeInteger</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNonNegativeInteger.html">XmlNonNegativeInteger</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html" target="_blank">java.math.BigInteger</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger" target="_blank">xs:nonPositiveInteger</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNonPositiveInteger.html">XmlNonPositiveInteger</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html" target="_blank">java.math.BigInteger</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#normalizedString" target="_blank">xs:normalizedString</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNormalizedString.html">XmlNormalizedString</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#NOTATION" target="_blank">xs:NOTATION</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlNOTATION.html">XmlNOTATION</a></td>
+      <td> Not supported</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#positiveInteger" target="_blank">xs:positiveInteger</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlPositiveInteger.html">XmlPositiveInteger</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html" target="_blank">java.math.BigInteger</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#QName" target="_blank">xs:QName</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlQName.html">XmlQName</a></td>
+      <td><a href="http://java.sun.com/j2ee/1.4/docs/api/javax/xml/namespace/QName.html" target="_blank">javax.xml.namespace.QName</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#short" target="_blank">xs:short</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlShort.html">XmlShort</a></td>
+      <td>short</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#string" target="_blank">xs:string</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlString.html">XmlString</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#time" target="_blank">xs:time</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlTime.html">XmlTime</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank">java.util.Calendar</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#token" target="_blank">xs:token</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlToken.html">XmlToken</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html" target="_blank">String</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#unsignedByte" target="_blank">xs:unsignedByte</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlUnsignedByte.html">XmlUnsignedByte</a></td>
+      <td>short</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#unsignedInt" target="_blank">xs:unsignedInt</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlUnsignedInt.html">XmlUnsignedInt</a></td>
+      <td>long</td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#unsignedLong" target="_blank">xs:unsignedLong</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlUnsignedLong.html">XmlUnsignedLong</a></td>
+      <td><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html" target="_blank">java.math.BigInteger</a></td>
+    </tr>
+    <tr>
+      <td><a href="http://www.w3.org/TR/xmlschema-2/#unsignedShort" target="_blank">xs:unsignedShort</a></td>
+      <td><a href="../reference/org/apache/xmlbeans/XmlUnsignedShort.html">XmlUnsignedShort</a></td>
+      <td>int</td>
+    </tr>
+  </table>
+</div>
+<div>
+  <p class="relatedtopics">Related Topics</p>
+  <p><a href="conGettingStartedwithXMLBeans.html">Getting Started with XMLBeans</a></p>
+</div>
+<!-- InstanceEndEditable -->
+<script language="JavaScript">
+
+</script>
+</body>
+</html>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org