- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想通过命令行更新 xml 文件中的值。
我是 xmlstartlet 的新手,我尝试使用以下命令,但它不起作用
xml ed -u "/web-app/welcome-file-list/welcome-file" -v 'Login.jsp' web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Struts2 Application</display-name>
<error-page>
<error-code>404</error-code>
<location>/ErrorPage.jsp</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/ErrorPage.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/ErrorPage.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/ErrorPage.jsp</location>
</error-page>
<listener>
<listener-class>com.tcs.bancs.listener.SessionListener</listener-class>
</listener>
<!-- Commenting as per discussion -->
<!--
<filter>
<display-name>CompressionFilter</display-name>
<filter-name>CompressionFilter</filter-name>
<filter-class>com.tcs.bancs.web.filter.CompressionFilter</filter-class>
<init-param>
<param-name>excludeURI</param-name>
<param-value>documentDownloadIFADD,</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CompressionFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!-- WI Auth filter changes by Tuhin -->
<filter>
<display-name>WIAuthFilter</display-name>
<filter-name>WIAuthFilter</filter-name>
<filter-class>com.tcs.bancs.web.filter.WIAuthFilter</filter-class>
<init-param>
<param-name>userHeader</param-name>
<param-value>OAM_REMOTE_USER</param-value>
</init-param>
<init-param>
<param-name>excludeParam</param-name>
<param-value>filterCriteria,svgDataForPublishPlan,svgChart,hiddeninvstmntvalue,idHidden2,bankName,clientLabelData,monitoredJson,pageTitleLbl,hiddenVariable3,tableThruResponseMonitored,ToolTip,ReasonsDropBox,confirmSvgData,currencyCombo_Tooltip,cancelInsDescrip,bankingDetailTable_RowValue,editInsDescrip,OneOffEditLink_Title,riskLevelTable,svgDataForReportPlan,paginationData,tableThruResponseLive,tableApplicationPytMthdOne_RowValue,savingsTable_RowValue,lumpsumContributionTableOne_RowValue,paymentTable_RowValue,premiumTable_RowValue,confirmationOfChargesTable_RowValue,fundadviserTable1_RowValue,livesassuredTable_RowValue,lumpsumOriginofwealthTable_RowValue,collectiveSector,transactionData,onBackFlag,hiddenPagination
,filterEdit,filtersArrayVal,Filters,chkBoxArrayVal,warningTxtD,warningTxtR,filtersFromCurrent,AssetClassCombo,SectorCombo,RegularWithdrawalJSON,RWJosn,hiddenVariable6,tableThruAjax,documentName</param-value>
</init-param>
<init-param>
<param-name>loginURI</param-name>
<param-value>/login</param-value>
</init-param>
<init-param>
<param-name>realexURI</param-name>
<param-value>/RealexServlet.srl</param-value>
</init-param>
<init-param>
<param-name>logoutURI</param-name>
<param-value>/logout.action</param-value>
</init-param>
<!-- downloadURI
To download static content we should use below path, do not add any other url in this param
-->
<init-param>
<param-name>downloadURI</param-name>
<param-value>/_static_contents_/download</param-value>
</init-param>
<init-param>
<param-name>AuthMode</param-name>
<!-- Modes:
SnROnly - default, only SnR URL will be allowed,
SnRWithBypass- login bypass will be allowd (onsite test),
NoSnR - No SnR, filter will be disabled (Offshore Only)
-->
<!-- To use SnROnly/ SnRWithBypass we need to make sure
1: jaas config
BFS{
com.tcs.bfsarch.security.module.BFSSiteMinderLoginModule required debug=true;
};
2:MCSystem.prop
singleSignon=yes
3:DB script change
In security_parameter table entry singlesignon=3 for systemid 2(extranet)
-->
<param-value>SnRWithBypass</param-value>
</init-param>
<init-param>
<param-name>logfile</param-name>
<param-value>E:\BancsProduct\logs\wiauth.log;10M</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>WIAuthFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<display-name>StaticContentFilter</display-name>
<filter-name>StaticContentFilter</filter-name>
<filter-class>com.tcs.bancs.web.filter.StaticContentFilter</filter-class>
<!--
* Parameter Name: staticContextRoot -> the sub context root for static context in the formed virtual path
* Mandatory
* Fingerprint (MD5 hash of the file) will follow this sub context root
-->
<init-param>
<param-name>staticContextRoot</param-name>
<param-value>_static_contents_</param-value>
</init-param>
<!--
* Parameter Name: contentTypes -> the comma separate list content type considered for URI replacement in the response body
* Mandatory
-->
<init-param>
<param-name>contentTypes</param-name>
<param-value>text/html,text/css,application/javascript,text/plain</param-value>
</init-param>
<!--
* Parameter Name: CacheExpiryInSeconds -> no of seconds after which cache will expire in browser
* Optional
* Default Value = 31536000 (1 Year)
-->
<init-param>
<param-name>CacheExpiryInSeconds </param-name>
<param-value> 31536000 </param-value>
</init-param>
<!--
* Parameter Name: staticContentExtensions
* Optional
* Default Value = .css,.html,.htm,.pdf,.jpg,.jpeg,.png,.gif,.js
* Comma seperated list of extension for which the URI replacement will be done
-->
<init-param>
<param-name>staticContentExtensions</param-name>
<param-value>.css,.html,.htm,.pdf,.jpg,.jpeg,.pjpeg,.png,.gif,.js</param-value>
</init-param>
<!--
* Parameter Name: maxFileSizeToReplace -> Size in bytes or in KB (K) or MB (M)
* Optional
* Default Value = 512M
* This controls the static file replacement - if any static file is more than specified size,
* that will not be considered for URI replacement inside the file 9to avoid too much memory consumption)
<init-param>
<param-name>maxFileSizeToReplace</param-name>
<param-value>512M</param-value>
</init-param>
-->
<!--
* Parameter Name: ignoreURIs -> the comma separate list of URIs (exlusive of context root path), which will be ignored for URI replacement inside
* Optional
* Default Value = Blank list
* The URIs mentioned will be skipped URI replacements
<init-param>
<param-name>ignoreURIs</param-name>
<param-value>/path1,/path2</param-value>
</init-param>
-->
<init-param>
<param-name>ignoreURIs</param-name>
<param-value>/realexNvgtn</param-value>
</init-param>
<!--
* Parameter Name: listNonReplacableURIs -> the comma separate list of URIs (exlusive of context root path), which will not be replaced
* Optional
* Default Value = Blank list
* The URIs mentioned will be not be replaced if used in response as script, CSS or image inclusion
-->
<init-param>
<param-name>listNonReplacableURIs</param-name>
<param-value>/alfresco.srl</param-value>
</init-param>
<!--
* Parameter Name: logfile -> logfile name and size
* Format : <Logfile path>;Size -> logfile path could be a directory or full path including file name, size could be in bytes, KB (K) or MB (M)
* Ex : /usr/log/abc.log;10M
* Optional
* Default Value = if nothing specified, logging will be off. If size is not specified or invalidly specified default will be 5MB
* If file is specified and writable then log will be written in that path.
* If the path is directory the "staticfilter.log" file will be created under the path.
* Log will be rotated after the size reached the size mentioned (default 5MB)
-->
<init-param>
<param-name>logfile</param-name>
<param-value>E:\BancsProduct\staticfilter.log;10M</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>StaticContentFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- CSRF Vulnerability -->
<filter>
<filter-name>CSRFShield</filter-name>
<filter-class>com.tcs.bancs.csrfguard.CSRFShieldFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>WEB-INF/csrfguard.properties</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CSRFShield</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- CSRF Vulnerability -->
<!--<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>WMPInitServlet</servlet-name>
<servlet-class>com.tcs.wm.servlet.WMPInitServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>-->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>WMPInitServlet</servlet-name>
<servlet-class>com.tcs.wm.servlet.WMPInitServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<description>
</description>
<servlet-name>RealexServlet</servlet-name>
<servlet-class>
com.tcs.bancs.realexskandia.RealexServlet</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>RealexServlet</servlet-name>
<url-pattern>/RealexServlet.srl</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>alfresco</servlet-name>
<servlet-class>com.tcs.bancs.wcm.servlet.HttpProxyServlet</servlet-class>
<init-param>
<param-name>log</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>alfresco</servlet-name>
<url-pattern>/alfresco.srl/*</url-pattern>
</servlet-mapping>
<servlet>
<description>
</description>
<display-name>
AplStartup</display-name>
<servlet-name>AplStartup</servlet-name>
<servlet-class>
iims.workflow.util.AplStartup</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AplStartup</servlet-name>
<url-pattern>/AplStartup</url-pattern>
</servlet-mapping>
<servlet>
<description>
</description>
<display-name>
DMSStartup</display-name>
<servlet-name>DMSStartup</servlet-name>
<servlet-class>
dms.DMSStartup</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DMSStartup</servlet-name>
<url-pattern>/DMSStartup</url-pattern>
</servlet-mapping>
<servlet>
<description>
</description>
<display-name>
IIMSStartup</display-name>
<servlet-name>IIMSStartup</servlet-name>
<servlet-class>
iimsStartup.IIMSStartup</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>IIMSStartup</servlet-name>
<url-pattern>/IIMSStartup</url-pattern>
</servlet-mapping>
<servlet>
<description>
</description>
<display-name>
IIMSStartupNext</display-name>
<servlet-name>IIMSStartupNext</servlet-name>
<servlet-class>
iimsStartup.IIMSStartupNext</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>IIMSStartupNext</servlet-name>
<url-pattern>/IIMSStartupNext</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>TreeServlet</servlet-name>
<servlet-class>iimsStartup.TreeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TreeServlet</servlet-name>
<url-pattern>/TreeServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<mime-mapping>
<extension>doc</extension>
<mime-type>application/doc</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>csv</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>
<mime-mapping>
<extension>js</extension>
<mime-type>application/javascript</mime-type>
</mime-mapping>
<mime-mapping>
<extension>png</extension>
<mime-type>image/png</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>LoginSR.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>/tags/ebw-taglibs</taglib-uri>
<taglib-location>/WEB-INF/ebwtaglibs.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/CSRFGuard-taglibs</taglib-uri>
<taglib-location>/WEB-INF/CSRFGuard.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/c</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/wcm</taglib-uri>
<taglib-location>/WEB-INF/WCM.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
最佳答案
它不起作用,因为您的 XML 在默认命名空间 http://java.sun.com/xml/ns/javaee
中.
您需要将命名空间绑定(bind)到前缀并在 xpath 中使用它。
例子...
xml ed -N x="http://java.sun.com/xml/ns/javaee" -u "/x:web-app/x:welcome-file-list/x:welcome-file" -v 'Login.jsp' web.xml
关于xmlstarlet-更新特定节点上的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47775358/
如果在 xmlsarlet 部分提出了这个问题,我们深表歉意。我试图搜索它但找不到所以在这里发布。以便将来对我和其他新手也有帮助。 作为 xmlstarlet 的新手,我想学习它。那么XMLSTARL
使用此示例 XML: 如何插入元素 紧接在元素之后 使用 XMLStarlet? 最佳答案 xml ed -i(或--insert)将把它放在节点之前,xml ed -a(
如何从所有元素中提取“失败”并将它们相加? 3 a 00 105370
我有这个 xml 模式,我想要的是如何在 shell 脚本中使用 XMLStarlet 一一提取所有节点的值 Photo_Gallerie_1.jp
我想在 pom.xml 文件中找到对 SNAPSHOT 版本的引用。让我们使用位于 here 的 POM 文件举个例子。我想出了以下命令来查找包含字符串 SNAPSHOT 的元素: $ xmlstar
我想在 之后添加这个 block 00:00:05:00 1 2 00:00:01:00 下面是我的预期输出: Auto 0
这是 xml 片段: $ cat short.xml 期望的输出是: yahoo.com | ir1.fp.vip.sp2.yahoo.com Inc.
seg PASS1 PASS2" 我是 xmlstartlet 的新手。在上面的代码中,我试图将 star
我正在尝试自动将新的子节点添加到 nexus-core-feature-3.16.1-02.xml 因为我们正在使用一些插件来处理“盒子”解决方案不附带的工作。要点是,当新版本的 nexus-cont
我正在尝试使用 xmlstarlet 格式化 xml 文件,但我不想创建新的 xml 文件。 我试过了 xmlstarlet fo --inplace --indent-tab --omit-decl
我想使用 xmlstarlet 将第三方 xml 文件转换为 csv 文件。一些文件使用带有 xmlns 声明的默认 namespace ,其他文件使用没有 xmlns 声明的默认 namespace
我需要您在 XMLStarlet 命名空间方面的帮助。 (从未见过解释得不好的图书馆) 我有一个 XML 文件,如: My text Couverture 等等。 所以现在,由
以这个 xml 为例: Batch Editing Tool Apply Actions Modify Records Remove all Records Destroy al
我想知道如何使用 xmlstarlet 添加新行。 我的目标是添加一个 track_01在 job/input/file_input/uri. 之后 Auto 0 f
我正在处理一个处理 xml 文件的脚本。 我想用 xmlstarlet 更新这个 xml 文件中的属性值,但它不起作用。 这是 xml 文件的示例:
我想通过命令行更新 xml 文件中的值。 我是 xmlstartlet 的新手,我尝试使用以下命令,但它不起作用 xml ed -u "/web-app/welcome-file-list/welco
我正在使用命令: xmlstarlet ed --omit-decl --subnode "/boinc"--type elem -n app -v ""project_00.xml > projec
我正在使用命令: xmlstarlet ed --omit-decl --subnode "/boinc"--type elem -n app -v ""project_00.xml > projec
目前我有以下命令行,其中 $f 代表文件: xmlstarlet ed -d "//*/packageVersions" $f; 我也试过 xmlstarlet ed -d "//packageVer
我从未使用过 xmlstarlet,所以我只是想通过输入和所需的输出来保持简单,希望我能从发布的答案中学到一些东西。 输入: http://www.MYDOMAIN.com/
我是一名优秀的程序员,十分优秀!