Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 290988 - Last Review: October 16, 2002 - Revision: 1.4
FIX: Error Using getProperty Method of XMLDOMSelection with SelectionNamespaces
This article was previously published under Q290988
When you use the
getProperty method of a nodelist to retrieve the
SelectionNamespaces property of a
XMLDOMSelection object, you may receive the following error message:
-2147467259 Property name is invalid.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in Microsoft XML 3.0 Service Pack 1.
For additional information on other fixes included in Microsoft XML 3.0 Service Pack 1, click the article number below
to view the article in the Microsoft Knowledge Base:
292935Â
(http://kbalertz.com/Feedback.aspx?kbNumber=292935/EN-US/
)
INFO: List of Issues Fixed in Microsoft XML 3.0 Service Pack 1
For the latest information and downloads of MSXML, refer to the following MSDN Web site at:
Steps to Reproduce Behavior
- Create a sample XML file:
- Create a new text document by using Windows Notepad or another text editor.
- Paste the following code into the new text document:
<?xml version="1.0"?>
<books>
<book>
<title>XML Step by Step</title>
</book>
<book>
<title>Developing XML Solutions</title>
</book>
</books>
- Save the file as Books.xml in the home folder of your default Web site (this is typically C:\InetPub\WWWRoot).
- Create a sample Windows script:
- Create a new text document by using Windows Notepad or another text editor.
- Paste the following code into the new text document:
var xmlDoc = new ActiveXObject("msxml2.domdocument");
xmlDoc.async = false;
xmlDoc.load("http://localhost/books.xml");
xmlDoc.setProperty("SelectionLanguage", "XPath");
xmlDoc.setProperty("SelectionNamespaces", "xmlns:my='urn:http//www.my.com/schema/'");
var nodelist = xmlDoc.documentElement.selectNodes("child::my:book");
var stExpected = "xmlns:my='urn:http//www.my.com/schema/'";
var stActual;
try
{
stActual = nodelist.getProperty("SelectionNamespaces");
}
catch(e)
{
WScript.Echo("Should not have an error:" + e.number + e.description);
}
WScript.Echo(stExpected==stActual);
- Save the document as C:\getProperty.js.
- At a command prompt, execute the script by using the following command:
cscript C:\getProperty.JS
You receive the "Property name is invalid" error message.
| kbbug kbfix kbfix kbmsxml300sp1fix kbmsxmlnosweep KB290988 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate