for example, xml document is below, It has a default namespace
"xmlns='qwer://test'".
string xmlText = "<test
xmlns='http://test'><clear/><clear/></test>";
I would like to select node list "clear" with XPath Expression.
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml( xmlText );
XmlNamespaceManager xsn = new XmlNamespaceManager(
xmlDoc.NameTable );
xsn.AddNamespace( "", "http://test" );
string xPath = "//clear";
XmlNodeList nodes = xmlDoc.SelectNodes( xPath, xsn );
But, the result of "nodes.Count" is always "zero".
How can I select node list of "clear" ?
--
======= .NETXpert ==========
url : http://www.dotnetxpert.com
eml : ke***@dotnetxpert.com
msn: ke******@magicn.com
MCSD.NET
==========================