13 February 2007

XML namespace prefixes in MSXML


Adding elements


msxml3.dll: Keyword xsl:stylesheet may not contain xsl:include.


Set ndIncl = xslDoc.createNode(1, "xsl:include",

Using XPath


Set nlTemps = xslDoc.documentElement.selectNodes("/xsl:stylesheet/xsl:template")

yields the following error:



xslDoc.setProperty "SelectionNamespaces",



Anonymous said...

This helped me a lot, thx

Rory said...

Recently had this error: "Reference to undeclared namespace prefix: 'xsl'" when performing document.XSLDocument.selectSingleNode(...).

Added the line: document.XSLDocument.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");

And it worked perfectly. Seems that some version of MSXML3 must have an issue. Using IE6, some computers had the error, others did not. Adding the namespace prevents the error if it did occur on a machine.

Anonymous said...

this helped me after two hours of searching through the internet.
Thanks a lot.

Anonymous said...

Thanks, this helped me out!