# Interactive -&gt; Choose One -&gt; Xml Choices

**URL:** https://www.finalbuilder.com/forums/t/interactive-gt-choose-one-gt-xml-choices/1092
**Category:** Discussion
**Created:** [January 30, 2009, 3:45am UTC](https://www.finalbuilder.com/forums/t/interactive-gt-choose-one-gt-xml-choices/1092 "2009-01-30T03:45:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [January 30, 2009, 3:45am UTC](https://www.finalbuilder.com/forums/t/interactive-gt-choose-one-gt-xml-choices/1092/1 "2009-01-30T03:45:52Z")

</div>

Is it possible to iterate through an Xml Document to generate the list of options in a Choose One dialog?

So if I had an Xml Document like

[FruitChoices]  
&nbsp;&nbsp;&nbsp;&nbsp; [Fruit type="Apple" /]  
&nbsp;&nbsp;&nbsp;&nbsp; [Fruit type="Orange"/]  
&nbsp;&nbsp;&nbsp;&nbsp; [Fruit type="Pear" /]  
[/FruitChoices]  
  
I could use some kind of XPath like /FruitChoices/Fruit/@type&nbsp; and have that populate my "Choices" in a choose one dialog?  
  
  
My goal here is that I'll pull info out of a database into a temp xml document, and then load that xml document into some variables, and a choice dialog.  
  
Thanks,  
-Jeff

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 1, 2009, 9:10am UTC](https://www.finalbuilder.com/forums/t/interactive-gt-choose-one-gt-xml-choices/1092/2 "2009-02-01T09:10:46Z")

</div>

Hi Jeff   
  
 Off the top of my head, here’s how I would do it.   
  
 declare some variables :   
  
 fruit\_type   
 choices   
  
 XML Node Iterator Action   
 xpath = /FruitChoices/Fruit   
 Set variable fruit\_type to value of attribue type   
  
 Append to Variable Action, append to choices variable : %fruit\_type%=%fruit\_type%   
 Add CRLF before   
  
 Then in the Choose One action - in the before action script event :   
  
 Action.Choices.Text = FBVariables.Choices   
  
 HTH

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [February 3, 2009, 12:26pm UTC](https://www.finalbuilder.com/forums/t/interactive-gt-choose-one-gt-xml-choices/1092/3 "2009-02-03T12:26:14Z")

</div>

That worked great, thanks a lot!
