Microsoft KB Archive/290988

= FIX: Error Using getProperty Method of XMLDOMSelection with SelectionNamespaces =

Article ID: 290988

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft XML Core Services 4.0

-



This article was previously published under Q290988



SYMPTOMS
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.



STATUS
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 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:

http://msdn.microsoft.com/xml/default.asp



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 Step by Step Developing XML Solutions  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.</li>  Paste the following code into the new text document: var xmlDoc = new ActiveXObject(&quot;msxml2.domdocument&quot;); xmlDoc.async = false; xmlDoc.load(&quot;http://localhost/books.xml&quot;);

xmlDoc.setProperty(&quot;SelectionLanguage&quot;, &quot;XPath&quot;); xmlDoc.setProperty(&quot;SelectionNamespaces&quot;, &quot;xmlns:my='urn:http//www.my.com/schema/'&quot;); var nodelist = xmlDoc.documentElement.selectNodes(&quot;child::my:book&quot;);

var stExpected = &quot;xmlns:my='urn:http//www.my.com/schema/'&quot;; var stActual; try {   stActual = nodelist.getProperty(&quot;SelectionNamespaces&quot;); } catch(e) {  WScript.Echo(&quot;Should not have an error:&quot; + e.number + e.description); } WScript.Echo(stExpected==stActual); </li> Save the document as C:\getProperty.js.</li></ol> </li> At a command prompt, execute the script by using the following command:

cscript C:\getProperty.JS

</li></ol>

You receive the &quot;Property name is invalid&quot; error message.

Keywords: kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB290988

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.