我有MSXMLDOMDocument的經典ASP環境。加載的XML是一個XSL:Howto獲取MSXMLDOMDocument.selectSingleNode使用命名空間
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
exclude-result-prefixes="xhtml xsl fn xs xdt">
</xsl:stylesheet>
我試圖讓樣式表的版本,在這個例子中就是這個值「2.0」。 我想爲這個purpouse使用XPath,但是我的問題是我不知道如何將xsl的命名空間添加到傳統asp的xpath引擎中。
問題:如何在傳統的asp中使用MSXMLDOMDocument獲取xsl:stylesheet的版本屬性?
好問題,+1。查看我的答案,獲得完整,簡短和簡單的解決方案。還提供了詳細的解釋。 –