New to XML - layout help

wxdqz

New Member
I am new to XML and need to create an XML file that will be accessed by Flex Builder 2. I want to be able to search an XML file from Flex using three drop down boxes to narrow my search.

There will be three categories. Each category has a group of sub-categories.

For instance:
Cat 1. Sweet Fruit; Sour Fruit
Cat 2. Seeds; no seeds
Cat 3. Orange color; yellow color

This may seem like a no-brainer question, but what would be the best way of setting this out tree?

1.Like this?
<fruitGroups>
<fruit>
<fruitName>Orange</fruitName>
<fruitCat1>Sweet</fruitCat1>
<fruitCat2>Seeds</fruitCat2>
<fruitCat3>Orange color<fruitCat3>
<fruitDescription>text here</fruitDescription>
</fruit>

<fruit>
<fruitName>Lemon</fruitName>
<fruitCat1>Sour</fruitCat1>
<fruitCat2>Seeds</fruitCat2>
<fruitCat3>Yellow color<fruitCat3>
<fruitDescription>text here</fruitDescription>
</fruit>
</fruitGroups>

2. Or like this?

<fruitGroups>
<fruit>
<fruitCat1 name=Sweet>
<fruitCat2 name=Seeds>
<fruitCat3 name=OrangleColor>
<fruitName>Orange</fruitName>
<fruitDescription>text here</fruitDescription>
</fruitCat3>
</fruitCat2>
</fruitCat1>
</fruit>

etc.

Please help my confusion.
 
Back
Top