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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:56:29+00:00 2026-06-10T06:56:29+00:00

I have an XML file containing 4 different strings, but I am having trouble

  • 0

I have an XML file containing 4 different strings, but I am having trouble deserializing the file. Could someone help me with this?

I looked online for answers, but none of them worked, I’m not sure what to do about it.

Here is the XML file I am trying to deserialize:

<?xml version="1.0" encoding="utf-8"?>
<saveData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<strFolder1>1st Location</strFolder1>
<strFolder2>2nd Location</strFolder2>
<strTabName>newTab0</strTabName>
<strTabText>Main</strTabText>
</saveData>
  • 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-10T06:56:30+00:00Added an answer on June 10, 2026 at 6:56 am

    I’d recommend looking at XmlReader. Some other approaches are easier in different ways, but you can build anything from XmlReader. Such as:

    while(rdr.Read())
      if(rdr.NodeType == XmlNodeType.Element)
        switch(rdr.LocalName)
        {
          case "strFolder1":
            strFolder1 = rdr.ReadContentAsString();
            break;
          case "strFolder2":
            strFolder2 = rdr.ReadContentAsString();
            break;
          case "strTabName":
            strTabName = rdr.ReadContentAsString();
            break;
          case "strTabText":
            strTabText = rdr.ReadContentAsString();
            break;
        }
    

    (We could take some short-cuts if guaranteed the ordering, I did it the hard way to show that the hard way isn’t that hard).

    Using XmlDocument, XmlSerializer and XDocument are easier in a lot of cases, but I recommend learning this first because it’ll handle everything and is never less efficient. If you learn it first the worse that’ll happen is you do a bit more work than necessary to end up with something a bit more efficient than strictly necessary (you’ll do a micro-optimisation out of ignorance of the simpler ways). If you learn the others first the worse that’ll happen is you do a lot more work than necessary to end up with something a lot less efficient than needed.

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

Sidebar

Related Questions

I have an XML file containing different testimonial quotes, including the name of the
I have a general XML file containing different properties for my Play! application like:
I have a xml file containing certain expressions like this :- 1. AAaaaaa-1111 2.
I have a res/values folder containing a strings.xml file and a res/values-XX folder containing
I have a XML file containing metadata like a field's maximum length. I have
I have an HTML file containing these lines - <script>PrintFileURL("13572_BranchInformationReport_2012-06-29.xml","13572_BranchInformationReport_2012-06-29.zip",0,"184277","Jun 29 1:30","/icons/default.gif")</script> <script>PrintFileURL("13572_BranchInformationReport_2012-07-02.zip","13572_BranchInformationReport_2012-07-02.zip",0,"184302","Jul 2
I have an XML file that reads like this <abc> <ab>value</ab> <aa>time</aa> <ac>money</ac> </abc>
I have an XML file containing seed data that I'm trying to load into
in the past hour i have been trying different variants of this query but
I have tons of XML files all containing a the same XML Document, but

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.