<?xml version="1.0" encoding="UTF-8"?>
<!--

 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.

-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.2//EN" "document-v12.dtd">
<document>
  <header><title>The JaxMe parser for XML Schema</title></header>
  <body>
    <section><title>The JaxMe parser for XML Schema</title>
      <p>This is JaxMeXS, a parser for XML schema. Yet another one, to be precise. As there
        are a lot of other parsers around, the question arises: What makes it different?
        What advantages does it have?</p>
      <p>Let's begin with a disadvantage: This one is not a strict parser. In other words,
        it was not written to detect any possible invalid schema. Strictness is a secondary
        goal.</p>

      <p>The main purpose of JaxMeXS is being extensible. It is written with XML languages
        in mind, that extend XML schema. The best example is <link href="ext:jaxb">JAXB</link>,
        the XML binding specification for Java. It extends XML schema by adding some more tags,
        for example like this:</p>
      <source>
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://ws.apache.org/jaxme/examples/misc/jaxb"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:appinfo&gt;
        &lt;jaxb:schemaBindings&gt;
          &lt;jaxb:package name="com.mycompany.xml"/&gt;
        &lt;/jaxb:schemaBindings&gt;
      &lt;/xs:appinfo&gt;
    &lt;/xs:annotation&gt;
    ...
      </source>
      <p>JAXB is a Java source generator, which converts an XML schema into Java classes.
        These Java classes have the ability to read an XML document conforming to the
        original schema and return its information. As usual for Java classes, they
        have to be located in some package, <code>com.mycompany.xml</code> in our case.
        The above example demonstrates how JAXB uses an additional tag
        <code>jaxb:package</code> to specify it.</p>
      <p>This is exactly where JaxMeXS fits in. Quite unsurprising, because it was
        written as the XML schema parser for <link href="ext:jaxme">JaxMe</link>,
        which aims to be a JAXB implementation and extends the JAXB language by even
        more tags. The main idea of JaxMeXS is:</p>
      <ul>
        <li>Write a parser for XML schema.</li>
        <li>Extend the parser with the JAXB tags. This is simple: Any additional
          element is implemented by a standard Java bean. The attributes are
          mapped to properties and the property setters are called almost automagically.</li>
        <li>Extend the JAXB parser with the JaxMe tags by adding more beans.</li>
      </ul>
    </section>
  </body>
</document>
