PDA

View Full Version : Need Help in writing img files to xml !!!


wanye
09-22-2002, 04:54 PM
hi all, how do i insert image files from a file field and write to the xml file itself... is the coding done thru asp, or html or xsl file?? i really need help badly ...thks....

mpjbrennan
09-22-2002, 08:45 PM
You can include a <picture> or <image> element (or whatever name you choose) within your xml file, give it the appropriate href attribute, and then transform this into an <img> tag using an xsl stylesheet.

patrick

Alex Vincent
09-22-2002, 10:11 PM
mjpbrennan's answer is probably the best you're going to get. XML languages are typically intended to convey text-based data, and images really don't fit well.

There are alternatives, though:

<img xmlns="http://www.w3.org/1999/xhtml" src="whatever.jpg" />

If the client browser is configured to recognize namespaces in an XML document, this should force the browser to retrieve the image.

Another option is the SVG language, which is a markup language describing an image by vectors. It's not good for photography, but for simple diagrams it's plenty.

HTH :cool:

jkd
09-22-2002, 10:14 PM
You can also use XLink to tell the viewer to embed the data at the value of xlink:href into the page, which could be an image...

Alex Vincent
09-22-2002, 10:25 PM
:) XLink support is spotty even in Mozilla...

jkd
09-23-2002, 12:23 AM
Originally posted by Alex Vincent
:) XLink support is spotty even in Mozilla...

xlink:type="simple" works very well in Moz. I don't think any other web browser though even supports any XLink...

wanye
09-23-2002, 05:08 PM
hi all, what i mean is to get an image from a file field and write the image to the xml file without hardcoding it in the xml file initially.... how to do that?
eg. its juz like browsing for an image file and store it in the xml file and i will like to display the img according to different xsl stylesheets

Alex Vincent
09-24-2002, 04:58 AM
Ack, that's something totally different. Your best bet is to pick a technology (probably server-side, like Perl or PHP) to receive a form submission of some sort.

I have no idea how you'd do that. :(