aspose file tools
The moose likes Java in General and the fly likes how to convert  java string into XML format ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to convert  java string into XML format ???" Watch "how to convert  java string into XML format ???" New topic
Author

how to convert java string into XML format ???

dhana sss
Greenhorn

Joined: Dec 04, 2004
Posts: 16
hai all,
how to convert java string into XML format and convert XML to java string ??? (this should be dynamic during run time ). if there is any solution help me ....

ex: i'm having string array which was readed from a file . then i want to convert it into XML format to C++ structure ...
from C++ structure i will get the Reply as XML format .. then i want to convert it into java string format...
send me Some sample Code if any......

[ EJFH: Remove invitation to take discussion offline ]
[ February 07, 2005: Message edited by: Ernest Friedman-Hill ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Hi,

Please don't ask people to email you answers to your questions. If the answers are posted here, then other people can benefit from them, as well.

Your question is very vague, and the answers depend on exactly what the various formats you're talking about would look like. Perhaps you could explain in a bit more detail, showing brief, accurate examples of the data you want to convert, and what you want to convert it to.


[Jess in Action][AskingGoodQuestions]
dhana sss
Greenhorn

Joined: Dec 04, 2004
Posts: 16
hai Ernest Friedman-Hill ,
i'm reading text file and store the text file in a string variable . then i want to convert the string into a xml format .

this is my clear question.. if u need more details other than this tell me

by
dhana
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
If I understand the question correctly, you wish to convert raw text into a valid XML document. If this is the case, it should be trival with the amount of free XML Parsers available. I would suggest using JDOM for this. You can easily set the text for whichever XML element you want. Get all the data into variables and then build an XML document, add elements and attributes as appropiate and output to file.
dhana sss
Greenhorn

Joined: Dec 04, 2004
Posts: 16
Thanks Kashif Riaz and all ,

for giving me idea to use JDOM .... another one question friends .....
i want to convert the XML file to String or RTF or Text file . if there is any solution tell ... and any sample code if any ..

thanks by
dhana
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12269
    
    1
The subject of converting XML formatted data to text, RTF, PDF or HTML gets huge thick books - some of which are littering my desk right now....
You should ask for suggestions in the XML and Related Tech forum.
Bill
[ February 08, 2005: Message edited by: William Brogden ]

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to convert java string into XML format ???
 
Similar Threads
conversion of html to java
C++ and JAVA process communication
XSD to Table Structure(Dojo Grid)
Converting xml to xsl
xml to string and string to xml