TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Koen Hendrickx
NA
8
1.5k
read xml data to variables
May 5 2018 3:01 PM
Hello,
I'm a quite newbie to C# programming. I'm busy to a program and i would like to get some values out of an XML document.
I had some success with xmldocument, but i want to use xmlreader or xml.linq
Unfortuanally, i succeed none of both.
xml document:
<Root>
<Type category="type1">
<Amount>3</Amount>
<Tag ID="tag1">
<Name>name1_1</Name>
<Description>Test1_0</Description>
</Tag>
<Tag ID="tag2">
<Name>name1_2</Name>
<Description>Test1_1</Description>
</Tag>
<Tag ID="tag3">
<Name>name1_3</Name>
<Description>Test1_2</Description>
</Tag>
</Type>
<Type category="type2">
<Amount>2</Amount>
<Tag ID="tag1">
<Name>name2_1</Name>
<Description>Test2_0</Description>
</Tag>
<Tag ID="tag2">
<Name>name2_2</Name>
<Description>Test2_0</Description>
</Tag>
</Type>
</Root>
at first, i want to derive both <amount> to a variable (integer).
after this, i want to get the name and description, depending on the requested <tag ID>. this should become a string, to be used in further programming.
Anyone can advice me what to use? (xmlreader or LINQ?)
How should i implement? (as after reading and trying a lot, i don't get anything working...)
Already many thanks!
Reply
Answers (
1
)
What is Difference between AD (vs) IAM?
What are the criterias considered for top 10 articles?