基于内部文本更新XML [英] update XML on basis of inner text

查看:75
本文介绍了基于内部文本更新XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- >

- < web-app xmlns =http://java.sun.com/xml/ns/javaeexmlns:xsi =http://www.w3.org/2001/ XMLSchema-instancexsi:schemalocation =http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsdversion =2.5 >

- <! - 此Spring网络应用程序的主配置文件

- >



- <! - SSO过滤开始

- >

- < filter>

< filter-name> CAS过滤器

< filter-class> com.csc.fsg.pcdSecurity .filter.CASFilter

- < init-param>

< param-name> edu.yale.its.tp.cas.client.filter.loginUrl

- <! - 登录网址

- >

< param-value> http://20.15.81.224:9080 / sso / login

- <! - 负载均衡登录的URL

- >



- <! - 辅助服务器支持 - 开始

- >

- < init-param>

< param-name> com.csc.fsg.pcidsecurity.filter.secServerParamName

< PARAM值>



- < init-param>

< param-name> com.csc.fsg.pcidsecurity.filter.loginUrl2

< param-value> http:// COMPNAME2:8080 / CONTEXTNAME2 / login



- <! - 辅助服务器支持 - 结束

- >

- <! - < init-param>

< param-name> xmltag

< param-value> user





- >

- < init-param>

< param-name> com.csc.fsg.pcidsecurity.logoutUrl

- <! - 退出网址

- >

< param-value> http://20.15.81.224:9080 / sso / logout



- < init-param>

< param-name> com.csc.fsg.pcidsecurity.inactivityTimeout

- <! - 非活动超时值(秒)

- >

< param-value> 7200













我必须更新20.15.81.224:9080值

值与用户输入的值但问题是这个每当我再次生成这个xml这个值变得不同像10.10.81.224:9081这是服务器的ip地址,其中部署的应用程序我无法在搜索标准中对此值进行硬编码,即使我无法搜索<< param-value>它除了url之外还可以有不同的值

pleae帮助用用户输入的值更新此值

-->
- <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
- <!-- The master configuration file for this Spring web application
-->

- <!-- SSO Filter Start
-->
- <filter>
<filter-name>CAS Filter
<filter-class>com.csc.fsg.pcdSecurity.filter.CASFilter
- <init-param>
<param-name>edu.yale.its.tp.cas.client.filter.loginUrl
- <!-- URL for login
-->
<param-value>http://20.15.81.224:9080/sso/login
- <!-- URL for load balancing login
-->

- <!-- Secondary Server Support - Start
-->
- <init-param>
<param-name>com.csc.fsg.pcidsecurity.filter.secServerParamName
<param-value>

- <init-param>
<param-name>com.csc.fsg.pcidsecurity.filter.loginUrl2
<param-value>http://COMPNAME2:8080/CONTEXTNAME2/login

- <!-- Secondary Server Support - End
-->
- <!-- <init-param>
<param-name>xmltag
<param-value>user


-->
- <init-param>
<param-name>com.csc.fsg.pcidsecurity.logoutUrl
- <!-- URL for logout
-->
<param-value>http://20.15.81.224:9080/sso/logout

- <init-param>
<param-name>com.csc.fsg.pcidsecurity.inactivityTimeout
- <!-- Inactivity timeout value in seconds
-->
<param-value>7200






I have to update 20.15.81.224:9080 value
value with user entered value but problem is this whenever i generate this xml again this value become different like 10.10.81.224:9081 this is the ip address of server where application deployed i cannot hardcode this value in search crirtia even i cannot search on <<param-value> it can have different value also other than url
pleae help to update this value with user enetered value

推荐答案

创建VB.net代码以下算法



- 需要手动执行一次

1)找到您拥有此XML的文件并复制您的服务器IP地址和添加这是文件描述



- 需要为此编写代码

2)阅读文件说明,这将是XML中的服务器IP地址

3)读取XML数据

4)读取用户提供的服务器IP地址

5)查找并将DESCRIPTION值替换为USER provided值。

6)在文件描述中写入USER提供的服务器IP地址

7)关闭文件连接





希望这有帮助

--RDBurmon
Create VB.net code for below algorithm

--Need to do Manually only one time
1) Locate that file where you have this XML and copy your server IP Address and add this is DESCRIPTION of file

--Need to write code for this
2) Read DESCRIPTION of file and that will be your server IP address which is there in XML
3) Read XML data
4) Read Server IP address provided by user
5) Find and replace "DESCRIPTION" value with "USER provided" value.
6) Write USER provided server ip address in DESCRIPTION of file
7) close file connection


Hope this helps
--RDBurmon


我无法通过示例

<获得解决方案可以更精彩BR />


这篇关于基于内部文本更新XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆