`
XElement config = XElement.Parse (
@"<Response SessionId='426D9AEB1F684849A16D79A6CF48582B' xmlns='http://schemas.tmaresources.com/timssws60.xsd'>
<Status Success='true' Message='Connected' ErrorCode='0' />
</Response>");
XElement response = config.Element("Response");
sessionID = (string)response.Attribute("SessionId");`
why i...
XElement config = XElement.Parse(
@"<Response SessionId='BEDF38F9ADAB4F029404C69E49951E73' xmlns='http://schemas.sample.com/sample.xsd'>
<Status Success='true' Message='User is now logged in.' ErrorCode='0' />
<UserID>80077702-0</UserID>
</Response>");
string masterID = (string)config.Element("UserID")
How to get the...
I'm currently trying to find a way of adding some extra elements to existing xml documents in schema order.
The xml has a schema attached to it but I've been unable to find a way to get XDocument manipulations to conform to the schema order.
Example schema extract
<xs:element name="control" minOccurs="1" maxOccurs="1">
<xs:complexT...
I have an xml file which has kind of similar structure that you can see below:
I would like to select title and subitems using linq to xml. The difficulties that I have
sometimes subitem can be just one and sometimes it can be 20 subitems.
and I need to add them to List
<?xml version="1.0"?>
<items>
<item>
<title>Name of the title</t...
I am trying to get both the next and previous elements of the current element
Here is the xml
<template id="9">
<tabs>
<tab>
<name>test</name>
<description />
</tab>
<tab>
<name>test3</name>
<description />
</tab>
<tab>
<name>test7</name>
<description />
</tab>
</tabs>
<...
<Response SessionId="55C10AC0E63B44FCB1868FF4B49E6DF7" xmlns="http://MySample.Sample.com/Sample.xsd">
<Status Success="true" Message="OK" ErrorCode="0" />
<Data>
<List Name="My.API.Customer.Customers" Type="My.API.Customer.Customers">
<Item Key="12345678-0" State="Unchanged">
<Value Name="MasterCustomerId" Value="123456...
I want to swap two xml elements. How do i do this? Here is the code. I tried the solution here but it did not work for me after all. I want to swap the both elements. When I run the program the elements are not swapped but when I call ToList() it is swapped in the List but not swapped in the doc variable
<template id="12">
<tabs>
...
Coding Platform: ASP.NET C#
I have an XML like this.
<Items>
<Map id="35">
<Terrains>
<Item id="1" row="0" column="0"/>
<Item id="1" row="0" column="1"/>
<Item id="1" row="0" column="2"/>
<Item id="1" row="0" column="3"/>
<Item id="1" row="0" column="4"/>
...
I have an array of Car objects and using the following piece of code I create an XML Document from these objects. I have set up a counter variable i to be able to index the Car elements in the document. Is there a different way of obtaining the index of the currently processed element?
int i = 0;
XDocument doc =
...
Hello,
I'm getting the data from sharepoint wbesite using
activeItemData = ws.GetListItems(listGUID, activeItemViewGUID,
qNode, vNode, rowLimit, null, "");
Here is what I got from the sharepoint its one record.
<**rs:data** ItemCount="1" ListItemCollectionPositionNext="Paged=TRUE&p_ID=1" xmlns:rs="urn:schemas-microsoft-c...
I have some XML:
<Request>
<EmailAddress>string</EmailAddress>
<Item>
<name>FirstName</name>
<value>John</value>
</Item>
<Item>
<name>LastName</name>
<value>Doe</value>
</Item>
</Request>
My object:
public class TheObject{
publ...
I'm simply trying to query an xml document and iterate over the results minus specific elements. Ideally I would like to achieve this in the query rather than removing it from the collection before or during iteration.
<body>
Stuff I want
<element>
Stuff I dont want
</element>
</body>
I tried something along these l...
I am trying to extract data from XML file and save it my C# class/object. My problem is
I have an XMl file like this
<personal_auto xmlns = "http://cp.com/rules/client">
<claim id = "s1" type = "Subject Section">
<report >
</report>
<policy>
</policy>
</claim>
<claim id = "s2" type = "Vehichle Section">
...
Hello,
I am trying to extract data from XML. I generated C# classes using XSD of this XML file. I am trying to get the data from XML file and save it C# class.
I am running into NULLReferenceException Was Unhadled by User; "Object reference not set to an instance of an object." error.
My XML File
<clue_personal_auto xmlns = "http://...
I know something similar has already been asked, but here's my problem.
In a MDI WinForm I want to save each child window position and state, per application user, that is different by the logged in Windows user. My application has its own users; so I won't use the user settings like my.Settings... etc.
One option is to read/write dire...
I have an XML in this format which is mapped to corresponding Objects in VB.NET.
<Control Name="LoginPage" LabelAlignment="Right" FieldAlignment="Left" DisplayPoweredByLogo="False">
<Fields>
<FieldGroup Name="Admin" Visible="True" LayoutPosition="Left">
<AdminID Visible="False" Required="False" EnableChange="False" Max...
Hey Everyone, I have spent quite a few hours reading and learning about linq to xml, but i have hit a roadblock here. Here is an example of my xml file:
<project>
<project_number>20071234</project_number>
<project_name>ProjectA</project_name>
<project_unc>\\fileserver1\projects\</project_unc>
<contract>
<full_name>Contr...
If you have an XElement obj how do you get the tag name of the xelement object?
doc.Descendants("name").Where(x => (string) x == cit.name).FirstOrDefault().Parent
i would like to get the tagname of this xelement object.
...
I'm starting to learn asp.net and c# at work and I've been given a project to create and fix web pages in asp.net.
I am having trouble with one of the functions to display the data from xml to web page.
The intention of the code is to get the latest record(date and no time) at the top and the rest of records with same common name for s...
I am looking for something other than XmlReader.
I want to apply a query and load only the data that is needed.
Actually I want to load as little of the xml as possible.
Maybe some kind of XQuery utility/class could do the trick.
...