XmlTextWriter add schema deff from string

I have my schema deff in string:

string sch =  "ExpiredRecurringItemList xmlns \"https://secure.exectracash.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"https://secure.e.ectracash.net MyPath.xsd\"  ";

I have my XML output working fine in XmlTextWrite.

How do I add that sch above to the XmlTextWriter object?  

This is my code :
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
        W.WriteName( "ExpiredRecurringItemList xmlns \"https://secure.exectracash.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"https://secure.e.ectracash.net MyPath.xsd\"  ");
       

I bomb on the WriteName.

any ideas?

LVL 1
srussell705Asked:
Who is Participating?
 
topdog770Connect With a Mentor Commented:
Here's a pretty decent web page ( & site )

http://www.vijaymukhi.com/documents/books/csclasses/chap7.htm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.