0

Hello All,

I've always found good answers here. Thanks in advance for any help.

I've looked around and haven't found a good answer to work with. Maybe I'm using the wrong keywords. If someone can provide the answer, that'd be great.

I have an xml document:

<root>
<product>
<image>bike.jpg</image>
</product>
</root>

The xsl file:

<xsl:stylesheet>
<xsl:template match="/">
<html>
<body>

<xsl:for-each select="root/product"
<table><tr>
<td>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image"/>
</xsl:attribute>
</xsl:element>
</td>
</tr><table>
</xsl:for-each>

</body>
</html>
</xsl:template>
</xsl:stylesheet>

Let's say bike.jpg is stored at /upload/product/new/ and the xml and xsl file are stored at /content/

My understanding is that the above xsl will render the xml into html as:

<img src="bike.jpg">

What do I use and where do I put the code so that when it renders, it becomes:

<img src="/upload/product/new/bike.jpg">

One solution to this issue is that I can just enter the full path into the <image> tag of the xml. I want to avoid this if possible.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by hielo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.