aspose file tools*
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT to remove tag?" Watch "XSLT to remove tag?" New topic
Author

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
xs:simpleType.

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?
How?
Thanks!

[ 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 -->
</xsl:template>

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

- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Thanks Madhav

That really helps!

Gemini
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Nice shot Madhav.
 
 
subject: XSLT to remove tag?