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

« back to all changes in this revision

Viewing changes to examples/import_node/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:
7
7
using namespace xmlpp;
8
8
using namespace std;
9
9
 
10
 
int main (int argc, char *argv[]){
11
 
  try {
 
10
int main (int argc, char *argv[])
 
11
{
 
12
  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
 
13
  try
 
14
  {
 
15
  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED 
12
16
    DomParser example1("example1.xml");
13
17
    DomParser example2("example2.xml");
14
18
    
29
33
    string doc1_string = doc1->write_to_string_formatted();
30
34
    cout << doc1_string;
31
35
    return EXIT_SUCCESS;
 
36
  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
32
37
  }
33
 
  catch (std::exception &e){
34
 
    cerr << "Caught exception " << e.what() << endl;
 
38
  catch (std::exception& ex)
 
39
  {
 
40
    cerr << "Caught exception " << ex.what() << endl;
35
41
    return EXIT_FAILURE;
36
42
  }
 
43
  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED 
37
44
}