Save attribute value of xml element with single quotes using linq to xml.
How do I make the XDocument object save an attribute value of a element with single quotes? ...
How do I make the XDocument object save an attribute value of a element with single quotes? ...
Here's the deal. I have an XML document with a lot of records. Something like this: print("<?xml version="1.0" encoding="utf-8" ?> <Orders> <Order> <Phone>1254</Phone> <City>City1</City> <State>State</State> </Order> <Order> <Phone>98764321</Phone> <City>City2</City> ...
Anyone know off the top of their heads how to convert a System.Xml.XmlNode to System.Xml.Linq.XNode? ...
I'm working with an existing XML document which has a structure (in part) like so: <Group> <Entry> <Name> Bob </Name> <ID> 1 </ID> </Entry> <Entry> <Name> Larry </Name> </Entry> </Group> I'm using LINQ to XML to query the XDocument to retrieve all these entries as follows: var items = from g in...
Hello, I am trying to merge several XML files in a single XDocument object. Merge does not exist in XDocument object. I miss this. Has anyone already implemented a Merge extension method for XDocument, or something similar ? ...
HI, Is there any 'correct' way to convert an XElement to an XmlNode in C# - LinqToXML makes it nice to build the required XML programmatically but SharePoint web services requires an XmlNode, so whats the best way to mix and match? ...
Hi All, I need to be able get a single specific attribute from an element with a specific local name but any namespace (if you are familiar with XMPP you will understand why). Apart from writing my own (enumerator or single select) extension methods, any ideas? I have the following, but I don't like it at all: XAttribute from ...
Given this XML ... <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Name>public.rpmware.com</Name> <Prefix></Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <IsTruncated>false</IsTruncated> <Contents> <Key>0.dir</Key> <LastModified>2008-06-25T16:09:49.000Z</LastModified> <ETag>"0ba2a466f9dfe225d7ae852...
Given the following XML 'template': <Request module="CRM" call="list_service_features" id="{ID}"> <block name="auth"> <a name="username" format="text">{USERNAME}</a> <a name="password" format="password">{PASSWORD}</a> <a name="client-id" format="counting">{CLIENT-ID}</a> </block> <a name="service-id" format="countin...
I have written a LINQ to XML query that does what I want, but it looks pretty ugly. I am wondering, how would you guys format the following query in a way that doesn't look quite so garish? Apologies if my example is a bit verbose. The XML documents I am querying have the following structure: <?xml version="1.0" encoding="iso-8859-1"...
Say I have a xml document that looks like this <foo> <bar id="9" /> <bar id="4" /> <bar id="3" /> </foo> I would like to use linq to reset the id's to 0, 1 ,2. What would be the easiest way to do this? Thanks ...
Hi, I am saving some small images to Xml as a Byte[] via the following XElement construct.. XElement xe = new XElement("Images", from c in qry select new XElement("Image", new XAttribute("Date", c.Date), new XElement("Data", c.Bytes))); the Bytes property is a Byte[], looking at the resulting elem...
Greetings! If I have XML such as this: <Root> <AlphaSection> . . . </AlphaSection> <BetaSection> <Choices> <SetA> <Choice id="choice1">Choice One</Choice> <Choice id="choice2">Choice Two</Choice> </SetA> <SetB> <Choice ...
Hello! If got 2 Questions: 1. I've sarted working around with Linq to XML and i'm wondering if it is possible to change a XML document via Linq. I mean, is there someting like XDocument xmlDoc = XDocument.Load("sample.xml"); update item in xmlDoc.Descendants("item") where (int)item .Attribute("id") == id ... 2. I already know how ...
I am trying to load an xml file that is stored as a resource in my C# project so I can perform various LINQ queries. However at runtime an "Illegal characters in path" exception is thrown. This is how I am loading the file: XDocument doc = XDocument.Load(MyProject.Properties.Resources.XMLFile); ...
Greetings! I have some XML like this: <Root> <AlphaSection> . . . </AlphaSection> <BetaSection> <Choices> <SetA> <Choice id="choice1"> <Title>Choice 1 Title</Title> <Body>Choice 1 Body</Body> </Choice> <...
Lets say I have a simple chunck of XML:- <root> <item forename="Fred" surname="Flintstone" /> <item forename="Barney" surname="Rubble" /> </root> Having fetched this XML in Silverlight I would like to bind it with xaml of this ilke:- <ListBox x:Name="ItemList" Style="{StaticResource Items}"> <ListBox.ItemTemplate> <...
I have an XML document looking similar to this: <items> <item cat="1" owner="14">bla</item> <item cat="1" owner="9">bla</item> <item cat="1" owner="14">bla</item> <item cat="2" owner="12">bla</item> <item cat="2" owner="12">bla</item> </items> Now I'd like to get all unique owners (I actually only need the attribute value of the ...
I have an html table <table border="0" width="100%"> <tr class="headerbg"> <th width="5%"> No </th> <th width="30%"> Name </th> <th width="20%"> Department or Division </th> <th width="25%"> ...
I have an XML feed (which I don't control) and I am trying to figure out how to detect the volume of certain attribute values within the document. I am also parsing the XML and separating attributes into Arrays (for other functionality) Here is a sample of my XML <items> <item att1="ABC123" att2="uID" /> <item att1="ABC345" att2="uID...