Can you clarify your question? Does the child element already exists? Does the attribute already exist? Do you just want to set a value for the attribute or create it and set a value? Do you want to do this for all children of an element? What have you tried
so far?
Ravi Kovoor
Member
8 Points
53 Posts
Linq to XML
Dec 05, 2012 07:18 PM|LINK
How to add Attributes to children of xelement???
Mikesdotnett...
All-Star
154818 Points
19853 Posts
Moderator
MVP
Re: Linq to XML
Dec 06, 2012 05:12 AM|LINK
Can you clarify your question? Does the child element already exists? Does the attribute already exist? Do you just want to set a value for the attribute or create it and set a value? Do you want to do this for all children of an element? What have you tried so far?
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Linq to XML
Dec 07, 2012 12:41 AM|LINK
Hi,
Suppose your xml looks like this:
And now you can use XDocument to fetch the child element and do adding attributes;)