Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Generating an IMG tag

From: amahmood5@-----.--.--
To: NULL
Date: 9/1/2005 3:01:00 PM
Hi all,

I've got an XML data file, with a <percent> element from 0 to 100.  I'd
like the XSL file to translate this into an <img> tag. I'll explain...

I'd like this <percent> value to be presented graphically.  I have a
library of 100 graphics files, called 0.png to 100.png.  I'd like the
XSL to translate the <percent> element into part of the graphic file
name, ie

<img src="images/<percent>.png">

So for <percent>10</percent>, the XSL should generate

<img src="images/10.png">

Struggling to do this.  Tried the concat XPath function, didn't work.
Tried the xsl:text tag, still no joy. I have to use the &gt; and &lt;
tags to prevent creating badly formed XML. I ended up generating a
perfectly good <img> tag, but as regular text, not a tag :-(

I'm certain it's possible, just can't work out how.  Anyone have any
ideas?  As a last resort, I can use xsl:choose with 100 when clauses,
but this isn't exactly efficient!

Kind regards,

Anwar



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent