Solved

XmlNode.SelectSingleNode and XPath issue

Posted on 2009-05-03
1
1,087 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but breaks when I add one section 4 29
reading excel file in .net 2 32
ASP and Looping Thru a XML Document 4 33
Powershell Regex Replace Question 5 24
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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

726 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