/src/wrappers/xml/library/xml2_parser.e

http://github.com/tybor/Liberty · Specman e · 22 lines · 16 code · 2 blank · 4 comment · 1 complexity · 3ed02bc04bc74fb451e7dcdfcc42bbcc MD5 · raw file

  1. deferred class XML2_PARSER
  2. insert LIBXML2_EXTERNALS
  3. feature {ANY}
  4. parse_file (an_xml_file: STRING): XML2_DOC
  5. -- parse the XML file named `an_xml_file' and build a tree. Automatic
  6. -- support for ZLIB/Compress compressed document is provided by default
  7. -- if found at compile-time. The resulting XML2_DOC will be Void if the
  8. -- file was not wellformed.
  9. require name_not_void: an_xml_file/=Void
  10. local p: POINTER
  11. do
  12. debug
  13. print ("Parsing "+an_xml_file+"%N")
  14. end
  15. p:=xml_parse_file(an_xml_file.to_external)
  16. if p.is_not_null then
  17. create Result.from_external_pointer(p)
  18. end
  19. end
  20. end -- class XML2_PARSER