aspose file tools*
The moose likes XML and Related Technologies and the fly likes Images with XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Images with XML" Watch "Images with XML" New topic
Author

Images with XML

Adnan Memon
Ranch Hand

Joined: Mar 09, 2003
Posts: 32
Im using xml as tool that humans can use to write documents which are understandable by both computers and humans...for example rather having to write a question paper in formal way, write it using markup language so that it can be deployed easily and understandable by all. But problem occurs when there is need of attaching images e.g. diagrams etc with questions..how can i do that using schema..what are alternatives...thanks
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
The simple way would be refering the image location as an attribute or element.
example: <question num="10" imageURL="/images/foo.gif" query="some text" />

or by using binary representation(xsd:base64Binary) of image data and post processing it to display the image back. Not a good idea, sucks time and resource. IMHO


Spritle Software Blogs
Adnan Memon
Ranch Hand

Joined: Mar 09, 2003
Posts: 32
That is well...I had user to submit both an .xml file and associated images. Now if we think of web UI to such user it probably would have one browse textbox for xml file but what about images thier number could be any...How to cope with that
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Adnan Memon:
That is well...I had user to submit both an .xml file and associated images. Now if we think of web UI to such user it probably would have one browse textbox for xml file but what about images thier number could be any...How to cope with that

I might have not understand your requirements(SRS) completely, but posting XML and images seperately from the user is not a good idea. You want your user to upload an xml file, then you can use a file upload function, the images in the xml file will be encoded using base64binary. This involves both pre and post processing of images.

Someone please correct me if i'm wrong.
Adnan Memon
Ranch Hand

Joined: Mar 09, 2003
Posts: 32
Let me clear it to u...a user had written a test paper in xml markup with image url referring to images, there is some webapp running at xyz server...user is given a web UI to submit .xml file and related images using internet browser by HTTP Post request...what would be the interface to such hypothetical user...as far as the idea of including image binary content in xml file using base64encoding, i've never used it before...whether user had to copy binary contents direct into xml file or something different..would u pls provide an example
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Images with XML
 
Similar Threads
images inserting
images
Question for Kevin
Proverbs that moved you!!
Error Handling best practices