Boopathy S
asked on
I want to reassemble the element using XSLT
Hi, My Input file is:
<p><b><img src="https://admin.com"/>abc</b> efgh</p>
XSL I tried as:
<xsl:template match="p[b[img]]">
<xsl:value-of select="img"/>
<xsl:apply-templates/>
</xsl:template>
Expected Output be like:
<img src="https://admin.com"/>
<p><b>abc</b> efgh</p>
Please provide me the suggestion XSL code. Thanks in advance.
<p><b><img src="https://admin.com"/>abc</b> efgh</p>
XSL I tried as:
<xsl:template match="p[b[img]]">
<xsl:value-of select="img"/>
<xsl:apply-templates/>
</xsl:template>
Expected Output be like:
<img src="https://admin.com"/>
<p><b>abc</b> efgh</p>
Please provide me the suggestion XSL code. Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
xsl:copy-of would return the whole lot
also note that you have a context issue, img is NOT a child of p but a child of b
Open in new window