hiya,
I'm a bit new to InfoPath, and I'm sure what I need can be done somehow, but I can't find much reference to it, except in quite vague terms. Thanks in advance for your patience with my dazzling newbie question
I've got a project that is collecting XML with information about people living together and what income they receive. There is currently a paper version of the data-collection form, which we are hoping to convert to InfoPath.
On the form, it displays the details of the head of the household, then asks for a list of other people in the house, and then another section to list all the different incomes of the people in the house (one person can have more than one income, or none).
So far so good
However, my problem is that the (non-negotiable) XML schema doesn't look like that. It stores each individual person as equal "person" nodes, under one "persons" node. The only difference between them is a "type" tag, so my first question is:
can I have a single section of the form which maps directly onto a particular instance of a repeating node, when the specific node is accessible by a XPath query like //person[persontype='head']
the other main problem is that the income section is not stored together, but as an "income" node beneath each individual "person" node (inside an "incomes" node - each person can have lots of incomes, in theory anyway)
so, my second question is:
can i have a set of repeating form elements, which will include drop-down to select the relevant person, which when saved, will be split up into the appropriate sub-nodes as indicated in the person drop-down
in other words, my data will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<people>
<Person>
<Name>Mr Tall</Name>
<DOB>1/1/1960</DOB>
<Type>Head</Type>
<Incomes>
<Income>
<Amount>25</Amount>
<Frequency>Weekly</Frequency>
<IncomeType>Begging</IncomeType>
</Income>
<Income>
<Amount>60</Amount>
<Frequency>Monthly</Frequency>
<IncomeType>eBay</IncomeType>
</Income>
</Incomes>
</Person>
<Person>
<Name>Mr Small</Name>
<DOB>1/1/1975</DOB>
<Type>Foot</Type>
<Incomes>
<Income>
<Amount>500</Amount>
<Frequency>Monthly</Frequency>
<IncomeType>Wage</IncomeType>
</Income>
</Incomes>
</Person>
</people>
but the for the purposes of the InfoPath form, will need to look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<Report>
<Head>
<Name>Mr Tall</Name>
<DOB>1/1/1960</DOB>
</Head>
<OtherPeople>
<Person>
<Name>Mr Small</Name>
<DOB>1/1/1975</DOB>
<Type>Foot</Type>
<Incomes/>
</Person>
</OtherPeople>
<Incomes>
<Income>
<Person>Mr Tall</Person>
<Amount>25</Amount>
<Frequency>Weekly</Frequency>
<IncomeType>Begging</IncomeType>
</Income>
<Income>
<Person>Mr Tall</Person>
<Amount>60</Amount>
<Frequency>Monthly</Frequency>
<IncomeType>eBay</IncomeType>
</Income>
<Income>
<Person>Mr Small</Person>
<Amount>500</Amount>
<Frequency>Monthly</Frequency>
<IncomeType>Wage</IncomeType>
</Income>
</Incomes>
</Report>
sorry for this incredibly long post, but the main question is:
can InfoPath do this sort of transformation, to both read and write, internally and seamlessly? Or will I have to do a transformation outside InfoPath first, let it update the data in the second format, then transform it back to the original format
I saw mention of "views" here:
http://tinyurl.com/4vftk
which sounds about right, but can't find anything else to tell me the best way to do it.
once again, I'm completely new to InfoPath, so would really appreciate someone pointing out the obvious
cheers
Toby