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?

Was it helpful?

Solution

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

XmlReader

OTHER TIPS

Try:

XmlReader reader = XmlReader.Create(textReader);

From the docs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top