当前位置:网站首页>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
%>
边栏推荐
- Code Casual Recording Notes_Dynamic Programming_416 Segmentation and Subsetting
- Analysys Analysis: The transaction scale of China's online retail B2C market in Q2 2022 will reach 2,344.47 billion yuan
- BMN: Boundary-Matching Network for Temporal Action Proposal Generation阅读笔记
- 代码随想录笔记_动态规划_416分割等和子集
- 图论-虚拟节点分层建图
- HCIP BGP lab report
- Why Flutter Flutter of tutorials is the best choice for business?
- 雅思大作文写作模版
- 【MySQL —— 索引】
- 创建函数报错,提示DECLARE定义语法问题
猜你喜欢
全球首款量产,获定点最多!这家AVP Tier1如何实现领跑?
冰河又一MySQL力作出版(文末送书)!!
A simple understanding of TCP, learn how to shake hands, wave hands and various states
Fluorescein-PEG-CLS,胆固醇-聚乙二醇-荧光素科研试剂
689. 三个无重叠子数组的最大和
Jmeter-断言
Shell编程之循环语句与函数
牛客2022 暑期多校3 H Hacker(SAM + 线段树查询区间内部最大子段和)
七夕活动浪漫上线,别让网络拖慢和小姐姐的开黑时间
Quickly build a website with static files
随机推荐
BMN: Boundary-Matching Network for Temporal Action Proposal Generation Reading Notes
CAS: 178744-28-0, mPEG-DSPE, DSPE-mPEG, methoxy-polyethylene glycol-phosphatidylethanolamine supply
Software testing is seriously involution, how to improve your competitiveness?
The longest substring that cannot have repeating characters in a leetcode/substring
3D Semantic Segmentation - 2DPASS
IELTS essay writing template
走迷宫 BFS
密码学基础以及完整加密通讯过程解析
rosbridge-WSL2 && carla-win11
创建函数报错,提示DECLARE定义语法问题
【并发编程】ReentrantLock的lockInterruptibly()方法源码分析
牛客2022 暑期多校3 H Hacker(SAM + 线段树查询区间内部最大子段和)
Another MySQL masterpiece published by Glacier (send the book at the end of the article)!!
初始 List 接口
射频芯片(RFIC)的协议之5G及其调制
【MySQL —— 索引】
Deep integration of OPC UA and IEC61499 (1)
The principle and use of AOSP CameraLatencyHistogram
单例模式使用饿汉式和懒汉式创建一定安全?很多人不知
超级完美版布局有快捷键,有背景置换(解决opencv 中文路径问题)