Can you post the xml and what is that you want to read from xml as well. From your post I understand an element with name "item" will be inside a root nod and "item" element have sub elements/nodes which are also "item". Can you see the following xml and
confirm is this what your xml looks like.
i need to read the item containers inside list, table, list and sub list into xml . use that xml i need to dynamically create controls. i don't know they do in sharepoint form designer.
In the sharepoint form designer we can drag and drop the items, tables and tabs to crate custom form.
XDocument d = XDocument.Load(new StringReader("your xml here"));
var items = from y in d.Descendants("item")
select y;
foreach (var i in items)
Console.WriteLine(i);
There is a lot of information regarding this matter, just try to search this forum or google.
Dim po As XDocument = XDocument.Load("PurchaseOrders.xml")
' LINQ to XML query
Dim el1 As XElement = po.Root
' XPath expression
Dim el2 As XElement = po.XPathSelectElement("/PurchaseOrders")
If el1 Is el2 Then
Console.WriteLine("Results are identical")
Else
Console.WriteLine("Results differ")
End If
Console.WriteLine(el1.Name)
Participant
1779 Points
1301 Posts
read xml
Nov 06, 2014 03:22 AM|sivakl_2001|LINK
hi
i need to read the xml in the string variable. the "item" can be inside main node and can be inside sub nodes.
i need to read direct child nodes(item) only. i don't want to read all item node at one time.
Star
8111 Points
2102 Posts
Re: read xml
Nov 06, 2014 04:25 AM|chandrashekar|LINK
Hi
Can you post the xml and what is that you want to read from xml as well. From your post I understand an element with name "item" will be inside a root nod and "item" element have sub elements/nodes which are also "item". Can you see the following xml and confirm is this what your xml looks like.
Please try the answer for the post and finally Don't forget to click “Mark as Answer” on the post that helped you.
Participant
1779 Points
1301 Posts
Re: read xml
Nov 06, 2014 04:36 AM|sivakl_2001|LINK
i need to read the item containers inside list, table, list and sub list into xml . use that xml i need to dynamically create controls. i don't know they do in sharepoint form designer.
In the sharepoint form designer we can drag and drop the items, tables and tabs to crate custom form.
hope you understand my problem.
All-Star
35149 Points
9075 Posts
Re: read xml
Nov 07, 2014 04:34 PM|smirnov|LINK
What it the exact issue?
To read you can simply use
There is a lot of information regarding this matter, just try to search this forum or google.
Star
8111 Points
2102 Posts
Re: read xml
Nov 10, 2014 03:16 AM|chandrashekar|LINK
Hi
You wanted to read the child elements from the "item" node?
e.g: Considering the first element which has label and width you wanted to read those. Is that correct?
Please try the answer for the post and finally Don't forget to click “Mark as Answer” on the post that helped you.
Participant
1779 Points
1301 Posts
Re: read xml
Nov 13, 2014 02:00 AM|sivakl_2001|LINK
i have posted the xml format
i need to read direct item child node from items node i don't want to read sub sub item nodes
Participant
1779 Points
1301 Posts
Re: read xml
Nov 13, 2014 02:43 AM|sivakl_2001|LINK
i had find the solution
i can get the root node using the following code
Participant
1779 Points
1301 Posts
Re: read xml
Nov 14, 2014 11:35 PM|sivakl_2001|LINK
if i use smirnov code it will return all item nodes inside the xml
i want to get only direct item child nodes