Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transforming web.xml

 
Jeff Pierce
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to take an existing web.xml file and transform it directly only changing a single <init-param>/<param-value> in the process and I can't seem to find the best way.

For example, I want to transform the listing value from true to false.



To this:

 
Jeff Pierce
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should add I only want to change it for servlet "fred", not all the other servlets within the web.xml.
 
pranav pranav
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this , I am not sure
<xsl:for-each select="//servlet/init-param">
<xsl:variable name="initivalue">
<xsl:value-of select="param-name"/>
</xsl:variable>
<xsl:if test="$initivalue = 'listings'">
<xsl:variable name="paramvalue">
<xsl:value-of select="param-value"/>
</xsl:variable>
<xsl:if test="$paramvalue = 'true'">
<param-value>false</param-value>
</xsl:if>
</xsl:if>
</xsl:for-each>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic