display an image with fixed width and length

Posted on 2001-06-12
Last Modified: 2006-11-17
I know how to display an image now, but I don't know how to set its width and length. Can you show me how to write?

[xml document]
<?xml version='1.0'?>
<?xml-stylesheet type='text/xsl' href='viewdata.xsl'?>
       <name>Black Headlight</name>
       <name>Red Headlight</name>

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="">
<xsl:template match="/">
      <title>Test XSL sheet</title>
      <xsl:for-each select="/CATEGORY/Product">
        <xsl:value-of select="name"/><br/>
        <xsl:value-of select="price"/><br/>
        <img><xsl:attribute name='src'><xsl:value-of select="image"/></xsl:attribute></img>

Question by:yeelan
  • 2
  • 2

Accepted Solution

gsatsan earned 100 total points
ID: 6184460
Use this:
<xsl:attribute name='src'>
  <xsl:value-of select="image"/>
<xsl:attribute name='height'>100</xsl:attribute>
<xsl:attribute name='width'>200</xsl:attribute>

Author Comment

ID: 6188392
why <img> don't need to write like this?

<xsl:element name="img">  ?

Expert Comment

ID: 6189537
you can yeelan..but it is redundant

Author Comment

ID: 6190540
Thank you very much, gsatsan

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DOCTYPE in pubmed 5 57
VB.Net and XML XSD Files 1 53
parse convert xml feed to text (python) 2 70
Create html table using xsl 8 28
Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now