[Home] [By Thread] [By Date] [Recent Entries]
Title: Do I need XML parser ? In many cases it's easy enough to generate XML just by
writing it out directly as a print file. You can do this in any programming
language. The only things you need to be a little careful about
are:
(a) the character encoding of the text file that you write
must be correctly described in the XML declaration at the head of the
file
(b) special characters such as <, >, and & (and
quotes in attribute values) need to be escaped using sequences such as
<
(c) some control characters are not permitted, and others
such as newline may need to be escaped if you need to preserve them
as-is.
If you're starting with a COBOL file on a mainframe this is
probably the simplest approach. With an XML-aware language such as Java you have
rather more choices; my own preference is usually to write "events" such as
startElement, endElement etc to a SAX serializer.
An XML parser is needed only by an application that
reads XML, not one that writes XML.
Michael Kay
http://www.saxonica.com/
|

Cart



