Hello everyone,
I know the title is confusing so let me try to give some background for what I am trying to do. I have a big XML file containing data according to the following schema (greatly simplified for the sake of this post):
<xs:schema id="GrenadeSchema">
<xs:element name="GrenadeList">
<xs:complextype>
<xs:sequence>
<xs:element name="Grenade" maxoccurs="unbounded">
<xs:complextype>
<xs:sequence>
<xs:element name="Model" type="xs:string" minoccurs="0">
<xs:element name="Weight" type="xs:int" minoccurs="0">
<xs:element name="canMakeThingsExplode" type="xs:boolean" minoccurs="0">
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:schema>
...and over in my InfoPath form I have a dropdown box who's data source is the XML file mentioned above. It's populated by the 'Model' element so when I click on it, I can choose from many different models of grenades.
I also have a text box and a check box that I'd like to populate depending on what model is selected using the other elements in the repeating group.
My first impression is to modify the text box/check box's xpath to somehow change to the dropdown box's current xpath context, ascend, then descend into the corresponding element. I looked but unfortunately couldn't find a way to do that.
It would be totally okay to use C# code as this form needs full trust and is signed anyway. If necessary, I can change the XML document's schema. If I /absolutely had to/ I could read my XML file into a database but it would be pretty sloppy given what this will be used for. (not for grenades this time, unfortunately (;)
Thank you!