adding and remove element in text node
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Fri Sep 14, 2018 8:38 am
adding and remove element in text node
Post by kumarkumar »
Hi All,
I am new to XSLT and struggling to get my expected output. Here what am expecting:
Input 1:
<s>xxxx <d>dddd</d> zzzz</s>
Output for 1:
<p><t>xxxx dddd zzzz</t></p>
Input 2
<s>xxxx <f>dddd</f> zzzz</s>
Output for 2:
<p><t>xxxx </t><t>dddd</t><t> zzzz</t></p>
Could you anybody please help with me?
Thanks,
Kumar
I am new to XSLT and struggling to get my expected output. Here what am expecting:
Input 1:
<s>xxxx <d>dddd</d> zzzz</s>
Output for 1:
<p><t>xxxx dddd zzzz</t></p>
Input 2
<s>xxxx <f>dddd</f> zzzz</s>
Output for 2:
<p><t>xxxx </t><t>dddd</t><t> zzzz</t></p>
Could you anybody please help with me?
Thanks,
Kumar
-
- Posts: 102
- Joined: Tue Aug 19, 2014 12:04 pm
Re: adding and remove element in text node
Post by Martin Honnen »
So what are the exact rules for the transformation, even if you can't express them as XSLT?
For the first sample you simply want to map the "s" element to a "p" and then wrap all the contents of the "s" element additionally into a "t" element which can be easily done with
then you simply need to add
For the second example I am not sure what are the rules and how it relates to the first.
For the first sample you simply want to map the "s" element to a "p" and then wrap all the contents of the "s" element additionally into a "t" element which can be easily done with
Code: Select all
<xsl:template match="s">
<p>
<t>
<xsl:apply-templates/>
</t>
</p>
</xsl:template>
Code: Select all
<xsl:template match="s/d">
<xsl:apply-templates/>
</xsl:template>
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