How to format XML using WriteStartDocument WriteStartElement WriteAttributeString in C#?



I want the XML in format like:



<?xml version="1.0" encoding="UTF-8"?>
<ftc:A xmlns="urn:oecd:ties:stfatypes:v1" xmlns:ftc="urn:oecd:ties:a:v1" xmlns:xsi="http://ift.tt/1wOXoHY" version="1.1" xsi:schemaLocation="urn:oecd:ties:a:v1 aXML_v1.1.xsd">
<ftc:b>
<z>1</z>
<x>CO</x>
</ftc:b>
</ftc:A>


I've had trouble writing the attributes whit the methods:



writer.WriteStartDocument ();
writer.WriteStartElement ();
writer.WriteAttributeString ();
writer.WriteElementString ();


I just need the example in C# please :)


No comments:

Post a Comment