Re: [xsl] Problems with usage of XPath functions as argument in selectNodes method of MSXML2

Subject: Re: [xsl] Problems with usage of XPath functions as argument in selectNodes method of MSXML2
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 5 Mar 2002 12:27:54 +0000
Hi Ratul,

> And if I give the setProperty statement then it gives the following error :
> Reference to undeclared namespace prefix: 'xsl'. 

You need to use the setProperty() method again:

  /* Tell MSXML to use XPath with this DOM */
  oXMLDoc.setProperty("SelectionLanguage", "XPath");
  
  /* Set the namespace-prefix associations through things that look
     like namespace decarations */
  oXMLDoc.setProperty("SelectionNamespaces",
                      "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");

  /* Run the query */
  var oNodeList =
    oXMLDoc.selectNodes("//xsl:text[contains(., 'abc')]");

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread