0
<xsl:for-each select="/date/logs">

        <rect>

        <xsl:attribute name="fill">
        red
        </xsl:attribute>

......... This is a portion of my XSL transformation document. When I process it, the red comes out as just

&#10;&#9;&#9;red&#10;&#9;&#9;

Do I need a value-of select and a variable. I'm not that knowledgeable so sorry for my poor explanation.

Could Someone Help me Please, Thanks very much in advance.

Maurice Tempelsman
  • 895
  • 2
  • 11
  • 13

2 Answers2

0

I've now realised the problem was that I had line breaks/spaces. Solved now.

Maurice Tempelsman
  • 895
  • 2
  • 11
  • 13
0

You can use literal result elements including attribute values e.g.

<xsl:for-each select="/date/logs">
  <rect fill="red"/>
</xsl:for-each>

If you want or need to populate an attribute value based on a value in your input doc use an attribute value template e.g.

<xsl:for-each select="/date/logs">
  <rect fill="{@color}"/>
</xsl:for-each>
Martin Honnen
  • 160,499
  • 6
  • 90
  • 110