Reputation: 2270
This is my xml file:
<xml>
<figure>abstract.png</figure>
</xml>
This is my xslt code:
<xsl:template match="figure">
<img src="{.}" alt=""/>
<xsl:value-of select="."/>
</xsl:template>
But it gives this:
<img src="abstract.png" alt=""/>abstract.png
instead of just:
<img src="abstract.png" alt=""/>
How to remove the last abstract.png?
Upvotes: 0
Views: 43
Reputation: 117102
The trailing string abstract.png
is produced by your instruction:
<xsl:value-of select="."/>
If you remove it, you will get the expected result:
https://xsltfiddle.liberty-development.net/aiyndL
Upvotes: 1