diazo icon indicating copy to clipboard operation
diazo copied to clipboard

Whitespace breaks xsl:attribute when Modifying theme on-the-fly

Open davilima6 opened this issue 8 years ago • 5 comments

This works:

  <replace css:theme-children="#portal-logo">
    <img alt="Site Logo" class="img-responsive"><xsl:attribute name="src"><xsl:value-of select="$site_logo" /></xsl:attribute></img>
  </replace>

This does not:

  <replace css:theme-children="#portal-logo">
    <img alt="Site Logo" class="img-responsive">
      <xsl:attribute name="src"><xsl:value-of select="$site_logo" /></xsl:attribute>
    </img>
  </replace>

Even this won't work (one single whitespace before xsl:attribute):

  <replace css:theme-children="#portal-logo">
    <img alt="Site Logo" class="img-responsive"> <xsl:attribute name="src"><xsl:value-of select="$site_logo" /></xsl:attribute></img>
  </replace>

Here's the error msg:

_runtime error, element 'attribute' [123:0] xsl:attribute: Cannot add attributes to an element if children have been already added to the element. [0:0]_

Using Plone 4.3.

/cc @ebrehault @davisagli @lrowe

davilima6 avatar Nov 12 '15 14:11 davilima6