I would like to change the content of a xml node. This is my source:
<content>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
<a href="http://www.example.com">
<strong>http://www.example.com</strong>
</a>
At vero eos et accusam et justo duo dolores et ea rebum.
</p>
</content>
I would like to change the part inside the -Tag to the following result:
<content>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
<a xlink:show="new" xlink:href="http://www.example.com" xlink:type="simple">
<strong>http://www.example.com</strong>
</a>
At vero eos et accusam et justo duo dolores et ea rebum.
</p>
</content>
So, basically I want to change "href" to xlik:href. Everything else should stay untouched, like the
-tag or the -Tag.
I was hoping I can do something like this:
<xsl:for-each select=".../content">
....
....
<xsl:variable name="content">
<xsl:copy-of select="content/node()" />
</xsl:variable>
<xsl:value-of select="replace($content, 'href', 'xlink:href')" />
....
....
<xsl:for-each/>
But the result is, that all tags and attributes where gone:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
http://www.example.com At vero eos et accusam et justo duo dolores et ea >rebum.
What can I do to change only the href-Attribute?