Using XML Data to Populate a Form

K

KZWAN

We recently began to use a piece of equipment from an OEM for which they
generously provided the complete XML schema for it's configuration. The
equipment itself will export it's current configuration to an XML file, which
may not have data for each possible node in the XML schema.

How do we populate an InfoPath 2003 form we created from the schema with the
data exported to the XML file above, particularly repeating sections and
tables?
 
P

psiEnergos

The easiest way that I have found is to create a 'dummy' (or design if you
wish) record that has data in all the fields the form will use. For
repeating fields, make sure you have more than one entry in the dummy record
or InfoPath with design the schema to require only one, and the form design
mode will not list the item as a repeating group (so you won't be able to
create a repeating section). Note: Tables should follow suit this way as
well.

EX(of dummy record):
<Record>
<EQUIP SN="125632545">
<NAME>Blade Server</NAME>
<Total Slots>10</Total Slots>
<Slot>x64 CPU</Slot>
<Slot>x86 dual</Slot>
<Slot>{etc....}</Slot>
</Equip>
<Equip SN="12546464"> {has to be at least two Equips since this is
repeating}
</Record>

I have learned from experience that as long as the dummy (or design) record
has data in all expected fields, you will minimize any Schema editing you
need to do in the future. (Sadly, it does not always eliminate it however)

Hope this helps; I went through a few headaches on this one too.
 

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