Images In XML - Help?

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > Miscellaneous Scripting Languages & Ideas

Images In XML - Help?

mimi_m
Can anyone help me out? I need to implement images into a xml webpage, and I don't know how it's done blink.gif

It's for an assignment, and I have ta do it by a .xml page and a .xsl page (for stylesheets). I'm kinda new to xml, so I just know the basics and stuff. I can't find anything on images, but I've seen it done, so does anyone wanna give me a hand with this?

any help is appreciated! biggrin.gif

Reply

ninjamunky
I thought .xml was for formatting, and was supposed to work with .html, the visual part of the webpage. So, the way I always understood it, .xml isn't actually presented directly. You will not end up at ninja.astahost.com/index.xml I'm not sure though.

Reply

mimi_m
Maybe I didn't really make myself clear blink.gif

What I need to do is make an XML page, but format the content using an external XSL page. So I've got all the content written down in the XML page (with the elements and dtd and all), and the main way I'm formatting it, is by using HTML in the XSL page, by using this tag to gather the content data:

<xsl:value-of select="element" />

BUT I'm not sure how to add images (or image links) as part of my content, so I can generate it with the rest of the data (by the xsl page). So that's what I need to find out. I hope that makes it a little clearer, if anyone knows what to do, I'd really appreciate a reply...

thanx biggrin.gif

------------------------------------ Merged by m^e

I'm so stoopid, the answer was infront of me the whole time... I just forgot to format the DTD properly. So silly.

Anyway, for those of you who are interested, or are like me and are missing something that you cant figure out... (and to think i spent about a week trying to search the net and find out what was wrong... tongue.gif ) ... Here is what you need to generate images with XML and XSL:

The XSL code is this:

<img>
<xsl:attribute name="src">
<xsl:value-of select="image"/>
</xsl:attribute>
</img>

Obviously. And in the XML - again obviously - you need an element that's called <image>. Eg:

<vodka name="EffenBlackCherryVodka">
<name>Effen Black Cherry Vodka</name>
<producer>Effen Vodka</producer>
<country>Netherlands</country>
<type>Black Cherry Vodka</type>
<size>750ml</size>
<abv>35% alc/vol</abv>
<image>effen_black.gif</image>
<price currency="USD">USD $30.08</price>
</vodka>

(ignore the rest, I was doing my assignment on Vodka, of all things wink.gif )

And MAKE SURE U DONT PULL A 'ME' and forget to add the image element to your DTD. Again, heres my example:

<!DOCTYPE students [
<!ELEMENT vodkas (vodka+)>
<!ELEMENT vodka (name,producer*,country,type,size*,abv*,price?,image*)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT producer (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT size (#PCDATA)>
<!ELEMENT abv (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT image (#PCDATA)>
<!ATTLIST vodka name ID #REQUIRED>
<!ATTLIST price currency (AUD|USD|EUR) #IMPLIED>
]>

And DONE! I can't believe I forgot this part >.<

Any way, hope that helps other confused peoples. tongue.gif

 

 

 


Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. xsl code to add image - 14.47 hr back. (1)
  2. add image with xml - 14.90 hr back. (1)
  3. display image in html from xml - 33.61 hr back. (1)
  4. element image xml size - 35.99 hr back. (1)
  5. how to give link to image in xml - 41.92 hr back. (1)
  6. how to add links to images coming from xml. - 58.45 hr back. (1)
  7. how to add an image to xml - 61.36 hr back. (2)
  8. link images xml - 65.81 hr back. (1)
  9. how to give images in xml - 69.54 hr back. (1)
  10. xml add description to picture - 70.02 hr back. (1)
  11. adding images to xml - 75.29 hr back. (1)
  12. adding pictures to xml page - 83.04 hr back. (1)
  13. add image in an xml - 83.83 hr back. (2)
  14. how to add an image in xml - 85.82 hr back. (1)
Similar Topics

Keywords : images, xml

  1. Need Help Using 2 Images In CSS
    (12)


      Looking for images, xml

Searching Video's for images, xml
advertisement




Images In XML - Help?



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE