Altova Mailing List Archives


Re: convert text documents to XML

From: Joe Kesselman <keshlam.cat.nospam@-------.--->
To: NULL
Date: 8/4/2009 4:31:00 AM
> can we convert it  into xml directly?

You could certainly write code to parse this document format and produce 
XML output. Of course, you have to decide what XML markup you're going 
to use to represent the data, but after doing that it's not 
significantly harder to produce XML than to put the data into a database.

I would recommend taking advantage of existing XML APIs -- DOM or SAX -- 
which will take care of the details of XML syntax and let you focus on 
the structure of the XML document. DOM is probably easier for a beginner 
to learn, since it's a tree structure; SAX is event-based and requires 
that you maintain more state in your own code, but would be more 
efficient for this sort of flow-through format conversion.

There may be off-the-shelf tools which can do the conversion for you, 
but I haven't used any... and I'd consider this a fairly trivial bit of 
programming so I wouldn't bother looking for one.

You might also want to contact whoever maintains the database you're 
trying to access via the web, and see if they already offer a service 
which returns the data in XML form rather than text form.

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.