I'm trying to write to an XML file to the isolated storage but I would like to format it like this:-
<SampleData>
<Item Property1="AliquaXX" />
<Item Property1="Integer" />
<Item Property1="Quisque" />
<Item Property1="Aenean" />
<Item Property1="Mauris" />
<Item Property1="Vivamus" />
<Item Property1="Nullam" />
<Item Property1="Nam" />
<Item Property1="Sed" />
<Item Property1="Class" />
</SampleData>
but I'm buggered if I can work it out, can anyone help?
Thanks, struggling newbie.
I suspect you need to create an
XmlWriterSettings
with the behaviour you want (indentation etc) and then pass that to theXmlWriter
on creation. Just settingIndent
to true may well be enough:You can use
DataSet.GetXML()
It is not related to XmlWriter but you can use it for formatting XML.
You can customize the xml output via the XmlWriterSettings.
You didn't include any code, but you can set the XmlWriterSettings when you create the XmlWriter. You can also just use something like: