Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:52:43+00:00 2026-05-28T19:52:43+00:00

I have an SslStream from which I receive spontaneous XML messages. I want to

  • 0

I have an SslStream from which I receive spontaneous XML messages. I want to use XmlTextReader to process XML messages from that stream. Unfortunately it allows me reading only 1st XML. When I call Read after the 1st xml is received, the method throws an exception:
Multiple roots in XML documents (“Xml_MultipleRoots”). I believe this is a problem that the stream provides xml messages one by one but the XmlTextReader can handle only one.
How to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:52:44+00:00Added an answer on May 28, 2026 at 7:52 pm

    First of all, don’t use new XmlTextReader() anymore. Use XmlReader.Create(), which has been the preferred way to create an XmlReader since .NET 2.0.

    Second, use the overload of Create that accepts an XmlReaderSettings object:

    using (var reader = XmlReader.Create(sslStream, 
                                         new XmlReaderSettings
                                             {
                                                 ConformanceLevel = ConformanceLevel.Fragment
                                             }))
    {
    // ... read xml
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which uses SslStream to send and receive data with its
Been working on this program which requires the use of a function that compares
Basically I have 14800x8 matrix that has been extracted from matlab as CSV file
i have a data service hosted in azure from which i am sending notification
I want to send unsolicited messages over an SSL connection. Meaning that the server
I have a REST service (Play Framework 2.0 w/Scala) that receives messages via a
Hi I'm having trouble extracting data from this XML document. <messages messageCount=6> <message messageID=9999
I have a program that reads data from a .csv and creates a multimap
I have this code that reads from marks.txt file. #include <iostream> #include <fstream> #include
I have a .Net 3.5 app with a web service that inherits from System.ServiceModel.ClientBase<>,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.