当前位置:网站首页>XSLT – 编辑 XML概述
XSLT – 编辑 XML概述
2022-08-03 23:34:00 【nginx】
<%function loadFile(xmlfile,xslfile)Dim xmlDoc,xslDoc'Load XML fileset xmlDoc = Server.CreateObject("Microsoft.XMLDOM")xmlDoc.async = falsexmlDoc.load(xmlfile)'Load XSL fileset xslDoc = Server.CreateObject("Microsoft.XMLDOM")xslDoc.async = falsexslDoc.load(xslfile)'Transform fileResponse.Write(xmlDoc.transformNode(xslDoc))end functionfunction updateFile(xmlfile)Dim xmlDoc,rootEl,fDim i'Load XML fileset xmlDoc = Server.CreateObject("Microsoft.XMLDOM")xmlDoc.async = falsexmlDoc.load(xmlfile)'Set the rootEl variable equal to the root elementSet rootEl = xmlDoc.documentElement'Loop through the form collectionfor i = 1 To Request.Form.Count'Eliminate button elements in the formif instr(1,Request.Form.Key(i),"btn_")=0 then'The selectSingleNode method queries the XML file for a single node'that matches a query. This query requests the value element that is'the child of a field element that has an id attribute which matches'the current key value in the Form Collection. When there is a match -'set the text property equal to the value of the current field in the'Form Collection.set f = rootEl.selectSingleNode("field[@id='" & _Request.Form.Key(i) & "']/value")f.Text = Request.Form(i)end ifnext'Save the modified XML filexmlDoc.save xmlfile'Release all object referencesset xmlDoc=nothingset rootEl=nothingset f=nothing'Load the modified XML file with a style sheet that'allows the client to see the edited informationloadFile xmlfile,server.MapPath("tool_updated.xsl")end function'If the form has been submitted update the'XML file and display result - if not,'transform the XML file for editingif Request.Form("btn_sub")="" thenloadFile server.MapPath("tool.xml"),server.MapPath("tool.xsl")elseupdateFile server.MapPath("tool.xml")end if%>
边栏推荐
猜你喜欢

软件测试内卷严重,如何提升自己的竞争力呢?

ML之yellowbrick:基于titanic泰坦尼克是否获救二分类预测数据集利用yellowbrick对LoR逻辑回归模型实现可解释性(阈值图)案例

直播系统聊天技术(八):vivo直播系统中IM消息模块的架构实践

The super perfect layout has shortcut keys and background replacement

Creo 9.0二维草图的诊断:重叠几何

"Digital Economy Panorama White Paper" Financial Digital User Chapter released!

逆波兰表达式求值

FinClip,助长智能电视更多想象空间

Three.js入门详解

override learning (parent and child)
随机推荐
complete binary tree problem
【论文阅读】TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
[2022强网杯] polydiv和gamemaster
用栈实现队列
FinClip,助长智能电视更多想象空间
2022/8/3 考试总结
In V8 how arrays (with source code, picture and text easier to understand)
Kotlin - 扩展函数和运算符重载
Creo 9.0二维草图的诊断:着色封闭环
Zilliz 2023 Fall Campus Recruitment Officially Launched!
射频芯片(RFIC)的协议之5G及其调制
utlis thread pool
Super perfect version of the layout have shortcut, background replacement (solve the problem of opencv Chinese path)
rsync basic usage
BMN: Boundary-Matching Network for Temporal Action Proposal Generation Reading Notes
用两个栈模拟队列
rosbridge-WSL2 && carla-win11
Scala基础【正则表达式、框架式开发原则】
超级完美版布局有快捷键,有背景置换
The super perfect layout has shortcut keys and background replacement