Relative Content

Tag Archive for c#xmllinq

Insert prefix in a Xml string [duplicate]

This question already has answers here: How can I write xml with a namespace and prefix with XElement? (5 answers) .NET and SOAP tags question (serialization of object into XML) (1 answer) Closed 2 days ago. I need to be able to write this Xml string: <s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:a=”http://www.w3.org/2005/08/addressing” xmlns:fse=”http://www.sist.puglia.it/Schemas/PDD_SIST/SCATEL/FSE/” xmlns:u=”http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd”> To do this I […]

How to simplify xml

I have an xml config file and with all the processes I’m including, it makes my xml file over 1000 lines long. My team is complaining that the size of the file makes it tough to update. Does anyone have any ideas on how to shorten/simplify the xml document?

Serialize an xElement with namespaces and text values

This is the first time I’ve used System.Xml.Linq to serialize. I have learned many things especially on this site, but now I can’t solve a problem, perhaps trivial, but I can’t.
I need to create this Xml tag:
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ST">**Positive**</value>
But I can’t insert the text value Positive.
This is my code: