// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

public class LoadJAXB {
    public static void main(String[] args) {
        try {
            JAXBContext jxbctx = JAXBContext.newInstance(Data.class);
            InputStream is = new FileInputStream("C:\\jaxb.xml");
            Unmarshaller um = jxbctx.createUnmarshaller();
            Data o = (Data)um.unmarshal(is);
            is.close();
            System.out.println(o.getIv() + " " + o.getXv() + " " + o.getSv());
        } catch (JAXBException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
