Solved

XmlNode.SelectSingleNode and XPath issue

Posted on 2009-05-03
1
1,085 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
1 Comment
 
LVL 27

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Class object 2 26
Two different visual studio versions 3 22
MS Access how to nest many values to one value when exporting query to XML format 8 44
oracle 11g 23 49
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 synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now