当前位置:网站首页>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%>
边栏推荐
- complete binary tree problem
- 软测人每个阶段的薪资待遇,快来康康你能拿多少?
- BMN: Boundary-Matching Network for Temporal Action Proposal Generation Reading Notes
- internship:编写excel表的上传方法(导入)
- redis持久化方式
- 逆波兰表达式求值
- rsync basic usage
- 双目IMU标定kalibr
- Live Preview | Build Business Intelligence, Quickly Embrace Financial Digital Transformation
- ML之yellowbrick:基于titanic泰坦尼克是否获救二分类预测数据集利用yellowbrick对LoR逻辑回归模型实现可解释性(阈值图)案例
猜你喜欢

单例模式使用饿汉式和懒汉式创建一定安全?很多人不知

- the skip/skipif Pytest learning

Live Preview | Build Business Intelligence, Quickly Embrace Financial Digital Transformation

Pytest learn-setup/teardown

rosbridge-WSL2 && carla-win11

RSS订阅微信公众号初探-feed43

电子邮件安全或面临新威胁!

Creo 9.0二维草图的诊断:加亮开放端点

Shell 用法梳理总结

Click the icon in Canvas App to generate PDF and save it to Dataverse
随机推荐
Pytest学习-setup/teardown
OpenCV 图像拼接
FinClip,助长智能电视更多想象空间
响应式织梦模板塑身瑜伽类网站
RSS订阅微信公众号初探-feed43
complete binary tree problem
[2022安恒夏令营] 5个小题
【OpenCV图像处理】 图像拼接技术
Republish the lab report
射频芯片ATE测试从入门到放弃之参数测试
创建函数报错,提示DECLARE定义语法问题
简单了解下 TCP,学习握手和挥手以及各种状态到底是怎么样的
超级完美版布局有快捷键,有背景置换
Prometheus监控Harbor(二进制版)
The longest substring that cannot have repeating characters in a leetcode/substring
P1996 约瑟夫问题
Deep integration of OPC UA and IEC61499 (1)
"Digital Economy Panorama White Paper" Financial Digital User Chapter released!
Interpretation of ML: A case of global interpretation/local interpretation of EBC model interpretability based on titanic titanic rescued binary prediction data set using interpret
Walk the Maze BFS