i want select xyzitem below xelement. want know best way select xyzitem using linq or lambda. want print value of "no" tag of each xyzitem. suggestion helpful me.
<soap:body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <updatemultiple_result xmlns="urn:microsoft-dynamics-schemas/page/xyzitem"> <xyzitem_list> <xyzitem> <no>n2610</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>bb8100</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>sw810i</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>8525pda</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>mm-a900m</no> </xyzitem> <xyzitem> <no>ma464ll/a</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>lx.fr206.001</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>vgn-txn27n/b</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>m285-e</no> <description>productdescription</description> </xyzitem> <xyzitem> <no>cn_3</no> <description>productdescription</description> </xyzitem> </xyzitem_list> </updatemultiple_result> </soap:body>
thanks
kishore k
you have namespace declared, should use provide names of elements:
xdocument xdoc = xdocument.parse(xml); xnamespace ns = "urn:microsoft-dynamics-schemas/page/xyzitem"; var numbers = in xdoc.descendants(ns + "xyzitem") select (string)i.element(ns + "no");
Comments
Post a Comment