[xsd-users] unable to write new fields to XML file

Boris Kolpackov boris at codesynthesis.com
Thu Dec 17 09:34:26 EST 2015


Hi Aciel,

Aciel Eshky <aciel.eshky at gmail.com> writes:

> Some of the xml tags in the schema are optional, and specify the results of
> computations that we carry out on the contents of the input xml file. The
> input xml file has none of these results fields, but the output xml file
> should have them. We are able to populate these filed in the c++ object
> representing the xml file, but when we print the object to a file none of
> the results fields are printed. Any idea what the issue could be?

My first guess is that you are making copies of the model nodes instaed of
using references. As result, when you then modify them, you are modifying
copies, not the original object model.

See Section 4.3, "Modifying the Object Model" for more details on this
issue:

http://codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#4.3

Boris



More information about the xsd-users mailing list