This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XSLT to remove tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT to remove tag?" Watch "XSLT to remove tag?" New topic

XSLT to remove tag?

Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Portion of my xsd file --

I want to get rid of all the tags including it's innner tag/ contents for

The document has very complicated structure.
All I want to have in converted document is everything else as is except <xs:simpleType> tag.

Can I do this using xslt?

[ May 06, 2005: Message edited by: Gemini Moses ]

Edit commetn:
Disabled smiles in this post. Added [ code ] tags without the spaces.

- m
[ May 07, 2005: Message edited by: Madhav Lakkapragada ]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
You will have to use a template with xsl:copy constructas a generic template for all the elements. Then for the xs:simpleType element, you should write an empty template.

<xsl:template match="xs:simpleType">
<!-- do nothing here -->

This would consume all the simple Type element (and its content).

- m

Take a Minute, Donate an Hour, Change a Life
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Thanks Madhav

That really helps!

Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
Nice shot Madhav.
I agree. Here's the link:
subject: XSLT to remove tag?
It's not a secret anymore!