home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / exml.lha / exml / examples / se_test / root_class.e < prev    next >
Text File  |  1999-10-09  |  693b  |  45 lines

  1. class
  2.     ROOT_CLASS
  3. inherit
  4.     EXPAT_ERROR_CODES
  5. creation
  6.  
  7.     make
  8.  
  9. feature -- Initialization
  10.     make is
  11.         do
  12.             !! parser.make
  13.             parser_test
  14.         end;
  15.  
  16.     parser: MY_XML_PARSER
  17.  
  18.     parser_test is
  19.         local
  20.             f: STD_FILE_READ
  21.             s: STRING
  22.         do
  23.             print ("file test:%N")
  24.             !! f.connect_to ("/test_data/test.xml")
  25.             check
  26.                 file_open: f.is_connected
  27.             end
  28.             !! s.make (0)
  29.             f.read_tail_in (s)
  30.             parser.parse_string (s)
  31.             parser.set_end_of_file
  32.             if
  33.                 parser.is_correct
  34.             then
  35.                 print ("%NNo errors detected%N")
  36.             else
  37.                 print (parser.last_error_extended_description)
  38.             end
  39.             parser.set_end_of_file
  40.             f.disconnect
  41.         end
  42.  
  43. end -- class ROOT_CLASS
  44.  
  45.