c# - Adding XML Content in string to XDocument -


i have make xml , post url on fly

<student> <name>john</name> <age>17</age> <marks>     <subject>         <title>maths</title>         <score>55</score>     </subject>     <subject>         <title>science</title>         <score>50</score>     </subject> </marks> </student>  string marksxml = "<marks><subject><title>maths</title><score>55</score></subject><subject><title>science</title><score>50</score></subject></marks>"; xdocument doc = new xdocument(new xelement("student", new xelement("name", "john"), new xelement("age", "17"))); 

what needs done embed string marksxml xdocument?

just parse marksxml xelement , add that:

xdocument doc = new xdocument(     new xelement("student",         new xelement("name", "john"),         new xelement("age", "17"),         xelement.parse(marksxml)     ); ) 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -