By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

How do I get vb.net output from xml?

P: 8
From my xml, how can I get vb.net output?

Expand|Select|Wrap|Line Numbers
  1. <PersonRace>
  2.     <PartyReportedRaceText>Other</PartyReportedRaceText>
  3.     <PartyReportedRaceText>Asian</PartyReportedRaceText>
  4.     <PartyReportedRaceText>White</PartyReportedRaceText>
  5.     <PartyReportedRaceText>Multiracial</PartyReportedRaceText>
  6. </PersonRace>
The conditions are
1. When the xml only has 1 PartyReportedRaceText, the output should show that one PartyReportedRaceText.
2. When the xml has more than one PartyReportedRaceText, the output should show PartyReportedRaceText as Multiracial
3. When the xml has no PartyReportedRaceText the output should show nothing.
Aug 9 '17 #1

✓ answered by Frinavale

You could either use LINQ to XML or the XmlDocument Class to help you parse through the XML document and print what you need to print.

Or you could, as an exercise, not use the above links and figure out how to use regular expressions or otherwise split and parse through the content to retrieve the information.

But the two links I posted have a lot of documentation and examples about how to accomplish what you need to do.

Share this Question
Share on Google+
2 Replies


Frinavale
Expert Mod 5K+
P: 9,731
You could either use LINQ to XML or the XmlDocument Class to help you parse through the XML document and print what you need to print.

Or you could, as an exercise, not use the above links and figure out how to use regular expressions or otherwise split and parse through the content to retrieve the information.

But the two links I posted have a lot of documentation and examples about how to accomplish what you need to do.
Aug 9 '17 #2

P: 8
Thanks. I no longer need help with this one.
Aug 9 '17 #3

Post your reply

Sign in to post your reply or Sign up for a free account.