hi,

first ... hi, hello i'm new to this list ...

i've already read the archives and serached google ...
but that has not solved my problem, yet.
so i think, maybe, this list can help.

i have a very simple xsd (xs / xsd) :
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
        <xs:element name="parameter">
                <xs:complexType>
                        <xs:simpleContent>
                                <xs:extension base="xs:string">
                                        <xs:attribute name="id" 
type="xs:integer"
use="optional"/>
                                </xs:extension>
                        </xs:simpleContent>
                </xs:complexType>
        </xs:element>
</xs:schema>

test.xml
<?xml version="1.0" encoding="UTF-8"?>
<parameter>lala</parameter>

when i generate the code without having an attribute
in the parameter element ... no source code will be
generated, why?

when i try to access the content of the parameter
element the following exception will be shown:
>org.xml.sax.SAXException: Illegal Text data found as
child of: parameter
  value: "lala"{file: ; line: 2; column: 30}

why?
if the structure of test.xml look like this:
<parameter><content>lala</content></parameter>
i will got the contentstring lala.
why and whats about this content element???

best reagards and i hope you can help me soon!

castor options for source gen:
java org.exolab.castor.builder.SourceGenerator -i
parameter.xsd -package param


sven

test.java:
    public static void main(String[] args)
    {

        try {
            FileReader reader = new FileReader("test.xml");
            Parameter p = new Parameter();
            p =
(Parameter)Unmarshaller.unmarshal(Parameter.class,
reader);
            System.out.println(">"+p.getContent());
        } catch(Exception ix) {System.out.println(">"+ix);} 

}


        

        
                
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier anmelden: 
http://mail.yahoo.de



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to