When does XPath property have to be set to XML DOM object?

六月ゝ 毕业季﹏ 提交于 2019-12-06 02:13:06

Default language is not XPath for older versions of MSXML.
You've created DomDocument instance using an old, "version independent ProgID". Microsoft.XMLDOM corresponds MSXML 3.0 (if you have) as the last version of MSXML which supported independent ProgIDs.
You can determine default selection language like this :

WScript.Echo objXML.getProperty("SelectionLanguage")

Must be return XSLPattern which a selection language does not supports methods like position().
XPath is default selection language for MSXML 4.0 and later, so you have two choices using XPath properly.

  1. Using older versions specifying selection language as XPath.
  2. Using newer (less older?) versions without specifyng any selection language

From an ancient article that smells like my teenage times describing the difference between XSL Patterns and XPath.

MSXML 2.0 provides support for XSL Patterns, the precursor to XPath 1.0. The notion of an XML addressing language was introduced into the original W3C XSL Working Drafts (http://www.w3.org/TR/1998/WD-xsl-19981216.html) and called XSL Patterns. MSXML 2.0 implements the XSL Patterns language as described in the original XSL specification with a few minor exceptions.

So, I think you were on minor (!) exceptions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!