英文不好,不知道理解的对不对
老板跟你要一个写日志文件和运行结果文件的解决方案,样式就是上面的样式
是用js写吗?应该不是吧,还有要求里说的那个test tool是什么东西
测试的程序是后台还是前台的程序?

解决方案 »

  1.   

    boss只是要我一个解题的思路,随便什么语言实现都可以,不用管那个testing tool天可怜见,我昨晚才开始学xml,今天中午一点之前就必须交卷:((,这位好心人,你有什么解题思路吗,我的qq是94771,msn是[email protected],多谢了
      

  2.   

    老大们,写代码肯定是来不及了,只要一个思路向boss汇报就可以交差了,不知道老大们对xml熟悉吗
      

  3.   

    这个要用到xml的dom(document object model)解析...
    就是有一个xml文件,然后再有html(中有javascript解析或VBScript解析)文件就可以了以你上面所说的一个xml文件和解析成下面的格式并不难呀
      

  4.   

    用XSLT楼主把源文件Mail到[email protected]
    偶试试
      

  5.   

    Sorry建立xxx.xsl文件,内容    <?xml version='1.0'?>
        <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
        <xsl:template match="/">
          <html>
          <body>
            <table border="0" >
              <tr>
                <th>Event Type</th>
                <th>Result</th>
                <th><![CDATA[Date & Time]]></th>
                <th>Computer Name</th>
             </tr>
              <tr>
                <td colspan="4">===================================================================================================</td>
             </tr>
              <xsl:for-each select="TestLog/LogEvent">
              <tr>
                <td><xsl:value-of select = "LogEventProperty[0]"/></td>
                <td><xsl:value-of select = "LogEventProperty[5]"/></td>
                <td><xsl:value-of select = "LogEventProperty[1]"/><xsl:value-of select = "LogEventProperty[2]"/></td>
                <td><xsl:value-of select = "LogEventProperty[14]"/></td>
              </tr>
              </xsl:for-each>
            </table>
          </body>
          </html>
        </xsl:template>
        </xsl:stylesheet>再建立showlog.htm    <html>
        <body>
        <script language="javascript">
        // Load XML
        var xml = new ActiveXObject("Microsoft.XMLDOM")
        xml.async = false
        xml.load("TestLog.txt")
        // Load the XSL
        var xsl = new ActiveXObject("Microsoft.XMLDOM")
        xsl.async = false
        xsl.load("xxx.xsl")
        // Transform
        document.write(xml.transformNode(xsl))
        </script>
        </body>
        </html>再把testLog.txt拷到同一目录下
    运行showlog.htm由于你贴上的testLog文件不全,找不到 Computer Name在哪里,现假设为在Display Resolution后面
      

  6.   

    我测试用的TestLog.txt<?xml version="1.0" encoding="UTF-8" ?> 
    <TestLog>
    <LogEvent ID="Computer Start">
    <LogEventProperty Name="Event Type" ID="Event Type">
     <![CDATA[ Computer Start
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Start Date" ID="Start Date">
     <![CDATA[ 01/08/2003
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Start Time" ID="Start Time">
     <![CDATA[ 10:23:25
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="End Date" ID="End Date">
     <![CDATA[ 01/08/2003
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="End Time" ID="End Time">
     <![CDATA[ 10:23:25
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Result" ID="Result">
     <![CDATA[ Fail
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Failure Reason" ID="Failure Reason">
     <![CDATA[  
      ]]> 
      </LogEventProperty>
      <LogEventProperty Name="Failure Description" ID="Failure Description" /> 
     <LogEventProperty Name="Error File" ID="Error File">
     <![CDATA[ e000
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Output File" ID="Output File">
     <![CDATA[ o000
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Operating System" ID="Operating System">
     <![CDATA[ Windows
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="OS Version" ID="OS Version">
     <![CDATA[ XP
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Processor" ID="Processor">
     <![CDATA[ Pentium
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Display Resolution" ID="Display Resolution">
     <![CDATA[ 1024x768
      ]]> 
      </LogEventProperty>
     <LogEventProperty Name="Computer Name" ID="Computer Name">
     <![CDATA[ PHYLLISC11147
      ]]> 
      </LogEventProperty>
    </LogEvent>
    </TestLog>