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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:10:01+00:00 2026-05-30T23:10:01+00:00

I saw this question : XPathDocument vs. XmlDocument But it doesnt have the info

  • 0

I saw this question :

XPathDocument vs. XmlDocument

But it doesnt have the info which im looking for:
my question :

I know that XPathDocument Loads the complete xml into the memory :

My question is from the stage where the xml is already loaded :

which one of them will faster find the desired elements :

XPathDocument with XPathNavigator

or

xmlReader with If’s conditions

  • 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-30T23:10:03+00:00Added an answer on May 30, 2026 at 11:10 pm

    If by

    “the xml is already loaded”

    you mean that it’s already going to be loaded into an XPathDocument or XmlDocument, then the performance of using either the XPathNavigator or XmlReader will be the same. Both will be traversing already parsed, in-memory nodes representing the XPath data model.

    The main difference between the two is the XmlReader will provide forward-only access whereas the XPathNavigator provides cursor access to the document. Directly interacting with XmlReader is very useful when you don’t want to incur the cost of loading entire document in-memory. It’s not so useful otherwise.

    I’d strongly suggest using the XPathNavigator.
    There are two primary ways you can interact with the XPathNavigator:

    1. Build your state machine (using if/elses). One huge plus of doing this with the XPathNavigator rather than the XmlReader is, due to the cursor access model of XPathNavigator, your state machine will be vastly simpler. Ex: Need to see if the parent has a specific attribute? Just navigate to it and take a look.
    2. Use XPath queries to find the data you’re looking for. May not be as fast, but will probably will be less error prone than building your own state machine. Of course this requires you to be versed in XPath.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw this question , which focuses on the Brittney Spears problem. But I
I saw this question already on this forum but I do not know why
I just saw this question: Understanding .NET’s SecurityAction parameter for permissions And I have
I saw this same question for VIM and it has been something that I
I saw this question Simple example of threading in C++ but my problem is
I saw this question, Show Open Dialog on a Button click : 'I have
I saw this question , but the answers there are not very relevant. A
I saw this question, but I didn't find my answer in it.. So, why
I actually saw this question , but couldn't get much from it, so I'll
I have asked this question in Radiant CMS google group, but no one answered

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.