Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - [xml-dev] Removing nodes but leaving the tree intact [Thread Next] RE: [xml-dev] Removing nodes but leaving the tree intactTo: "'Job van Ommen'" <jobvanommen@-----.--->, <xml-dev@-----.---.---> Date: 11/20/2008 12:12:00 PM The xsl-list at mulberrytech.com is the best place for getting XSLT coding help. This one is a standard "modified identity transform". Define one template rule that copies nodes: <xsl:template match="*"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> and another that copies their children: <xsl:template match="somecategory"> <xsl:apply-templates/> </xsl:template> Michael Kay http://www.saxonica.com/ _____ From: Job van Ommen [mailto:jobvanommen@g...] Sent: 20 November 2008 11:42 To: xml-dev@l... Subject: [xml-dev] Removing nodes but leaving the tree intact Hello Everyone, I have a automatically generated xml tree like this: <root> <someobject/> <someotherobject/> <somecategory> <somename> <somecategory> <someothername> <someobject/> <someotherobject/> </someothername> </somecategory> <someobject/> <someotherobject/> </some name> </some category> </root> I generate a lot of these files, always containing nested <somecategory> elements. Is there a clean way to use xsl to remove the <somecategory> elements and return the xml intact, just without the <somecategory> elements? Kind regards. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
