Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/Examples/SDO/SdoStatic
// Initialize the the metadata
FileInputStream xsdInputStream = new FileInputStream("../Resource/bin/Customer.xsd");
XSDHelper.INSTANCE.define(xsdInputStream, null);
// Unmarshal the XML document
FileInputStream xmlInputStream = new FileInputStream("../Resource/bin/Customer-data.xml");
XMLDocument xmlDocument = XMLHelper.INSTANCE.load(xmlInputStream);
CustomerType customer = (CustomerType) xmlDocument.getRootObject();
// Modify the Java object
PhoneNumber phoneNumber = (PhoneNumber) DataFactory.INSTANCE.create("urn:customer-
example", "phone-number");
phoneNumber.setNumberType("home");
phoneNumber.setValue("(613) 555-3333");
customer.getContactInfo().getPhoneNumber().add(phoneNumber);
// Marshal the Java object
XMLHelper.INSTANCE.save(xmlDocument, System.out, null);