Laurence Rowe wrote:
>
>
> Kees Hink wrote:
>>
>> I'm now trying to change the img src attribute:
>>
>> <xsl:template
>> match="i...@class='collage-image']">
>> <xsl:copy/>_thumb
>> </xsl:template>
>>
>> and getting this error:
>>
>> XSLTApplyError: Attribute nodes must be added before any child nodes to
>> an element.
>>
>> I've solved it by doing this:
>>
>> <xsl:template
>> match="i...@class='collage-image']">
>>
>> <xsl:attribute name="src">
>> <xsl:value-of select="./@src" />_thumb
>> </xsl:attribute>
>> </img>
>> </xsl:template>
>>
>
> It's probably better to match the attribute directly. See the example I
> posted earlier at
> https://codespeak.net/svn/z3/xdv/trunk/lib/xdv/tests/inline-xsl-example-modify-attribute/
>
To be clear, I mean:
<xsl:template match="i...@class='collage-image']/@src">
<xsl:attribute name="src"><xsl:value-of select="."
/>_thumb</xsl:attribute>
</xsl:template>
Laurence
--
View this message in context:
http://plone.293351.n2.nabble.com/complex-XSLT-in-collective-xdv-search-and-replace-in-HTML-tp5646426p5663251.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers