zoukankan      html  css  js  c++  java
  • XML联合XSL输出html

    ‘QTP的结果文件RES中的XML文件

    sResultsXML = “C:\Documents and Settings\Administrator\桌面\Test1\Res3\Report\Results.xml”

    ‘需要的模版文件XSL
    sDetailedXSL = “D:\Program Files\HP\QuickTest Professional\dat\PDetails.xsl”

    ‘调用转换函数输出HTML
    ApplyXSL sResultsXML, sDetailedXSL, “c:\tt.html”

    ‘转换函数

    Public Function ApplyXSL(ByVal inputXML, ByVal inputXSL, ByVal outputFile)
    sXMLLib = “MSXML.DOMDocument”
    Set xmlDoc = CreateObject(sXMLLib)
    Set xslDoc = CreateObject(sXMLLib)

    xmlDoc.async = False
    xslDoc.async = False

    xslDoc.load inputXSL
    xmlDoc.load inputXML

    outputText = xmlDoc.transformNode(xslDoc.documentElement)
    outputText=replace(outputText,”UTF-16″,”gb2312″)
    Set FSO = CreateObject(“Scripting.FileSystemObject”)

    Set outFile = FSO.CreateTextFile(outputFile,True)
    outFile.Write outputText
    outFile.Close

    Set outFile = Nothing
    Set FSO = Nothing
    Set xmlDoc = Nothing
    Set xslDoc = Nothing
    Set xmlResults = Nothing
    End Function

  • 相关阅读:
    关于System.currentTimeMillis()
    jpa
    java登录密码效验
    Yum 命令语法
    yum 源的配置与使用
    通过yum安装mysql
    centos 验证mysql的安装
    rpm
    GIT 切换到远程分支
    spring mvc 官方下载
  • 原文地址:https://www.cnblogs.com/davicelee/p/2279102.html
Copyright © 2011-2022 走看看