473,795 Members | 2,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Java code to convert text files to xml

Is anyone aware of a Java program preferably w/ source code to convert
files in text format to xml format?
Pls. let me know if you are aware of such a program.
Jul 20 '05 #1
3 9042
In article <61************ **************@ posting.google. com>,
ro***@alum.rpi. edu (mave) wrote:
:Is anyone aware of a Java program preferably w/ source code to convert
:files in text format to xml format?
:
:
:Pls. let me know if you are aware of such a program.


Not likely, since the details of the text format and the desired XML
document structure are up to you. You just need to write something that
reads the text file, since you know its structure, and builds the XML
document the way you want it from the data, then writes it.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama
Jul 20 '05 #2
"Steve W. Jackson" <st***********@ charter.net> wrote in message news:<st******* *************** ***********@new s.fu-berlin.de>...
In article <61************ **************@ posting.google. com>,
ro***@alum.rpi. edu (mave) wrote:
:Is anyone aware of a Java program preferably w/ source code to convert
:files in text format to xml format?
:
:
:Pls. let me know if you are aware of such a program.


Not likely, since the details of the text format and the desired XML
document structure are up to you. You just need to write something that
reads the text file, since you know its structure, and builds the XML
document the way you want it from the data, then writes it.

= Steve =


Hi Steve,

Have you written something to build XML documents as you describe?

L
Jul 20 '05 #3
In article <f7************ *************@p osting.google.c om>,
lq****@univ.llu .edu wrote:
:"Steve W. Jackson" <st***********@ charter.net> wrote in message
:news:<st***** *************** *************@n ews.fu-berlin.de>...
:> In article <61************ **************@ posting.google. com>,
:> ro***@alum.rpi. edu (mave) wrote:
:>
:> >:Is anyone aware of a Java program preferably w/ source code to convert
:> >:files in text format to xml format?
:> >:
:> >:
:> >:Pls. let me know if you are aware of such a program.
:>
:> Not likely, since the details of the text format and the desired XML
:> document structure are up to you. You just need to write something that
:> reads the text file, since you know its structure, and builds the XML
:> document the way you want it from the data, then writes it.
:>
:> = Steve =
:
:Hi Steve,
:
:Have you written something to build XML documents as you describe?
:
:L


Not personally, but my coworker has done this. Our application does
high end modeling and simulation, using XML documents for the saved
model format. He worked on the previous incarnation of the application,
which used a completely different (pure text) file structure. So he put
together an "importer" that read the old file and put it into the
appropriate structure for our application.

It's just a matter of deciding what the structure of your XML document
should be and knowing what's in the text file. You create a new XML
document with appropriate code in Java, then add/manipulate elements and
attributes as needed to obtain the desired result.

= Steve =
--
Steve W. Jackson
Montgomery, Alabama
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14637
by: Danny | last post by:
I am new to java/javascript. I wrote javascript to proces a cookie. I don't like that fact that the code is visible to all. Can I create a java application that resides on the server and call it this way the code will be hidden? How can a prepare it? It is an apache unix server. Thanks in advance
0
2170
by: Ray Tayek | last post by:
hi, trying to convert some csv files into xsml and pulling a few hairs out :(. using the files below. a java program will parse the csv and take care of strange names and notes that line breaks in them. eventiually i want to generate the xslt from a xml file (all the files and java code are at http://tayek.com/~ray/spy1/). the java code (1.4) does the right thing (it just does the transformation). xmlspy seems really broken when i hit...
0
2586
by: Chua Wen Ching | last post by:
Hi there, I had downloaded the Java Language Conversion Assistant 2.0 from http://msdn.microsoft.com/vstudio/downloads/tools/jlca/. I had installed it and it was suppose to integrate to VS.NET 2003. It works fine.
14
7328
by: Mick | last post by:
I wrote a C# program that interfaces with a data vendor over the web using an API they supplied and their examples in C#. Now I have another data vendor's API and example that I want to add to my C# program. But this new API is written in Java. They gave me an example source code that uses their API but the actual API looks like it is stored in a few .jar files. I unzipped those .jar files into many .class files. I think these .class...
1
9657
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
10
2890
by: Jay | last post by:
I've downloaded some Java files from the internet, and want to use them as a basis for a C# programme. They are .jar files, and when I open them in Notepad, they are not text files. Is there a way to get some sort of source code from them? Sorry if this sounds a bit basic, but I've never used Java before.
8
28606
by: ajos | last post by:
hi frnds, im trying to convert my servlets database configuration from ms access to mysql database.however im getting some error like no driver found exception. to verify this error ive made a simple database in jsp(just to check if my mysql is working smoothly otherwise) which access' the username.....but in the process im getting a error--> java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) i have...
2
5190
budigila
by: budigila | last post by:
Hiya peeps, Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am trying to do is to convert an .xml using a .xsl to and using a java script to output it into a readable format within excel. I have been able to successfully use a javascript to combine my .xml and .xsl but cannot figure out how to have it output to...
0
10785
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
10439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.