~ubuntu-branches/ubuntu/natty/libxml++2.6/natty

« back to all changes in this revision

Viewing changes to examples/sax_parser/main.cc

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-09-18 11:32:24 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20070918113224-7x031mzf1shoozxx
Tags: 2.20.0-0ubuntu1
* New upstream release:
  - Element: Added get_attribute_value(), to get a simple text value for an
    attribute.
  - Added an experimental --enable-api-exceptions configure option, to allow
    libxml++ to build without exceptions.
* debian/libxml++2.6-doc.docs: 2.18 -> 2.20.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    filepath = "example.xml";
39
39
    
40
40
  // Parse the entire document in one go:
 
41
  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
41
42
  try
42
43
  {
 
44
  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED 
43
45
    MySaxParser parser;
44
46
    parser.set_substitute_entities(true); //
45
47
    parser.parse_file(filepath);
 
48
  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
46
49
  }
47
50
  catch(const xmlpp::exception& ex)
48
51
  {
49
52
    std::cout << "libxml++ exception: " << ex.what() << std::endl;
50
53
  }
 
54
  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
51
55
 
52
56
 
53
57
  // Demonstrate incremental parsing, sometimes useful for network connections: