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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images in XML with CSS

Status
Not open for further replies.

b4x0r

Technical User
May 13, 2004
5
US
I am inquiring about how to display an image with css and xml ... I've been searching all over, google, this forum, faq's ... no one seems to have the answer.

I haven't quite gotten to xslt yet so help on this topic would be greatly appreciated.
 
XML has a tough time with binary data -- you usually end up storing it as base-64 encoded, and having that display (via a CSS or any other web technology) is difficult (you have to go through real code to do it).

There are two ways to do this:
1) Don't store the image in the XML, store the path to the image.

2) Store the image as base-64 encoded data in the XML, then write code to convert it back into a binary format, and append it to the HTML stream with the correct MIME encoding.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Here's what I found out eventually after a lot of searching,

Code:
<html:img xmlns:html="[URL unfurl="true"]http://www.w3.org/TR/REC-html40"[/URL]
          src="brickhead.jpg" width="150" height="150"/>

As far as option (2) I was totally lost.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top