Changeset 11 for trunk/markup_stats.cxx


Ignore:
Timestamp:
Dec 24, 2007, 8:52:08 AM (12 years ago)
Author:
cameron
Message:

Reading XML declaration: version/encoding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/markup_stats.cxx

    r7 r11  
    186186  char * filename = argv[1];
    187187
     188  Entity_Declaration_Info xml_info;
     189
    188190  ParsingEngine parser = ParsingEngine(filename);
    189191  parser.InitLexer();
     192
     193  parser.ReadXmlInfo(xml_info);
     194  printf("has_ByteOrderMark = %i\n", xml_info.has_ByteOrderMark);
     195  if (xml_info.has_version_decl) {
     196    printf("XML version 1.%i declared.\n", xml_info.version);
     197  }
     198  else printf ("XML version 1.0 implied by default.\n");
     199  if (xml_info.has_encoding_decl) {
     200    printf("XML encoding named at positions %i through %i\n",
     201           xml_info.encoding_start_pos, xml_info.encoding_end_pos);
     202  }
     203  if (xml_info.has_standalone_decl) {
     204    printf("XML standalone = %i declared.\n", xml_info.standalone);
     205  }
     206  else printf ("XML standalone = 0 by default.\n");
     207
    190208  parser.ParseContent();
    191209
Note: See TracChangeset for help on using the changeset viewer.