XSLT - delete element[s] but keep contents
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Wed Dec 08, 2010 2:00 pm
XSLT - delete element[s] but keep contents
I'm trying to learn XSLT.
I have a lot of XML docs and need to delete an XML element, wherever it occurs within the node tree.
The element has optional attributes and an optional child - I need to delete the parent, its attributes, the optional child (where it occurs) but leave the element contents in tact.
E.g.
<para>
Text text <movie alttitle="The Terror" year="2010"><title>Really Scared</title>, distributed by Hopeless Pictures</movie> text text
</para>
How would I use XSLT to find and remove all <movie/> elements, inc all <title> elements to leave:
<para>
Text text Really Scared, distributed by Hopeless Pictures text text
</para>
?
I have a lot of XML docs and need to delete an XML element, wherever it occurs within the node tree.
The element has optional attributes and an optional child - I need to delete the parent, its attributes, the optional child (where it occurs) but leave the element contents in tact.
E.g.
<para>
Text text <movie alttitle="The Terror" year="2010"><title>Really Scared</title>, distributed by Hopeless Pictures</movie> text text
</para>
How would I use XSLT to find and remove all <movie/> elements, inc all <title> elements to leave:
<para>
Text text Really Scared, distributed by Hopeless Pictures text text
</para>
?
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service