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
darma teja
NA
496
337k
Get value from xml file
Sep 30 2014 4:24 AM
Hi All,
I have a xml file like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<information>
<information1 name="region">Asia</information1>
<information1 name="mainlang">ENG</information1>
</information>
<Data>
<dataname lang="Hindi" group="Asia">
test1.xml
</dataname>
<dataname lang="Chinese" group="Asia">
test2.xml
</dataname>
<dataname lang="English" group="US">
test3.xml
</dataname>
<dataname lang="Polish" group="EU">
test4.xml
</dataname>
</Data>
I am trying to get information/information1['mainlang'] == ENG from xml file.
and also
I would like to get All "lang, group, dataname" from xml file.
I am getting following error "invalid data at the root level. line 1, position the first" for the following code:
XDocument doc = XDocument.Load(path);
XElement test = doc.Root;
var nodeList = doc.SelectNodes("//dataname");
Advance thanks,
Darma
Reply
Answers (
11
)
C# sort List's
How to import CSV into VB.net