<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
    <header>
        <title>XMLBeans Samples</title>
    </header>
    <body>
        <section>
          <title>Getting the Samples</title>
          <p>
            Click the name of a sample listed below to go to a page that
            describes the sample in more detail. From there, you can view the
            files that make up the sample. This sample repository is just
            getting started, so be sure to check back for new additions.
          </p>
          <p>
            To get started with the samples, follow the instructions on the
            <a href="site:documentation/install">Installing XMLBeans</a>
            page first.  Then get the sample code in one of the following ways:
          </p>
          <ul>
            <li>download all samples (<a href="samples.zip">zip</a> <a href="samples.tgz">tgz</a>)</li>
            <li>download individual samples <a href="#Samples+List">below</a></li>
            <li>all sample source is available in <a href="../download/index.html#Source+via+SVN+checkout">SVN</a></li>
          </ul>
          <p>
            If you have a sample that you'd like to share, grab the
            <a href="SampleTemplate.html">sample template</a>
            and donate it to us.  We'd be happy to post it!
          </p>
        </section>
        <section>
            <title>Samples List</title>
            <table>
                <tr>
                    <th>Title</th>
                    <th>Download</th>
                    <th>Date Available</th>
                </tr>
                <tr>
                    <td>
                        <strong>All samples</strong>
                        <br/>
                        Get 'em all at once.
                    </td>
                    <td>
                      <a href="samples.zip">zip</a>
                      <a href="samples.tgz">tgz</a>
                    </td>
                    <td>2004-10-28</td>
                </tr>
                <tr>
                    <td>
                        <a href="AbstractTypes.html">
                            <strong>AbstractTypes</strong>
                        </a>
                        <br/>
                      This sample illustrates the building and use of abstract XmlSchema types in XmlBeans.
                    </td>
                    <td>
                      <a href="AbstractTypes.zip">zip</a>
                      <a href="AbstractTypes.tgz">tgz</a>
                    </td>
                    <td>2005-02-07</td>
                </tr>
                <tr>
                    <td>
                        <a href="Any.html">
                            <strong>Any</strong>
                        </a>
                        <br/>
                      Illustrates how you can use the XMLBeans API to work with XML based on schema that features xs:any particles
                    </td>
                    <td>
                      <a href="Any.zip">zip</a>
                      <a href="Any.tgz">tgz</a>
                    </td>
                    <td>2005-07-08</td>
                </tr>
                <tr>
                    <td>
                        <a href="DateTime.html">
                            <strong>DateTime</strong>
                        </a>
                        <br/>
                        This sample demonstrates how you can work with XML
                        Schema primitive types date,
                        dateTime, time, duration, gDay.
                    </td>
                    <td>
                      <a href="DateTime.zip">zip</a>
                      <a href="DateTime.tgz">tgz</a>
                    </td>
                    <td>2004-10-28</td>
                </tr>
                <tr>
                    <td>
                        <a href="MixedContent.html">
                            <strong>MixedContent</strong>
                        </a>
                        <br/>
                        Work with mixed content XML by combining strong types generated from
                        schema with an <code>XmlCursor</code> instance.
                    </td>
                    <td>
                      <a href="MixedContent.zip">zip</a>
                      <a href="MixedContent.tgz">tgz</a>
                    </td>
                    <td>2004-09-15</td>
                </tr>
                <tr>
                    <td>
                        <a href="OrderMatters.html">
                            <strong>OrderMatters</strong>
                        </a>
                        <br/>
                        This samples gives an quick overview of how to use
                        XmlBeans with both the strongly typed XmlObjects
                        (StatementDocument, Transaction) and with the
                        XmlCursor.
                    </td>
                    <td>
                      <a href="OrderMatters.zip">zip</a>
                      <a href="OrderMatters.tgz">tgz</a>
                    </td>
                    <td>2004-10-28</td>
                </tr>
                <tr>
                    <td>
                        <a href="SchemaEnum.html">
                            <strong>SchemaEnum</strong>
                        </a>
                        <br/>
                        Access XML values that are defined in schema as enumerations.
                    </td>
                    <td>
                      <a href="SchemaEnum.zip">zip</a>
                      <a href="SchemaEnum.tgz">tgz</a>
                    </td>
                    <td>2004-09-15</td>
                </tr>
                <tr>
                    <td>
                        <a href="SubstitutionGroup.html">
                            <strong>SubstitutionGroup</strong>
                        </a>
                        <br/>
                        This sample illustrates substitution group elements in an XML document.
                    </td>
                    <td>
                      <a href="SubstitutionGroup.zip">zip</a>
                      <a href="SubstitutionGroup.tgz">tgz</a>
                    </td>
                    <td>2004-10-28</td>
                </tr>
                <tr>
                    <td>
                        <a href="Validation.html">
                            <strong>Validation</strong>
                        </a>
                        <br/>
                        Illustrates how you can use the XMLBeans API to validate XML instances against schema.
                    </td>
                    <td>
                      <a href="Validation.zip">zip</a>
                      <a href="Validation.tgz">tgz</a>
                    </td>
                    <td>2005-07-08</td>
                </tr>
                <tr>
                    <td>
                        <a href="vxsdb.html">
                            <strong>Velocity XmlBeans</strong>
                        </a>
                        <br/>
                      Vxsdb is a XmlBeans sample application which derives a Jakarta Commons SQL data 
                      model from an xml schema.
                    </td>
                    <td>
                      <a href="AbstractTypes.zip">zip</a>
                      <a href="AbstractTypes.tgz">tgz</a>
                    </td>
                    <td>2005-02-07</td>
                </tr>
                <tr>
                    <td>
                        <a href="XmlTree.html">
                            <strong>XmlTree</strong>
                        </a>
                        <br/>
                        Illustrates how you can use the XMLBeans API to create a Java tree view of an XML document.
                    </td>
                    <td>
                      <a href="XmlTree.zip">zip</a>
                      <a href="XmlTree.tgz">tgz</a>
                    </td>
                    <td>2005-07-08</td>
                </tr>
                <tr>
                    <td>
                        <a href="XQueryXPath.html">
                            <strong>XQueryXPath</strong>
                        </a>
                        <br/>
                        Illustrates how you can use the XMLBeans API to execute XPath and XQuery expressions.
                    </td>
                    <td>
                      <a href="XQueryXPath.zip">zip</a>
                      <a href="XQueryXPath.tgz">tgz</a>
                    </td>
                    <td>2005-07-08</td>
                </tr>
                <tr>
                    <td>
                        <a href="SampleTemplate.html">
                            <strong>SampleTemplate</strong>
                        </a>
                        <br/>
                        A template for sample authors to get started.  Please
                        follow these conventions.
                    </td>
                    <td>
                      <a href="SampleTemplate.zip">zip</a>
                      <a href="SampleTemplate.tgz">tgz</a>
                    </td>
                    <td>2004-09-15</td>
                </tr>
            </table>
        </section>
        <section>
            <title>Examples in XMLBeans Source</title>
              <p>
              Also, some of the code in the XmlBeans tools is a very good example
              of how to use XmlBeans. In paricular, see:
              </p>
              <ul>
                <li><code>org.apache.xmlbeans.impl.tool.InstanceValidator</code>
                It is an excellent example of how to load a schema
                type system dynamically at runtime, load and validate
                an instance within that type system, and how to obtain
                lists of and locations for validation errors.</li>
                <li><code>org.apache.xmlbeans.impl.xsd2inst.SampleXmlUtil</code>
                It is a great example of how to combine the XmlCursor and
                SchemaType APIs to create a full [sub]document
                that includes required children, default values etc.</li>
                <li><code>org.apache.xmlbeans.impl.tool.PrettyPrinter</code>
                It is a reasonable example of how to load and save out an
                arbitrary XML document.  XmlOptions are used to produce
                the pretty-printing.</li>
              </ul>
        </section>
    </body>
</document>
