Hi,

please see inline.

Werner

upino wrote:
Hi Werner,
i must create a schema document like:

<SCHEMA ...other schema informations like namespaces, import...>
    <XS:ELEMENT name="root" type="Troot">
    <XS:COMPLEXTYPE name="Troot">
           <XS:SEQUENCE>
                <XS:ELEMENT name="cat" type="Tcat"/>
                <XS:ELEMENT name="dog" type="Tdog"/>
           </XS:SEQUENCE>
    </XS:COMPLEXTYPE>
    <XS:SIMPLETYPE name="Tcat" type="string"/>
    <XS:SIMPLETYPE name="Tdog">
        <XS:RESTRICTION base="xs:string">
               <xs:pattern value="\d{3}-[A-Z]{2}"/>
        </XS:RESTRICTION>
    </XS:SIMPLETYPE>
</SCHEMA>

I can create a schema, I can create complexType as

ComplexType ct = new ComplexType("Troot")

i can create a group and a sequence inside the complex type and the
ElementDecl but I don't understand what must i do to create any sympleType
and any restrictions on it because

SimpleType st = new SimpleType("Tcat") gives me an error ...
What error are you getting ?

And as already mentioned, hwo about providing me with a small JUnit test that creates a SimpleType instance according to your needs, and I'll have a look why running this test fails (if it does).

> and in
SimpleType st = new SimpleType("Tcat",string,string) i don't know the two string parameters

What version of Castor are you using, if I may ask ? I have just been looking at the sources of Castor (SVN head), and the Java class SimpleType has one constructor only.



Thank you very much,

upino


Werner Guttmann wrote:
Hi,

can you supply me with a Java code fragment that you think should work, and I will have a look to get an idea why it isn't, and what needs to be done to get this working ?

Regards
Werner

upino wrote:
Hi,
i'm tring to write an XSD file using castor.

I have no problems to create my complexType but i can't create any
simpleType.

I would like to write
<simpletype name="pippo" type="xs:string"/>
in a schemafile, but i can't instaziate the class simpleType.

Can someone post me an example of code?

Thanks a lot,

upino

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email






---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to