Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 04-25-2008, 04:42 AM Image in xml
Junior Talker

Posts: 1
Trades: 0
Hi all first post here hoping someone can help. This is my first shot at xml so please go easy on me if this is pretty obvious. I've been looking at xml for a few days now. Done all the usual things got myself a book and followed some instructions on the net. I can succesfully pull a xml page into my html document and display its contents I,m wondering if it is possible to have a reference to an image in an xml document, maybe the url of the image or something. I'm really not sure where to start with this. Any help would be much appreciated. I have found various topics on this on the net but most seem to be tested in mozilla only or seem a little more complicated than i need.

Last edited by mickeytwoguns; 04-25-2008 at 04:45 AM..
mickeytwoguns is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-27-2008, 03:58 AM Re: Image in xml
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
it's never going to be easy when you first start with XML.

An image could be referenced in exactly the same way everything else is and it just become another node in the document.

Are you using XSL & XSLT (Transforms) to display the XML in the browser?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-02-2008, 02:20 PM Re: Image in xml
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
Depending on what your XML file looks like, you'll probably want to do an XSL transform as you bring the XML file into your web page, as chrishirst said. Fortunately, XSLT shouldn't take you more than 3-4 hours to get the basics down. If you're processing XML documents you've probably run into XPath and that's how you'll retrieve items to manipulate in you XSLT document.

For example, given the following XML file:

Code:
<!-- Standard XML header and parent nodes... -->
<Image>
  <URI>http://example.com/image.png</URI>
</Image>
<!-- Finish the item -->
You'll use an XPath expression like:

Code:
\\Item\Image\URL
and then your XSLT might look like this for when you want to display the image:

Code:
<img src="{.\Image\URI} />
Something along those lines. Check out these XSLT tutorials.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Reply     « Reply to Image in xml
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12357 seconds with 12 queries