xsl + xml 在.net 里面是不是不支持 <xsl:if expr="this.getAttribute('readonly')=='yes'"></xsl:if> 这种写法啊?在vb里面是可以的。
。net 里面只可以用 test嘛? 如果我要 <xsl:if test=''></xsl:if> 里面写javascript 代码来判断应该点写呢?

解决方案 »

  1.   

    在VB里可以干什么?
    xsl+xml只遵循xml规范和xsl语法.你现在要做什么?
      

  2.   

    噢!原来在webclass 里面合成 xml+xsl 成功的。现在改在.net 里面就出错了。后来发现是不能用 <xsl:if expr= > 这种写法,只能用<xsl:if test=>。 
    报错时好像话不支持 xmlns:xsl="http://www.w3.org/TR/WD-xsl" 这个协议
      

  3.   

    http://www.w3schools.com/xsl/xsl_if.asp
      

  4.   

    报出来的错是:
    'expr' is an invalid attribute for the 'if' element. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.Xsl.XsltException: 'expr' is an invalid attribute for the 'if' element.
      

  5.   

    但是在
    xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional" 下 <xsl:if expr= > 是可以的。
    在点net里  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 下 <xsl:if expr= >
    就不行了。
    如果在点net下用回xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional" ,连doc.load(xsldoc)都出错。说xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional" 这种协议太久不支持了。因为原来的xsl是一直用开的,不可以随便改,现在用在。net 下就出这个问题,请问在不改原来的xsl文件的前提下怎样才能在。net下用呢?