jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes How to Represent dynamic Image data into XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to Represent dynamic Image data into XML " Watch "How to Represent dynamic Image data into XML " New topic
Author

How to Represent dynamic Image data into XML

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

I have some Employee Data in my MySQL Database.
I am representing all this data in form of XML as shown

<Employees>

<User>
<name>Kiran</name>
<Dept>20</Dept>
</User>

<User>
<name>Ravi</name>
<Dept>30</Dept>
</User>

</Employees>



I am using XstreamAPI to convert ArrayList of Employee Data into XML . All this works fine .


Now my question is that ,Image of an Employee has also been added .

Please let me know as how can bring this Image also into this XML Format .
Please share your inputs and views on this .

Thanks .

Save India From Corruption - Anna Hazare.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You can base64 encode it.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thanks at least you gave some input to perform Google search on this .
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3712
    
    5

I don't recommend putting binary data inside XML, its not particularly good at it.


My Blog: Down Home Country Coding with Scott Selikoff
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Represent dynamic Image data into XML