Default Rows Based Upon Number of XML Attributes.
Greetings everyone,
Based upon the number of attributes in an XML, I want to add a corresponding number of default rows to a repeating section within infopath. For example in this case there are 4 parameters under "Part_3". In this case I would want there to be 4 rows as a default but if I chose another, say with only 2 parameters, I would want the rows to default to 2. A clip of the XML follows:
<Module Name="Part_3">
-<Collection Name="Input">
-<Parameter Name="Parameter_1" Type="Boolean" Default="false">
<Value>true</Value>
<Value>false</Value>
</Parameter>
-<Parameter Name="Parameter_2" Type="String" Default="None">
<Value>None</Value>
<Value>Left</Value>
<Value>Right</Value>
<Value>Both</Value>
</Parameter>
-<Parameter Name="Parameter_3" Type="String" Default="None">
<Value>Left</Value>
<Value>Right</Value>
<Value>None</Value>
</Parameter>
-<Parameter Name="Parameter_4" Type="Boolean" Default="false">
<Value>true</Value>
<Value>false</Value>
</Parameter>
</Collection>
I can use XPath to dial down to particular values within this file but I need the rows to automatically default to the required number.
I'm using InfoPath 2003. Would anyone be able to help with this? Thanks in advance.
|