Hi,
I am trying to use XMLInstance2Schema to generate an XML-Schema document but am not having much luck. The XML instance and the default product are attached below. Any advice?
//this is how I am using it
FileReader reader = new FileReader("MobyObject.xml");
XMLInstance2Schema schemafy = new XMLInstance2Schema();
Schema newSchema = schemafy.createSchema(reader);
FileWriter writer = new FileWriter("MobyObject.xsd");
Marshaller.marshal(newSchema,writer);//this is the input
<?xml version='1.0' encoding='UTF-8'?>
<MOBY>
<mobyContent authority='mips.gsf.de'>
<mobyData queryID='1'>
<Collection articleName=''>
<Simple> <GenericSequence namespace='AGI_LocusCode' id='At2g42410'> <CrossReference> <Object namespace='Global_Keyword' id='superman'/> </CrossReference>
<Integer namespace='' id='' articleName='Length'>214</Integer> <String namespace='' id='' articleName='Description'>putative SUPERMAN-like C2H2 zinc finger transcription factor</String>
<String namespace='' id='' articleName='SequenceString'>MKNKKDDQVMGLELGMSLRNPNQVLDLELRLGYL</String>
</GenericSequence>
</Simple>
<Simple> <GenericSequence namespace='AGI_LocusCode' id='At3g23130'> <CrossReference> <Object namespace='Global_Keyword_________' id='superman'/>
</CrossReference>
<Integer namespace='' id='' articleName='Length'>1777</Integer>
<String namespace='' id='' articleName='Description'>superman protein</String>
<String namespace='' id='' articleName='SequenceString'>PSSSDEIISLELEIGLINESEQDLDLELRLGFA</String>
</GenericSequence>
</Simple>
</Collection>
</mobyData>
</mobyContent>
</MOBY>
// and this is the output
<?xml version="1.0" encoding="UTF-8"?>
<schema structure-type="19" valid="true" structure-type="19"><element-decls nillable="false" reference="false" structure-type="8" _abstract="false" max-occurs="1" min-occurs="1" valid="true" structure-type="8" xsi:type="java:org.exolab.castor.xml.schema.ElementDecl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><name>MOBY</name><reference-id>element:MOBY</reference-id><type complex-content="false" restricted="false" simple-content="false" max-occurs="1" min-occurs="1" structure-type="6" particle-count="1" top-level="false" _abstract="false" complex-type="true" any-type="false" simple-type="false" valid="true" structure-type="6" xsi:type="java:org.exolab.castor.xml.schema.ComplexType"><reference-id>complexType:null</reference-id></type></element-decls><namespaces><local-namespace-prefixes xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></local-namespace-prefixes><local-namespace-prefixes xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">xsd</local-namespace-prefixes><local-namespaces xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema</local-namespaces><local-namespaces xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema</local-namespaces></namespaces><schema-namespace>http://www.w3.org/2001/XMLSchema</schema-namespace></schema>
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
