views:

128

answers:

0

I was wondering if someone can help me. This task may be simple for some, but I'm having some trouble.

I have an Excel document, and it isn't "too" complex, but it will not generate the XML correctly. Click the link below for what my Excel document looks like (not the original however).

http://i762.photobucket.com/albums/x...celExample.jpg

As you can see, each "Description" has data underneath Titles 2-5. Each Description can have multiple of Titles 3-5 but only one of Title2.

I want this to be converted into XML. However, I want it to look like this.

<node>
    <title1>Description1</title1>
    <title2>ID1</title2>

    <title3 bla="TRUE">
     <title4>ip1</title4>
     <title5>en1</title5>
    </title3>

    <title3 bla="FALSE">
     <title4>ip2</title4>
     <title5>en2</title5>
    </title3>

    <title3 bla="FALSE">
     <title4>ip3</title4>
     <title5>en3</title5>
    </title3>

    <title3 bla="TRUE">
     <title4>ip4</title4>
     <title5>en4</title5>
    </title3>
</node>

<node>
    <title1>Description2</title1>
    <title2>ID2</title2>

    <title3 bla="TRUE">
     <title4>ip5</title4>
     <title5>en5</title5>
    </title3>

    <title3 bla="TRUE">
     <title4>ip6</title4>
     <title5>en6</title5>
    </title3>
    .
    ..
    ...
</node>

The xml may seem slightly confusing. But please try to see how the Excel Example image turns into this XML. Each Description can have "multiple" of Title3, but it's still the same "node".

I'm not 100% on how to generate XML from Excel Documents, so I was hoping I could get some help. Sorry if this example is kind of confusing, if you would like more information, please ask a specific question and I'll do my best to respond as soon as possible.

Thank you,

Andrew Davis NASA-KSC Co-op.