Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying images with xml

Status
Not open for further replies.

drderogatory

Technical User
Feb 17, 2005
2
CA
i'm a complete noob to xml, and am wondering how i'd display an image beside some specs with xml. here's what i'm trying to work with, am i at least on the right track?

<stocklist>
<box>
<hr>800021</hr>
<die>3000</die>
<length>6</length>
<width>4</width>
<depth>2</depth>
<img src="box.jpg" />
</box>
</stocklist>

this will idealy be displayed within a table beside the specs, go easy on me and thanks in advance
 

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:template match="/">
  <html>
  <body>
    <table>
      <tbody>
        <xsl:for-each select="stocklist/box">
          <tr>
            <td>
              <xsl:copy-of select="img">
            </td>
          </tr>
        </xsl:for-each>
      </tbody>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

Would be an example of something you could do.

Jon
 
Jon, you rock, although i found it worked better with </xsl:copy-of> ;)
perfect example, thanks much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top