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 8293869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:59:03+00:00 2026-06-08T13:59:03+00:00

sRecieved = <XmlClient>2.0</XmlClient><XmlVersion>3.0</XmlVersion> Dim xml As New XmlDocument(); xml.LoadXml(sRecieved); There are multiple root elements

  • 0
sRecieved = "<XmlClient>2.0</XmlClient><XmlVersion>3.0</XmlVersion>" 
Dim xml As New XmlDocument();    
xml.LoadXml(sRecieved);

There are multiple root elements …..i want xmlclient value and xmlversion value

  • 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-06-08T13:59:04+00:00Added an answer on June 8, 2026 at 1:59 pm

    Well yes, your data isn’t a valid XML document. (The error message is pretty clear – you’ve got multiple top-level elements.) You could make it a valid document by adding a dummy root element:

    xml.LoadXml("<root>" & sReceived & "</root>")
    

    … but if you get the chance to change whatever’s sending the data, it would be better if it sent an actual XML document.

    EDIT: If you’re able to use LINQ to XML instead of XmlDocument, getting the client number and the version number are easy. For example, as text:

    Dim clientVersion = doc.Root.Element("XmlClient").Value
    Dim xmlVersion = doc.Root.Element("XmlVersion").Value 
    

    EDIT: Okay, if you’re stuck with XmlDocument, I believe you could use:

    Dim clientVersionNode = doc.DocumentElement.GetElementsByTagName("XmlClient")(0)
    Dim clientVersion = (CType(clientVersionNode, XmlElement)).InnerText
    

    (and likewise for xmlVersion)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recieved multiple xml documents that I have to transform through xsl into
I previous recieved help with a problem, getting a multiple option select form to
When i tried to send some values with h:commandButton... i recieved null value in
Hi i want to send sms from ipod and also i will check whether
I recieved a Flex project and I want to try to compile and run
I am not familiar with various XML formatting I have recieved XML document most
i add share button to my app , what i wonder if there is
am using C#, I recieved data from xml file and place it in gridview,
I have this method: - (void)reloadMessages:(NSNotification *)notification { NSLog(@RECIEVED NEW MESSAGES TO MessagesRootViewController); //
I want to know everything that happens when a request is recieved by a

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.