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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:21:54+00:00 2026-05-27T10:21:54+00:00

I am trying to get my XPathNavigator to work ( to go to previous

  • 0

I am trying to get my XPathNavigator to work ( to go to previous attribute name “NAME”) with attached piece of code but somehow it doesn’t want to move.
Neither thisNavigator.MoveToFirstAttribute() nor thisNavigator.MoveToAttribute("NAME", ""); works…

My xml contents looks more or less less like this

<PARAM NAME="Debug" HINT="Debug" TYPE="Int" VALUE="1" LEVEL="3"/>

My code:

 switch (thisNavigator.Name)
 {
        case "VALUE":
        {
            thisNavigator.MoveToFirstAttribute();
            thisNavigator.MoveToAttribute("NAME", "");
        }

EDIT
Just to be sure I have just checked :

string x = thisNavigator.NamespaceURI;

and it’s indeed empty so now I am even more confused.

EDIT2
Ok I have solved this but kind of a long way around. I have to go back to parent, then back to this child and then to the attribute with given name. If anyone knows why it doesn’t want to go to given attribute ‘backwards’ I would be grateful for answer. Here’s my code:

    thisNavigator.MoveToParent();
    thisNavigator.MoveToFirstChild();
    thisNavigator.MoveToAttribute("NAME", "" );
  • 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-27T10:21:54+00:00Added an answer on May 27, 2026 at 10:21 am

    Ok I have solved this but kind of a long way around. I have to go back
    to parent, then back to this child and then to the attribute with
    given name

    The provided code:

           thisNavigator.MoveToAttribute("NAME", "" );   
    

    means: if thisNavigator represents an element that has an attribute named "NAME", “move-to” that attribute.

    The most-likely reason this is unsuccessful is that thisNavigator doesn’t represents an element at all, or represents an element that doesn’t have an attribute named "NAME" .

    The following excerpt from the MSDN documentation may be helpful:


    Remarks


    If the XPathNavigator is not currently positioned on an element, this method returns false.

    After a successful call to MoveToAttribute, the LocalName, NamespaceURI and Prefix properties reflect the values of the attribute. When the XPathNavigator is positioned on an attribute, the methods MoveToNext, MoveToPrevious, and MoveToFirst are not applicable. These methods always return false and do not change the position of the navigator. Rather, you can call MoveToNextAttribute to move to the next attribute node.

    Once positioned on an attribute, you can call MoveToParent to move to the owner element.

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

Sidebar

Related Questions

I'm trying get some licensing code from AndroidPit.com working, but I get Unable to
I am trying get Struts 2 and Tiles to work and I am using
Trying to get this expression to work, can someone look at it and tell
When I'm trying get method from remote webservice it gives me error. My code
Hello everyone I been trying get php uploader working but having a lot of
Trying to get these list headings to line up correctly, but I can't figure
I'm trying get LocalConnection to work between two swf's placed within two different IFRAMES.
This doesn't seem like it should be difficult, but I'm stuck currently. I'm trying
Hi am trying get GPS using network provider and GPS provider. but am getting
I'm trying get only the Saturdays and Sundays between two dates, but I don't

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.