PenroseCJ
PenroseCJ

Reputation: 15

Insert Image using XSL or XML

My POS uses an XSL File as a template for my Receipts, I would like to insert an image at the top of my receipts such as a logo. I've tried adding an Image but my an image doesn't Print/is displayed, What do I need to do?

Below is the code I have tried

Do I have to add any code to the XML file?

      <img>
  <xsl:attribute name="src">
      <xsl:value-of select="http://tpg-consultants.co.uk/Recipet/TPG-CON.png"/>
  </xsl:attribute>
      </img>

Upvotes: 0

Views: 1019

Answers (1)

michael.hor257k
michael.hor257k

Reputation: 117102

Instead of:

  <xsl:attribute name="src">
      <xsl:value-of select="http://tpg-consultants.co.uk/Recipet/TPG-CON.png"/>
  </xsl:attribute>

use:

<xsl:attribute name="src">http://tpg-consultants.co.uk/Recipet/TPG-CON.png</xsl:attribute>

Or just replace the entire img element with:

<img src="http://tpg-consultants.co.uk/Recipet/TPG-CON.png"/>

What you have now is trying to get the value from a node, using an invalid XPath expression.

Upvotes: 1

Related Questions