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
Net PerfectDev
1.6k
146
4.7k
Extract parent element from XML document
Oct 24 2020 7:10 PM
Hello, I have an xml document
<Person Attribute1=
"Name"
Attribute2=
"LastName"
Attribute3=
"Age"
Attribute4=
"Price"
>
<Person1 Attribute1Person1=
"NamePerson"
Attribute2Person1=
"LastNamePerson"
/>
<Person2 Attribute1Person2=
"NamePerson"
Attribute2Person2=
"LastNamePerson"
/>
<Person3 Attribute1Person3=
"NamePerson"
Attribute2Person3=
"LastNamePerson"
/>
<Person4 Attribute1Person4=
"NamePerson"
Attribute2Person4=
"LastNamePerson"
/>
</Person>
<Man Attribute1=
"Name"
Attribute2=
"LastName"
Attribute3=
"Age"
Attribute4=
"Price"
>
<Man1 Attribute1Person1=
"NameMan"
Attribute2Person1=
"LastNameMan"
/>
<Man2 Attribute1Person2=
"NameMan"
Attribute2Person2=
"LastNameMan"
/>
<Man3 Attribute1Person3=
"NameMan"
Attribute2Person3=
"LastNameMan"
/>
<Man4 Attribute1Person4=
"NameMan"
Attribute2Person4=
"LastNameMan"
/>
</Man>
<Women Attribute1=
"Name"
Attribute2=
"LastName"
Attribute3=
"Age"
Attribute4=
"Price"
>
<Women1 Attribute1Person1=
"NameWomen"
Attribute2Person1=
"LastNameWomen"
/>
<Women2 Attribute1Person2=
"NameWomen"
Attribute2Person2=
"LastNameWomen"
/>
<Women3 Attribute1Person3=
"NameWomen"
Attribute2Person3=
"LastNameWomen"
/>
<Women4 Attribute1Person4=
"NameWomen"
Attribute2Person4=
"LastNameWomen"
/>
</Women>
I search how to extract this document with linq to have only the parent of each element.
<Person Attribute1=
"Name"
Attribute2=
"LastName"
Attribute3=
"Age"
Attribute4=
"Price"
>
<Man Attribute1=
"Name"
Attribute2=
"LastName"
Attribute3=
"Age"
Attribute4=
"Price"
>
<Women Attribute1=
"Name"
Attribute2=
"LastName"
Attribute3=
"Age"
Attribute4=
"Price"
>
Reply
Answers (
1
)
Regarding connection error
Convert Sql Query to Linq ?