Maybe I didn't really make myself clear
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

------------------------------------ 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...

) ... 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

)
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.

Reply