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