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

« back to all changes in this revision

Viewing changes to examples/dom_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:
118
118
  else
119
119
    filepath = "example.xml";
120
120
  
 
121
  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
121
122
  try
122
123
  {
 
124
  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED 
123
125
    xmlpp::DomParser parser;
124
126
    parser.set_validate();
125
127
    parser.set_substitute_entities(); //We just want the text to be resolved/unescaped automatically.
130
132
      const xmlpp::Node* pNode = parser.get_document()->get_root_node(); //deleted by DomParser.
131
133
      print_node(pNode);
132
134
    }
 
135
  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
133
136
  }
134
137
  catch(const std::exception& ex)
135
138
  {
136
139
    std::cout << "Exception caught: " << ex.what() << std::endl;
137
140
  }
 
141
  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED 
138
142
 
139
143
  return 0;
140
144
}