title: Represent XSD choice elements into LiveCycle Designer PDF forms
body: <p>I'm using Adobe Livecycle Designer and XML files to create some PDF forms for a project. I created an XSD, which among others contains an unbounded sequence of choices, for example something like the following:</p>
  
  <pre><code>&lt;xs:sequence maxOccurs="unbounded"&gt;
    &lt;xs:choice&gt;
      &lt;xs:element name="Item1" type="xs:string" /&gt;
      &lt;xs:element name="Item2" type="xs:string"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:sequence&gt;
  </code></pre>
  
  <p>To represent this in Adobe Livecycle Designer, I'm having something like the following:</p>
  
  <pre><code>MyForm (Subform)
    ItemsSubForm (Subform, repeated for many items)
      Item1Wrapper (Subform)
        Item1 (TextField)
      Item2Wrapper (Subform)
        Item2 (TextField)
    AddItemsButtonsSubForm
      AddItem1Button (Button)
      AddItem2Button (Button)
  </code></pre>
  
  <p>When someone presses AddItem1Button, I create a new ItemsSubForm instance using the following:</p>
  
  <pre><code>this.parent.parent._ItemsSubForm.addInstance();
  xfa.resolveNode("this.parent.parent.ItemsSubForm[" +(this.parent.parent.ItemsSubForm.instanceManager.count - 1) + "]").Item2Wrapper.presence = "hidden";
  </code></pre>
  
  <p>And the opposite thing for AddItem2Button.</p>
  
  <p>The problem is that apart from inserting items manually, I also want to be able to use an XML file, and for that reason I created the XSD above. I also use bindings to associate Item1 and Item2 elements from the XSD with Item1Wrapper and Item2Wrapper respectively. The problem is that once I have an Item1 element in the XML, both Item1Wrapper and Item2Wrapper are created (and the same with Item2). Is there any way to control the loading in order to hide the respective wrapper?</p>
  
  <p>I would like to inform you that unfortunately I cannot change either the PDFForm or the XSD.</p>