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
adding and remove element in text node
-
- Posts: 44
Re: adding and remove element in text node
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>
then you simply need to add
Code: Select all
<xsl:template match="s/d">
<xsl:apply-templates/>
</xsl:template>
For the second example I am not sure what are the rules and how it relates to the first.
Who is online
Users browsing this forum: No registered users and 0 guests