>I am passing a ds to a GenXML function, and it's fine.
>
>private string GenXMLOut(DataSet ds)
> {
>
> StringWriter stringWriter = new StringWriter();
> XmlTextWriter W = new XmlTextWriter(stringWriter);
>
> //Use indentation for readability.
> W.Formatting = Formatting.Indented;
> W.Indentation = 4;
>
> W.WriteStartDocument();
> // now fill in the tables / rows / columns
> for (int t = 0; t < ds.Tables.Count; t++)
> {
>
> }
> W.Flush();
> return stringWriter.ToString();
> }
>
>I need to add this schema text in line #2 of said string.
>
>bracket here { ExpiredRecurringItemList xmlns ="https://secure.electracash.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>bla bla bla
>
>Where can fetch that from? Or how do I pass in double quotes in C# in a string?
>
>TIA
>
>__Stephen
Stephen,
It looks like you are creating an XML file from the data in a dataset. There is a built-in method to do this using an XmlDataDocument object. You can pass a dataset in the constructor and then use the Save method to write the data to an XML file.
So instead of hard-coding the exact formatting of the file, you would accomplish the same thing by applying attributes to the dataset schema (the XSD file).
To use double-quotes inside of a C# string literal, type \".
ns = "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";