Kees Hink wrote:
> 
> On 10/20/2010 01:59 PM, Laurence Rowe wrote:
>> 
>> 
>> Kees Hink wrote:
>>>
>>> Just tested it with an almost empty setup, and that worked.
>>>
>>> (I did this:
>>> * From
>>> https://codespeak.net/svn/z3/xdv/trunk/lib/xdv/tests/inline-xsl-example-modify-text/,
>>> i copied the rules.xml as rules-test.xml,
>>> * added <theme href="theme-test.html" />
>>> * copied theme.html as theme-test.html,
>>> * added an alternate theme in collective.xdv setup: use rules-test.xml
>>> for
>>> content item called "test",
>>> * i was able to append text to p's, span's etcetera.)
>>>
>>> Probably my rules.xml does something stupid, but i can't figure out what
>>> it is.
>>>
>>> Is there a way to debug?
>>>
>>> (Perhaps it is helpful if i post my rules file:
>>> http://pastie.org/1235085.)
>>>
>> 
>> Your rules use <xsl:copy-of select="." />. This means the content is
>> copied
>> directly without being exposed to other templates. Try switching it for
>> <xsl:apply-templates select="." />
> 
> Thanks! That worked, i can now append stuff to all subheadings.
> 
> 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/

Laurence
-- 
View this message in context: 
http://plone.293351.n2.nabble.com/complex-XSLT-in-collective-xdv-search-and-replace-in-HTML-tp5646426p5663084.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

Reply via email to