hi all,
sorry i am posting on top of this mail
i have a problem
see one xml file look like
<my-app>
<name></name>
<!--<class></class>-->
</my-app>

i want to uncomment the commented part through xslt. please help me

thanks in advance

<!-- the identity template copies everything
(unless more specific templates apply) -->
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*" />
</xsl:copy>
</xsl:template>

<!-- this template matches comments and uncomments them -->
<xsl:template match="comment()">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:template>

hi all please help me i am very new in this
see i ahve one xml file ::

<my-app>
<filter>
<filter-name>myrunclass</filtername>
<filter-class>myFirstClass</filter-class>
</filter>
<filter>
<filter-name>myCompileclass</filtername>
<filter-class>mySecondClass</filter-class>
</filter>
<filter>
<filter-name>myclass</filtername>
<filter-class>myThirdClass</filter-class>
</filter>

<!--<filter-mapping>
<filter-name>myrunclass</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>-->

<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!--<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>-->
</my-app>

i need to uncomment the filter-mapping tag but based on some condition like inside <filter> if <filter-name> tag is match with commented <filter-mapping>/<filter-name> tag then we need to uncomment only those <filter-mapping> tag.

so OUTPUT become like


<my-app>
<filter>
<filter-name>myrunclass</filtername>
<filter-class>myFirstClass</filter-class>
</filter>
<filter>
<filter-name>myCompileclass</filtername>
<filter-class>mySecondClass</filter-class>
</filter>
<filter>
<filter-name>myclass</filtername>
<filter-class>myThirdClass</filter-class>
</filter>

<filter-mapping>
<filter-name>myrunclass</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!--<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>-->
</my-app>

please help me

thanks in advance

hi all please help me i am very new in this
see i ahve one xml file ::

<my-app>
<filter>
<filter-name>myrunclass</filtername>
<filter-class>myFirstClass</filter-class>
</filter>
<filter>
<filter-name>myCompileclass</filtername>
<filter-class>mySecondClass</filter-class>
</filter>
<filter>
<filter-name>myclass</filtername>
<filter-class>myThirdClass</filter-class>
</filter>

<!--<filter-mapping>
<filter-name>myrunclass</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>-->

<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!--<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>-->
</my-app>

i need to uncomment the filter-mapping tag but based on some condition like inside <filter> if <filter-name> tag is match with commented <filter-mapping>/<filter-name> tag then we need to uncomment only those <filter-mapping> tag.

so OUTPUT become like


<my-app>
<filter>
<filter-name>myrunclass</filtername>
<filter-class>myFirstClass</filter-class>
</filter>
<filter>
<filter-name>myCompileclass</filtername>
<filter-class>mySecondClass</filter-class>
</filter>
<filter>
<filter-name>myclass</filtername>
<filter-class>myThirdClass</filter-class>
</filter>

<filter-mapping>
<filter-name>myrunclass</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!--<filter-mapping>
<filter-name>ResponseEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>-->
</my-app>

please help me

thanks in advance

i got the answer thanks a lot of you people help and thanks to Mr. Martin Honnen who gave me the solution

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.