[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Get value from XPathNavigator

Posted on 2006-11-28
3
Medium Priority
?
533 Views
Last Modified: 2012-06-21
Hi,

I have XPathNavigator,

Now If I get the errors node in the XPathNavigator, then I want the complete errors node into the string

XPathNavigator nav

            XPathNodeIterator iterator = nav.Select("//errors");  

Can anyone help me to get the errors node in the string

Kind Regards
           
0
Comment
Question by:dinesh_bali
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 30

Accepted Solution

by:
anarki_jimbel earned 2000 total points
ID: 18033211
First, you have a set of nodes from the select().
So you may need to walk through all of them.

Convert the error element (I assume it's an XmlElement) - depends on the element structure.
It's better if you know it.
I assume it's simple one, e.g.:

<error id="1234">Some info about the error</error>

In this case you do something like:

            XPathNodeIterator iterator = nav.Select("//errors");

            foreach (XmlNode node in iterator)
            {
                string errorText = (node as XmlElement).InnerText;
                Debug.WriteLine(errorText);
                // or
                string errorID = (node as XmlElement).GetAttribute("id");
                Debug.WriteLine(errorID);
               
            }
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 18036267
can u post ur xml file
0
 

Author Comment

by:dinesh_bali
ID: 18042703
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question