XmlTextWriter add schema deff from string

Posted on 2006-05-01
Last Modified: 2008-02-01
I have my schema deff in string:

string sch =  "ExpiredRecurringItemList xmlns \"\" xmlns:xsi=\"\" xsi:schemaLocation=\" 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;

        // now fill in the tables / rows / columns
        W.WriteName( "ExpiredRecurringItemList xmlns \"\" xmlns:xsi=\"\" xsi:schemaLocation=\" MyPath.xsd\"  ");

I bomb on the WriteName.

any ideas?

Question by:srussell705
    1 Comment
    LVL 12

    Accepted Solution

    Here's a pretty decent web page ( & site )

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now