请教诸位大侠一个有关xml的问题,老美限我二十四小时内解决,请大伙多多帮忙提供一个思路啦 英文不好,不知道理解的对不对老板跟你要一个写日志文件和运行结果文件的解决方案,样式就是上面的样式是用js写吗?应该不是吧,还有要求里说的那个test tool是什么东西测试的程序是后台还是前台的程序? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 boss只是要我一个解题的思路,随便什么语言实现都可以,不用管那个testing tool天可怜见,我昨晚才开始学xml,今天中午一点之前就必须交卷:((,这位好心人,你有什么解题思路吗,我的qq是94771,msn是[email protected],多谢了 老大们,写代码肯定是来不及了,只要一个思路向boss汇报就可以交差了,不知道老大们对xml熟悉吗 这个要用到xml的dom(document object model)解析...就是有一个xml文件,然后再有html(中有javascript解析或VBScript解析)文件就可以了以你上面所说的一个xml文件和解析成下面的格式并不难呀 用XSLT楼主把源文件Mail到[email protected]偶试试 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后面 我测试用的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> javascript的url截取问题希望高手帮忙 window.showModalDialog 子页面显示出现滚动条 encodeuri 返回的是什么编码 求教+的写法 初学javascript 基础问题 关于firefox中的事件,搞了半天,谢谢了! 怎么判断一个Function是否存在 一个frame的js代码如何探测另一个frame中的element是否存在? js 弹出窗体 在现求救!!!兄弟们帮帮忙! 请问在javascript中有没有和vbscript的string一样的函数? document.write()能不能在现有的表单中插一个文本框啊?
就是有一个xml文件,然后再有html(中有javascript解析或VBScript解析)文件就可以了以你上面所说的一个xml文件和解析成下面的格式并不难呀
偶试试
<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后面
<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>