当前位置:网站首页>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%>
边栏推荐
- curl使用指南
- 走迷宫 BFS
- 【深度学习】基于tensorflow的服装图像分类训练(数据集:Fashion-MNIST)
- Internship: Upload method for writing excel sheet (import)
- Unity2021发布WebGL雾效消失问题
- Unity2021 releases WebGL fog effect disappearing problem
- Testng listener
- SRE运维解密-什么是SRE:DevOps模型的具体实践!
- 3D Semantic Segmentation - 2DPASS
- JS get parameter value of URL hyperlink
猜你喜欢

Unity 截取3D图像 与 画中画PIP的实现

牛客2022 暑期多校3 H Hacker(SAM + 线段树查询区间内部最大子段和)

Fluorescein-PEG-CLS,胆固醇-聚乙二醇-荧光素科研试剂

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

A simple understanding of TCP, learn how to shake hands, wave hands and various states

Another MySQL masterpiece published by Glacier (send the book at the end of the article)!!

【OpenCV图像处理】 图像拼接技术

简单了解下 TCP,学习握手和挥手以及各种状态到底是怎么样的

Why Flutter Flutter of tutorials is the best choice for business?

The super perfect layout has shortcut keys and background replacement
随机推荐
HNUCM 您好中国
The principle and use of AOSP CameraLatencyHistogram
The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
Zilliz 2023 Fall Campus Recruitment Officially Launched!
密码学基础以及完整加密通讯过程解析
【并发编程】ReentrantLock的lockInterruptibly()方法源码分析
libnet
SPOJ 2774 Longest Common Substring(两串求公共子串 SAM)
Pytest learn-setup/teardown
JS获得URL超链接的参数值
学习笔记 | uiautomation(如何)实现自动化
汉字风格迁移---结合本地和全局特征学习的中文字体迁移
Jmeter-断言
3D 语义分割——2DPASS
设置工作模式与环境(下):探查和收集信息
全球首款量产,获定点最多!这家AVP Tier1如何实现领跑?
What is the difference between the generator version and the viewer version?
OpenCV 图像拼接
响应式织梦模板除尘器类网站
七夕?new一个对象