users@jaxb.java.net

RE: Updating an XML FIle

From: Geoff Bawn <Geoff.Bawn_at_PPA.NHS.UK>
Date: Wed, 27 Aug 2003 08:15:18 +0100

Rob

You are correct. It now works the way I want it to.

Thanks for your help.


Geoff Bawn
Phone (0191) 203-5864
E-Mail Geoff.Bawn_at_PPA.NHS.UK
Fax (0191) 203-5264


>>> rmlowe_at_rmlowe.com 21:56:52 26 August 2003 >>>
> The problem is that if I unmarshal the original XML file created by
SystemA, then I cannot just call the set methods to populate SystemB data as
I get a null exception. One alternative is for SystemB and SystemC to
regenerate the whole file using ObjectFactory - easy in this example but
much more difficult in a real example.

You should be doing something like:

Root root = unmarshaller.unmarshal(...);
SystemB systemB1 = ObjectFactory.createSystemB("data for system B here");
root.setSystemB(systemB1);

and not:

Root root = unmarshaller.unmarshal(...);
root.getSystemB().setValue("data for system B here");

Right?

- Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net




*** IMPORTANT NOTICE ***
*** PPA DISCLAIMER ***
This e-mail and any attachments transmitted with it, including replies and forwarded copies subsequently transmitted (which may contain alterations), contains information which may be confidential and which may also be privileged.
The content of this e-mail is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), or the person authorised as responsible for delivery to the intended recipient(s), please note that any form of distribution, copying or use of this e-mail
or the information in it is strictly prohibited and may be unlawful.
If you have received this e-mail in error please notify the Network Team at the Prescription Pricing Authority via e-mail to network.team_at_ppa.nhs.uk including a copy of this message. Please then delete this e-mail and destroy any copies of it.
Further, we make every effort to keep our network free from viruses. However, you do need to validate this e-mail and any attachments to it for viruses, as we can take no responsibility for any computer virus that might be transferred by way of this e-mail.
This e-mail is from the Prescription Pricing Authority whose principal office is at Bridge House, 152 Pilgrim Street, Newcastle-upon-Tyne, NE1 6SN. Switchboard Telephone Number :- +44 (0)191 232 5371


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net