Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


display an image with fixed width and length

Posted on 2001-06-12
Medium Priority
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 400 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

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

688 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