Changeset 10928 for OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp
- Timestamp:
- 01/07/10 18:36:44 (3 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp
r10921 r10928 227 227 228 228 int c = 0; 229 while ((c=input[0])>=0 && c!=' ' && c!='>' )229 while ((c=input[0])>=0 && c!=' ' && c!='>' && c!='/') 230 230 { 231 231 childNode->name.push_back(c); … … 233 233 } 234 234 235 while ((c=input[0])>=0 && c!='>' )235 while ((c=input[0])>=0 && c!='>' && c!='/') 236 236 { 237 237 Input::size_type prev_pos = input.currentPosition(); … … 240 240 std::string option; 241 241 std::string value; 242 while((c=input[0])>=0 && c!='>' && c!=' "' && c!='\'' && c!='=' && c!=' ')242 while((c=input[0])>=0 && c!='>' && c!='/' && c!='"' && c!='\'' && c!='=' && c!=' ') 243 243 { 244 244 option.push_back(c); … … 296 296 } 297 297 298 if ((c=input[0])>=0 && c=='>' )298 if ((c=input[0])>=0 && c=='>' || c=='/') 299 299 { 300 300 ++input; … … 302 302 osg::notify(osg::INFO)<<"Valid tag ["<<childNode->name<<"]"<<std::endl; 303 303 304 bool result = childNode->read(input); 305 if (!result) return false; 304 if (c=='/') 305 { 306 if ((c=input[0])>=0 && c=='>') 307 { 308 ++input; 309 osg::notify(osg::INFO)<<"tag is closed correctly"<<std::endl; 310 } 311 else 312 osg::notify(osg::NOTICE)<<"Error: end tag is not closed correctly"<<std::endl; 313 } 314 else 315 { 316 bool result = childNode->read(input); 317 if (!result) return false; 318 } 306 319 307 320 if (type==NODE && !children.empty()) type = GROUP; … … 388 401 fout<<"\""; 389 402 } 390 fout<<">"; 391 392 for(Children::const_iterator citr = children.begin(); 393 citr != children.end(); 394 ++citr) 395 { 396 (*citr)->write(fout); 397 } 398 399 if (!contents.empty()) writeString(fout,contents); 400 401 fout<<"</"<<name<<">"<<std::endl; 403 404 if (children.empty()) 405 { 406 fout<<" />"<<std::endl; 407 } 408 else 409 { 410 fout<<">"; 411 for(Children::const_iterator citr = children.begin(); 412 citr != children.end(); 413 ++citr) 414 { 415 (*citr)->write(fout); 416 } 417 418 if (!contents.empty()) writeString(fout,contents); 419 420 fout<<"</"<<name<<">"<<std::endl; 421 } 402 422 return true; 403 423 }
