0

Hi All,

I have a xml something like this

<addres>
<country>xxxx</country>
<city>xxxx</city>
<name>xxxxxxxx</name>
<street>xxxxxxx</street>
<!-- like this n number of element can come -->
</addres>

Out of those all tag any of tag e.g. <name> I don't want to produce in out put xml for exp. output should be like below:

<addres>
<country>xxxx</country>
<city>xxxx</city>
<street>xxxxxxx</street>
<!-- like this n number of element can come -->
</addres>

known way is to apply of templates except <name> element e.g. below

<xsl:template match="address">
  <xsl:apply-templates select="country"/>
  <xsl:apply-templates select="city"/>
  <!-- let's not apply template for name-->
  <xsl:apply-templates select="street"/>
  <!-- like this n number of tag can come-->
</xsl:template>

but the issue there n number of tag can come which it is difficult to apply-template one by one for all so my question is there any way to exclude that particular tag to be in output xml.

Thanks in advance
Manmohan

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by mrame
0

If you want to exclude an element use an empty template match like <xsl:template match="name"/>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.