|
-
March 8th, 2005, 04:18 PM
#1
XPath in C# problems
I have an XMLNode that looks like this:
Code:
<div v:shape="_x0000_s30734" class="CT" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:def="http://www.w3.org/TR/REC-html40">
<span style="position:absolute;
 top:28.51%;left:9.45%;width:81.62%;height:9.38%"><span lang="EN-US"><br /></span></span><span style="position:absolute;top:36.1%;left:9.45%;width:81.62%;
 height:9.38%"><span lang="EN-US" style="mso-special-format:lastCR;display:none"></span></span></div>
I'm running an XPath statement on this node that is supposed to find all of the "span" nodes located under the root "div" tag. The XPath statement I have is:
and I'm calling it like this:
Code:
XmlNodeList xmlSpans = xmlDiv.SelectNodes("/def:div/def:span", xmlns);
this, for some reason, returns absolutely nothing. I know my XmlNamespaceManager is correct, I can run valid XPath statements on other documents using these namespaces. I found a tool called Visual XPath, and loaded the XMLNode (I saved the OuterXML to a document and named it div.xml) into this program, then tried to run the same exact XPath statement there...and it worked! And this program was coded in C#...so I have no idea why my statement isn't working. Anyone have any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|