Castor issue.

J

jacksu

I am new to use Castor, and stuck in one "simple issue". The
"simpleType" won't be generated by Castor, here is simplified version
of the xsd file.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="mynamespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="MyType">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="14"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>


And here is the ant build script:


<?xml version="1.0"?>
<project name="xsdtest" default="xsd2java">
<path id="classpath">


<fileset file="mylib/castor/lib/castor-1.0M1-
xml.jar" />
<fileset file="mylib/commons-logging.jar" />
<fileset dir="mylib/apache/xerces/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="xsd2java">
<java
classname="org.exolab.castor.builder.SourceGenerator"
failonerror="true" fork="true">
<classpath refid="classpath" />
<classpath location="." />
<arg line="-types j2"/>
<arg line="-package gen" />
<arg line="-dest ." />
<arg line="-f" />
<arg line="-i b.xsd" />
</java>


</target>
</project>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top