Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Lott, Christopher M
I tried asking this on StackOverflow, but then realized that this email list is probably the better place, so please forgive if you read both places. I hope someone can please find time to answer. We use XmlBeans, code generated from a schema, to read in an XML instance that conforms to the

Re: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Nick Burch
On Mon, 19 Aug 2013, Lott, Christopher M wrote: We use XmlBeans, code generated from a schema, to read in an XML instance that conforms to the schema and modify it. Read and validate work fine; modify is killing me. For example, change the value of an element, delete an element from a list,

RE: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Paul Gillen
Since I think I can answer your question I probably misunderstand it. :) However ... Given an XSD: ?xml version=1.0 encoding=UTF-8? xs:schema targetNamespace=org.eltesto elementFormDefault=qualified attributeFormDefault=unqualified xmlns=org.eltesto

Re: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Lott, Christopher M
Thanks to Nick B. and Paul G. for their quick replies! Below is code that demonstrates, at least superficially, the exception that we get. We are doing something wrong in our code; I don't suspect an XmlBeans bug at this point. This code is derived from (and depends on the schema and example

RE: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Paul Gillen
If I understand you correctly you are trying to print something you removed; it gone baby. If for some reason you need it, preserve a copy, not a reference. package org.eltesto; import java.io.File; import java.math.BigDecimal; import java.math.BigInteger; import