Hello all,
Although I have successfully been able to parse through some XML files, and I have reviewed all the XML example code on this forum, I have a challenge I have not been able to solve yet. In our environment, we have a series of long XML files containing name data that will be used to generate lower thirds.
I would like to have just the name from each section of the XML tree populate a drop box e.g. </ArrayOfPersonData/PersonData[1]/PersonName> such that a user could select a name from the dynamically generated droplist, which may have 50 names in it.
Upon selection of the name, I'd like to return the index of the dropbox, so I could use that to run a function which will pull each of the associated fields for that PersonData portion of the XML tree, e.g. /PersonData[2]/TitleLine1 for the second person in the list. I know how to do the latter portion, but I need a bit of help filling the dropdown, and returning the dropdown index as an integer I can use to formulate my followup XML query. As the /PersonData parts of the XML effectively increase in number with each person in the file, the index return would correspond to the correct person data in my new query.
Here's a sample of the XML name data below. I have found I needed to use XPath to be able to parse these files, probably due to the formatting style, which I cannot change. If anyone can help point me in the right direction, I would be very grateful!
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPersonData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PersonData>
<MacroName />
<MicNumber />
<PersonName>Sarah Sander</PersonName>
<Honorific />
<HonorificEng />
<HonorificFre />
<Salutation>Ms. / Mme</Salutation>
<SalutationEng>Ms.</SalutationEng>
<SalutationFre>Mme</SalutationFre>
<Riding />
<OrganizationLine1>Big Company</OrganizationLine1>
<OrganizationLine2></OrganizationLine2>
<OrganizationLine3 />
<OrganizationLine4 />
<TitleLine1>Someplace County</TitleLine1>
<TitleLine2>Someplace County</TitleLine2>
<TitleLine3 />
<TitleLine4 />
<Videoconference />
<Background>C:\Graphics\Backgrounds\noparty.png</Background>
<LastFirstName>Sander, Sarah</LastFirstName>
</PersonData>
<PersonData>
<MacroName />
<MicNumber />
<PersonName>Firstname Lastname</PersonName>
<Honorific />
<HonorificEng />
<HonorificFre />
<Salutation>Mr. / M.</Salutation>
<SalutationEng>Mr.</SalutationEng>
<SalutationFre>M.</SalutationFre>
<Riding />
<OrganizationLine1>Big Company</OrganizationLine1>
<OrganizationLine2></OrganizationLine2>
<OrganizationLine3 />
<OrganizationLine4 />
<TitleLine1>Chief Information Officer</TitleLine1>
<TitleLine2>dirigeant principal de l'information</TitleLine2>
<TitleLine3 />
<TitleLine4 />
<Videoconference />
<Background>C:\Graphics\Backgrounds\noparty.png</Background>
<LastFirstName>Lastname, Firstname</LastFirstName>
</PersonData>