XMLBeans v1.0.4 Development Kit Welcome to XMLBeans! Kit contents: (1) One copy of xbean.jar, which contains XMLBeans. Should work on any JDK 1.4.x. ./lib/xbean.jar (2) License information for XML Beans and included libraries ./license.txt (3) One folder full of command-line scripts, pointing to the useful main() functions in the JAR. ./bin (4) One bit of ant task documentation. ./anttask.html (5) A copy of the plain javadoc tree for org.apache.xmlbeans.* ./docs/reference (6) A preliminary collection of nicely formatted user-level documentation HTML (includes reformatted and nicely organized javadoc as well) ./docs/guide (7) A few sample schemas ./schemas Where to start? (1) Setup. 1. make sure you have a JDK 1.4.x installed; that java[.exe] is on your path and that JAVA_HOME/bin contains java[.exe], javac[.exe], and jar[.exe]. 2. set your XMLBEANS_HOME env variable to point to the directory containing xbean.jar (i.e., ./lib). 3. put the scripts in ./bin on your path. 4. run "scomp" with no arguments. You should get a "usage" message. (2) Try some schema compilation 1. In the ./schemas directory you'll find some collections of schemas you can try out. - easypo: a contrived simple starter "purchase order" - s4s: the Schema for Schema To compile them, you can just send the whole directory to scomp, for example, "cd samples"; then "scomp easypo". You will get an "xmltypes.jar" out that contains all the compiled XMLBeans. To pick your own JAR filename just say scomp -out myeasypo.jar easypo 2. Especially as you get started, you will want to see the .java source code for the generated code. To get that, use a command-line like scomp -src mysrcdir -out myeasypo.jar easypo The "mysrcdir" will contain all the .java source code for the generated XMLBeans. (3) Try using your compiled XMLBeans Now, armed with the XMLBeans source code and the basic docs, you're ready to program. Things you need to know: * The org.apache.xmlbeans package has all the public classes for XMLBeans. Programs should not need to call anything else in xbean.jar directly. * XmlObject is the base class for all XMLBeans. It corresponds to xs:anyType. * Every schema type corresponds to an XMLBean interface, e.g., XmlAnySimpleType corresponds to xs:anySimpleType, and XmlInt corresponds to xs:int, etc.. And of course this extends to the XMLBean classes compiled from user-defined schemas. * Every XMLBean interface has an inner Factory class for creating or parsing instances, e.g., to load a file of generic type, use XmlObject.Factory.parse(myfile); to parse a string you expect to be a purcahse-order, use PurchaseOrderDocument.Factory.parse("