Skip to content

Commit

Permalink
jd03_03 A,B
Browse files Browse the repository at this point in the history
  • Loading branch information
VladSVBY committed Feb 21, 2018
1 parent 1580658 commit 11dd738
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/by/it/sevashko/jd02_09/generated/XML_Murshaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

public class XML_Murshaller {

private final static String path=System.getProperty("user.dir")+"/src/by/it/sevashko/jd02_09/generated/Users+XSD.xml";
private final static String path2=System.getProperty("user.dir")+"/src/by/it/sevashko/jd02_09/generated/Users_OUT.xml";

public static void main(String[] args) {
String root = System.getProperty("user.dir");
String in = root + "/src/by/it/sevashko/jd02_09/generated/Users+XSD.xml";
String out = root + "/src/by/it/sevashko/jd02_09/generated/Users_OUT.xml";
try {
JAXBContext context=JAXBContext.newInstance(Users.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
Users Users=(Users)unmarshaller.unmarshal(new File(path));
Users Users=(Users)unmarshaller.unmarshal(new File(in));
System.out.println(Users);

Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
marshaller.marshal(Users,new File(path2));
marshaller.marshal(Users,new File(out));

} catch (JAXBException e) {
e.printStackTrace();
Expand Down

0 comments on commit 11dd738

Please sign in to comment.