Question

I have a function that gets TextReader I want to use it as `XmlReader:

    private void myFunc(TextReader textReader)
    {
        XmlReader _xml;
        _xml=?
    }

Is there a way to convert TextReader to XmlReader?

Était-ce utile?

La solution

Use XmlReader.Create(TextReader) for creating the new instance of XmlReader

XmlReader

Autres conseils

Try:

XmlReader reader = XmlReader.Create(textReader);

From the docs

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top