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

« back to all changes in this revision

Viewing changes to libxml++/parsers/domparser.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:
49
49
 
50
50
  if(!context_)
51
51
  {
 
52
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
52
53
    throw internal_error("Couldn't create parsing context");
 
54
    #else
 
55
    return;
 
56
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
53
57
  }
54
58
 
55
59
  if(context_->directory == 0)
72
76
 
73
77
  if(!context_)
74
78
  {
 
79
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
75
80
    throw internal_error("Couldn't create parsing context");
 
81
    #else
 
82
    return;
 
83
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
76
84
  }
77
85
 
78
86
  parse_context();
93
101
 
94
102
  if(!context_)
95
103
  {
 
104
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
96
105
    throw internal_error("Context not initialized");
 
106
    #else
 
107
    return;
 
108
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
97
109
  }
98
110
 
99
111
  xmlParseDocument(context_);
103
115
  if(!context_->wellFormed)
104
116
  {
105
117
    release_underlying(); //Free doc_;
 
118
 
 
119
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
106
120
    throw parse_error("Document not well-formed.");
 
121
    #else
 
122
    return;
 
123
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
107
124
  }
108
125
 
109
126
  if(context_->errNo != 0)
113
130
 
114
131
    release_underlying();
115
132
 
 
133
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
116
134
    throw parse_error(o.str());
 
135
    #else
 
136
    return;
 
137
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
117
138
  }
118
139
 
119
140
  doc_ = new Document(context_->myDoc);
144
165
 
145
166
  if(!context_)
146
167
  {
 
168
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
147
169
    throw internal_error("Couldn't create parsing context");
 
170
    #else
 
171
    return;
 
172
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
148
173
  }
149
174
 
150
175
  initialize_context();
167
192
  if(!context_->wellFormed)
168
193
  {
169
194
    release_underlying(); //Free doc_;
 
195
 
 
196
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
170
197
    throw parse_error("Document not well-formed.");
 
198
    #else
 
199
    return;
 
200
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
171
201
  }
172
202
 
173
203
  if(context_->errNo != 0)
177
207
 
178
208
    release_underlying();
179
209
 
 
210
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
180
211
    throw parse_error(o.str());
 
212
    #else
 
213
    return;
 
214
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
181
215
  }
182
216
 
183
217
  doc_ = new Document(context_->myDoc);