可以传递一个参数给xsl文件.
list函数中可以这样
objCache   = new ActiveXObject("Msxml2.XSLTemplate");
objCache.stylesheet = listXSL.XMLDocument;
var proc = objCache.createProcessor();
proc.input = albumXML;
proc.addParameter( "hPos", dirID);
proc.transform();
document.getElementById('list').innerHTML = proc.output;
-----------------------
list.xsl中需要加一个接收参数的变量
<xsl:param name="hPos"/>
然后在后面可以应用它
<xsl:for-each select="Data/Dir[position()=$hPos]">