replace dom

R

Roeland

Hello,

I would like to know how to replace the Dom xml of an InfoPath form in c#.

I have a button in my form. When it is clicked, I deserialized xml to an
object using XmlSerializer. Then I work my objects an I serialize it back to
xml. Now I want to replace the current xml of the InfoPath form, with the new
xml.

I was hoping I could use Dom.LoadXml() method, but i get the error: "This
DOM cannot be loaded twice"

Can anyone help me on this one?
Cheers,
Roeland
 
R

Roeland

Greg,

Thanks for you quick response!

I think it is nicer to work with objects than with xmlnodes.
From the schema that I use in InfoPath I generated object in c#.

In my InfoPath form I need to generate some repeating objects.
When I click a button in the form I go to the code(behind) from the form.
I deserialize the xml from the document and I have my objects. Once I have
them I run them through some methods with business intelligents that fill the
collection for the repeating objects.
Once I have done that I serialize those objects back to xml. And that xml
would need to replace the current xml in the dom (thisDocument.Dom.Xml)
I hope I make sense.

I’m going to have a look at “DisableAutoUpdate and EnableAutoUpdate†and
keep you up-to-date.

Thanks again for your help.
Cheers,
Roeland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top