Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] Do I need XML parser ?

From: "Michael Kay" <mike@--------.--->
To: "'Saha Rabindra N'" <saha.rn@------.--->,<xml-dev@-----.---.--->
Date: 3/4/2005 6:04:00 PM
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 
&lt;
 
(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/


  
  
  From: Saha Rabindra N 
  [mailto:saha.rn@m...] 
Sent: 03 March 2005 19:50
To: 
  xml-dev@l...
Subject: [xml-dev] Do I need XML parser 
  ?
Importance: High


  
  <!---->
  Hello, 
 As I am new to this XML business so I 
  got a basic and simple question. 
Here it goes... 
I have one cobol data file (in ASCII format) and one cobol 
  record description file to describe the position/length of each field of data 
  file.
  I want to generate one XML file 
  out of that cobol data file. My question is 
1) Do I need any XML parser to just generate one XML file 
  from a data file ? Or a simple programming 
  logic can create the XML file ?
  2) While environment/programming 
  language would be best in this scenario ? 
        a) program written in cobol on Mainframe ? 
        b) to transfer the datafile to a Unix m/c and the generate the XML file 
  in C language ? 
        c) to transfer the datafile to a Unix m/c and the generate the XML file 
  using shell script ? 
  Any quick help would be highly 
  appreciated ! 
  Thanks in advance, 
  
  Regards 
Rabindra Nath Saha 
   
  The information contained in this e-mail may be 
  confidential and is intended solely for the use of the named 
  addressee.
  Access, copying or re-use of the 
  e-mail or any information contained therein by any other person is not 
  authorized.
  If you are not the 
  intended recipient please notify us immediately by returning the e-mail to the 
  originator.(A)


transparent
Print
Mail
Like It
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.

.
.

transparent

transparent