Hello and thanks for any help.
I have the XML show bellow,
I am using DataReader to read the info from it using the following
DataReader Sample.PNG
I am using "race_name1' as the key to read all the election info which then I send to a DataTable
(is there another way to accomplish this??)
I then pass the info to a dataobject using the Input Value of "President"
data object sample.PNG
this is then passed to a datatext, using the node names, all this node names I added to the config.dp as shown in the Table above
my tree looks like this
tree sample.PNG
As you can see I am reading or getting the "race_name1" on the first container under the dataobject, this is displaying the correct information, which is the name of the race.
The problem is with the second and third text container which display the information from the 3rd "Elections" from the XML, please see the note bellow
I need help figuring our how do I get to display any of the other nodes, in the first or second "Elections" from the xml, as I am using the name of the race as the key to read the xml, I think datapool is skipping the first two "Elections" and is only returning the last "Elections"
The xml is much larger, this is only a sample, so I have other races that have more than 2 candidates so the race name is duplicated to accommodate this and I get the same result, I am only getting the last race with that name.
Again thanks and let me know if you need more info to give me some help
I have the XML show bellow,
I am using DataReader to read the info from it using the following
DataReader Sample.PNG
I am using "race_name1' as the key to read all the election info which then I send to a DataTable
(is there another way to accomplish this??)
I then pass the info to a dataobject using the Input Value of "President"
data object sample.PNG
this is then passed to a datatext, using the node names, all this node names I added to the config.dp as shown in the Table above
my tree looks like this
tree sample.PNG
As you can see I am reading or getting the "race_name1" on the first container under the dataobject, this is displaying the correct information, which is the name of the race.
The problem is with the second and third text container which display the information from the 3rd "Elections" from the XML, please see the note bellow
I need help figuring our how do I get to display any of the other nodes, in the first or second "Elections" from the xml, as I am using the name of the race as the key to read the xml, I think datapool is skipping the first two "Elections" and is only returning the last "Elections"
The xml is much larger, this is only a sample, so I have other races that have more than 2 candidates so the race name is duplicated to accommodate this and I get the same result, I am only getting the last race with that name.
Again thanks and let me know if you need more info to give me some help
HTML Code:
<Elections> <race_name1>President</race_name1> <race_name2></race_name2> <pct_precincts_reporting>100</pct_precincts_reporting> <cand1_first_name>Donald</cand1_first_name> <cand1_last_name>Trump</cand1_last_name> <cand1_winner>Y</cand1_winner> <cand1_vote_total>4076538</cand1_vote_total> <cand1_pct_total>45</cand1_pct_total> <cand1_party_name1>GOP</cand1_party_name1> <cand1_pic_id></cand1_pic_id> <cand1_full_name>Donald Trump</cand1_full_name> <cand2_first_name>Hillary</cand2_first_name> <cand2_last_name>Clinton</cand2_last_name> <cand2_winner></cand2_winner> <cand2_vote_total>3643971</cand2_vote_total> <cand2_pct_total>40</cand2_pct_total> <cand2_party_name1>DEM</cand2_party_name1> <cand2_pic_id></cand2_pic_id> <cand2_full_name>Hillary Clinton</cand2_full_name> </Elections> <Elections> <race_name1>President</race_name1> <race_name2></race_name2> <pct_precincts_reporting>100</pct_precincts_reporting> <cand1_first_name>Gary</cand1_first_name> <cand1_last_name>Johnson</cand1_last_name> <cand1_winner></cand1_winner> <cand1_vote_total>783915</cand1_vote_total> <cand1_pct_total>9</cand1_pct_total> <cand1_party_name1>LIB</cand1_party_name1> <cand1_pic_id></cand1_pic_id> <cand1_full_name>Gary Johnson</cand1_full_name> <cand2_first_name>Jill</cand2_first_name> <cand2_last_name>Stein</cand2_last_name> <cand2_winner></cand2_winner> <cand2_vote_total>438955</cand2_vote_total> <cand2_pct_total>5</cand2_pct_total> <cand2_party_name1>GRN</cand2_party_name1> <cand2_pic_id></cand2_pic_id> <cand2_full_name>Jill Stein</cand2_full_name> </Elections> <Elections> <race_name1>President</race_name1> -------------------------> this is the name that appears in the output <race_name2></race_name2> <pct_precincts_reporting>100</pct_precincts_reporting> <cand1_first_name>Gloria</cand1_first_name> <cand1_last_name>Riva</cand1_last_name> <cand1_winner></cand1_winner> <cand1_vote_total>182518</cand1_vote_total> <cand1_pct_total>2</cand1_pct_total> <cand1_party_name1>P&F</cand1_party_name1> <cand1_pic_id></cand1_pic_id> <cand1_full_name>Gloria Riva</cand1_full_name> -------------------------> this is the name that appears in the output <cand2_first_name></cand2_first_name> <cand2_last_name></cand2_last_name> <cand2_winner></cand2_winner> <cand2_vote_total></cand2_vote_total> <cand2_pct_total></cand2_pct_total> <cand2_party_name1></cand2_party_name1> <cand2_pic_id></cand2_pic_id> <cand2_full_name></cand2_full_name> </Elections>
Comment