Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Create XML file from text file

Thread view: 
matofarides@gmail.com - 05 Jan 2006 10:21 GMT
Hello all!

I was wondering whether there was a way, using any XML parser
(preferably xerces), to create an XML file by reading, line by line a
text file.

Thank you,

Marios Tofarides
Ed Beroset - 05 Jan 2006 11:35 GMT
> Hello all!
>
> I was wondering whether there was a way, using any XML parser
> (preferably xerces), to create an XML file by reading, line by line a
> text file.

Generally not, since an XML parse, by definition, parses XML and plain
text is not XML.  What I've done in such situations is to write a parser
for the source language (whatever kind of language is in the text file)
using tools like lex and yacc (and the Java equivalents) and write
simple production rules to generate meaningful XML.  From there, you can
use XSLT to further process the file contents, and *that* is where an
XML parser can be useful.

Ed
Daniel Parker - 05 Jan 2006 13:58 GMT
> I was wondering whether there was a way, using any XML parser
> (preferably xerces), to create an XML file by reading, line by line a
> text file.

Wrong tool.  You might want to have a look at
http://servingxml.sourceforge.net/.

Regards,
Daniel Parker


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.