aspose file tools*
The moose likes XML and Related Technologies and the fly likes Transforming web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Transforming web.xml" Watch "Transforming web.xml" New topic
Author

Transforming web.xml

Jeff Pierce
Greenhorn

Joined: Jan 04, 2002
Posts: 13
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

Joined: Jan 04, 2002
Posts: 13
I should add I only want to change it for servlet "fred", not all the other servlets within the web.xml.
pranav pranav
Greenhorn

Joined: Mar 28, 2005
Posts: 9
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>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Transforming web.xml