scomp - Compile XML Schema to Java Data Types


How to use the "scomp" command to Compile XML Schema to Java Data Types? I have installed.



If you have installed, you can follow this tutorial to run the "xcomp" command to Compile XML Schema to Java Data Types:

1. Run "scomp" command to its options:


Compiles a schema into XML Bean classes and metadata.
Usage: scomp [opts] [dirs]* [schema.xsd]* [service.wsdl]* [config.xsdconfig]*
Options include:
    -cp [a;b;c] - classpath
    -d [dir] - target binary directory for .class and .xsb files
    -src [dir] - target directory for generated .java files
    -srconly - do not compile .java files or jar the output.
    -out [xmltypes.jar] - the name of the output jar
    -dl - permit network downloads for imports and includes (default is off)
    -noupa - do not enforce the unique particle attribution rule
    -nopvr - do not enforce the particle valid (restriction) rule
    -noann - ignore annotations
    -novdoc - do not validate contents of <documentation>
    -noext - ignore all extension (Pre/Post and Interface) found in .xsdconfig files
    -compiler - path to external java compiler
    -javasource [version] - generate java source compatible for a Java version (1.4 or 1.5)
    -ms - initial memory for external java compiler (default '8m')
    -mx - maximum memory for external java compiler (default '256m')
    -debug - compile with debug symbols
    -quiet - print fewer informational messages
    -verbose - print more informational messages
    -version - prints version information
    -license - prints license information
    -allowmdef "[ns] [ns] [ns]" - ignores multiple defs in given namespaces (use ##local for no-namespace)
    -catalog [file] -  catalog file for 

2. Run "scomp" command to XML Schema as input and JAR file as output:

\fyicenter\xmlbeans-2.6.0>.\bin\scomp -out easypo.jar schemas\easypo.xsd

Time to build schema type system: 0.39 seconds
Time to generate code: 0.125 seconds Cannot run program "C:\fyicenter\xmlbeans-2.6.0\javac": 
   CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(
        at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(
        at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(
        ... 6 more

Too bad. The "scomp" command failed to invoke "javac" compiler. See the next tutorial on how to avoid this problem.


SchemaCompiler - Call XML Schema Compiler Directly

easypo.xsd - Purchase Order Test XML Schema

Using Apache XMLBeans in Java Programs

⇑⇑ FAQ for Apache XMLBeans JAR Library

2017-07-07, 3633🔥, 0💬