G
Guest
Any help will be really appreciated.
When I use
XmlNodeList nodeList;
XmlElement root = doc.DocumentElement;
nodeList = root.SelectNodes("/bookstore/book");
to select nodes matching the XPath string, from XML file below, I get one
node which is OK.
BUT, if I remove the ":bk" from the attribute of <bookstore> node, I will
not get any nodes. WHY? I want to be able to do that. Thank you for your help.
<?xml version="1.0" encoding="utf-8" ?>
<bookstore xmlns:bk="urn:samples">
<book>
<title>Pride And Prejudice</title>
<author>
<first-name>Jane</first-name>
<last-name>Austen</last-name>
</author>
<price>24.95</price>
</book>
</bookstore>
When I use
XmlNodeList nodeList;
XmlElement root = doc.DocumentElement;
nodeList = root.SelectNodes("/bookstore/book");
to select nodes matching the XPath string, from XML file below, I get one
node which is OK.
BUT, if I remove the ":bk" from the attribute of <bookstore> node, I will
not get any nodes. WHY? I want to be able to do that. Thank you for your help.
<?xml version="1.0" encoding="utf-8" ?>
<bookstore xmlns:bk="urn:samples">
<book>
<title>Pride And Prejudice</title>
<author>
<first-name>Jane</first-name>
<last-name>Austen</last-name>
</author>
<price>24.95</price>
</book>
</bookstore>