当前位置:网站首页>XSLT – 编辑 XML概述
XSLT – 编辑 XML概述
2022-08-03 23:34:00 【nginx】
<%function loadFile(xmlfile,xslfile)
Dim xmlDoc,xslDoc
'Load XML file
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async = false
xmlDoc.load(xmlfile)
'Load XSL file
set xslDoc = Server.CreateObject("Microsoft.XMLDOM")
xslDoc.async = false
xslDoc.load(xslfile)
'Transform file
Response.Write(xmlDoc.transformNode(xslDoc))
end function
function updateFile(xmlfile)
Dim xmlDoc,rootEl,f
Dim i
'Load XML file
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async = false
xmlDoc.load(xmlfile)
'Set the rootEl variable equal to the root element
Set rootEl = xmlDoc.documentElement
'Loop through the form collection
for i = 1 To Request.Form.Count
'Eliminate button elements in the form
if 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 if
next
'Save the modified XML file
xmlDoc.save xmlfile
'Release all object references
set xmlDoc=nothing
set rootEl=nothing
set f=nothing
'Load the modified XML file with a style sheet that
'allows the client to see the edited information
loadFile 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 editing
if Request.Form("btn_sub")="" then
loadFile server.MapPath("tool.xml"),server.MapPath("tool.xsl")
else
updateFile server.MapPath("tool.xml")
end if
%>
边栏推荐
- A simple understanding of TCP, learn how to shake hands, wave hands and various states
- HCIP BGP lab report
- The salary of soft testers at each stage, come to Kangkang, how much can you get?
- Live Preview | Build Business Intelligence, Quickly Embrace Financial Digital Transformation
- Scala basics [regular expressions, framework development principles]
- 走迷宫 BFS
- 禾匠编译错误记录
- 完全二叉树问题
- 【并发编程】ReentrantLock的lockInterruptibly()方法源码分析
- 响应式织梦模板塑身瑜伽类网站
猜你喜欢
CAS: 178744-28-0, mPEG-DSPE, DSPE-mPEG, methoxy-polyethylene glycol-phosphatidylethanolamine supply
jav一键生成数据库文档
Unity 截取3D图像 与 画中画PIP的实现
全球首款量产,获定点最多!这家AVP Tier1如何实现领跑?
[Paper Reading] TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
Walk the Maze BFS
Software testing is seriously involution, how to improve your competitiveness?
智能座舱的「交互设计」大战
Republish the lab report
Analysys Analysis: The transaction scale of China's online retail B2C market in Q2 2022 will reach 2,344.47 billion yuan
随机推荐
JS get parameter value of URL hyperlink
【OpenCV图像处理】 图像拼接技术
JS获得URL超链接的参数值
冰河又一MySQL力作出版(文末送书)!!
【MySQL —— 索引】
RSS订阅微信公众号初探-feed43
初始 List 接口
AOSP CameraLatencyHistogram的原理与使用
Kotlin - 扩展函数和运算符重载
Storage engine written by golang, based on b+ tree, mmap
创建函数报错,提示DECLARE定义语法问题
BMN: Boundary-Matching Network for Temporal Action Proposal Generation阅读笔记
CAS: 178744-28-0, mPEG-DSPE, DSPE-mPEG, methoxy-polyethylene glycol-phosphatidylethanolamine supply
ML's yellowbrick: A case of interpretability (threshold map) for LoR logistic regression model using yellowbrick based on whether Titanic was rescued or not based on the two-class prediction dataset
HNUCM 2022年暑假ACM搜索专项练习
Live Preview | Build Business Intelligence, Quickly Embrace Financial Digital Transformation
[RYU] rest_router.py source code analysis
The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
Another MySQL masterpiece published by Glacier (send the book at the end of the article)!!
MCS-51单片机,定时1分钟,汇编程序