?
Solved

XmlNode.SelectSingleNode and XPath issue

Posted on 2009-05-03
1
Medium Priority
?
1,099 Views
Last Modified: 2013-12-14
why does the below code not work in that :
- mynode is undefined ?
- yet in Break debug mode i can see the root nicely containing the Function child node that im trying to filter with with SelectSingleNode


XmlDocument^ doc = gcnew XmlDocument;
		doc->Load(fileNamePath);
		
		XmlNode^ mynode;
		XmlNode^ root = doc->DocumentElement;
		// i checked no problems with xml file path or the root document up to here !
		String^ MyXPathQuery = "descendant::LastCue[Function='Default']";
		mynode = root->SelectSingleNode(MyXPathQuery);
 
 
//My XML file (fileNamePath) contents are the following:
 
<?xml version="1.0" encoding="us-ascii" standalone="yes"?><LastCue><Function>Default</Function><Time>52592</Time></LastCue>

Open in new window

0
Comment
Question by:KristjanLaane
[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
1 Comment
 
LVL 27

Accepted Solution

by:
BigRat earned 1500 total points
ID: 24293557
Because the Load operation is being performed asynchronously. Set XmlDoc.async to false.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Suggested Courses

752 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