|
[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
RE: Removing nodes but leaving the tree intact
- From: "Michael Kay" <mike@s...>
- To: "'Job van Ommen'" <jobvanommen@g...>,<xml-dev@l...>
- Date: Thu, 20 Nov 2008 12:11:05 -0000
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/
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.
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
 |
| Atom 0.3 |
 |
| |
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|