By compiling your schema with an xsdconfig file, you can control how names are chosen for the generated types. An xsdconfig file is designed to map schema type names to generated Java type names. Coercing type naming in this way does not change the names for the underlying schema types — it merely determines the names for corresponding Java types. Selecting your own names for compiled types can be useful when you want to control type name length, locale, capitalization, and so on.
This procedure assumes you are compiling schemas using a WebLogic Workshop schema project.
Note: Due to a Windows operating system limitation on file path lengths (256 characters), you might have trouble compiling schemas in which the generated types are nested in a very deep package hierarchy. This may result in an error message stating that a particular class couldn't be found. To work around this limiitation, try using your xsdconfig file to guide the naming of generated packages so that the hierarchy is less deep, package names are shorter, etc.
To Guide Type Naming During Compilation
For example, you might decide that a PURH_ORDER element and CUST type should be called PurchaseOrder and Customer as Java types.
<!-- An xsdconfig file must begin with a "config" element in the http://www.bea.com/2002/09/xbean/config namespace. Also, be sure to declare any namespaces used to qualify types in your schema (here, the namespace corresponding to the pol prefix. --> <xb:config xmlns:pol="http://openuri.org/easypoLocal" xmlns:xb="http://www.bea.com/2002/09/xbean/config"> <!-- Use the "namespace" element to map a namespace to the Java package name that should be generated. --> <xb:namespace uri="http://openuri.org/easypoLocal"> <xb:package>org.openuri.easypo.xsdconfig</xb:package> </xb:namespace> <!-- Use the "qname" element to map schema type names to generated Java type names. In these examples, the name attribute's value is the XML element name; the javaname attribute's value is the Java type that should be generated. --> <xb:qname name="pol:CUST" javaname="Customer"/> <xb:qname name="pol:PURCH_ORDER" javaname="PurchaseOrder"/> </xb:config>
When you build the schema project, the compiler will use the XSDCONFIG file to define names for generated Java types.