Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member KillaTeddyX's Avatar
    Join Date
    Dec 2006
    Posts
    81
    Member #
    14455
    Hey guys I want to add a picture to my XML document now the problem is that I have tried creating a css file and tried adding it as a background image but this doesn't seem to work (I even checked that the image filename was correct), does anyone know how you can do this? I have tried googling this but can only find refrences to XHTML and not xml.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    uhhh...

    uhhhhh...

    ok, let's start at the beginning.

    XML is a text file. There are no images "in" XML per se, the same as with HTML.

    You can add an <img /> element to XML, but since XML is "extensible", it's kind of pointless, since that element is meaningless without the appropriate schema.

    So then, the XML format made for displaying <img /> elements is... you guessed it... XHTML! Which explains your search results.

    Finally, if you must "hack" your XML to embed an image, you can use CDATA to put the image directly in your XML as binary info.

    However, as noted above, that image won't display except on some flexible parsing systems (such as Firefox or IE), since XML in and of itself isn't "made" to display images.

    Hope this explains a bit.

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    So the short response... search on Google for:

    CDATA+XML+Binary

  5. #4
    Member KillaTeddyX's Avatar
    Join Date
    Dec 2006
    Posts
    81
    Member #
    14455
    Cheers dude you guys are always cool sorry for the newb question but I am still learning XML..


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:39 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com