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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Scraping specific data within an XML document 19 69
Extract XML Data from using TSQL 5 78
what are list of ebay api errors 1 48
XML loaded in a form with dropdown 6 57
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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