Hi Xavier,

you can use a mapping file to skip the elements you don't want to 
unmarshall (search in the mailing list, it has been asked several times) or
you can use an XSL stylesheet before passing your XML to Castor.

Arnaud

-> -----Original Message-----
-> From: sl151-6 [mailto:[EMAIL PROTECTED]]
-> Sent: Tuesday, November 06, 2001 12:46 AM
-> To: [EMAIL PROTECTED]
-> Subject: [castor-dev] Unmarshall XML data
-> 
-> 
-> Hi,
-> 
-> i use Castor for loading data from a XML File.
-> I have some problems for loading data which are not the root element 
-> in the XML File.
-> 
-> XML File
->      <Root>
->              <Data> ... </Data>
->              <Position x="" y=""/>
->              <Connection> ..... </Connection>
->      </Root>
-> 
-> I use the following code and my structure is always empty.
-> 
->      // Unmarshal the data
->      Unmarshaller unmar = new Unmarshaller(ConnectionCastor.class);
->      
->      //Load Connection
->      ConnectionCastor = (ConnectionCastor)unmar.unmarshal
-> (ConnectionCastor.class,new FileReader(_fileName)); 
-> 
-> Is it possible to load only the structure "Connection" and not the 
-> structure "Root" ? All my fields are public.
-> 
-> 
-> Xavier Vaisson.
-> 
-> ----------------------------------------------------------- 
-> If you wish to unsubscribe from this mailing, send mail to
-> [EMAIL PROTECTED] with a subject of:
->      unsubscribe castor-dev

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

Reply via email to