| 422 | |
| 423 | |
| 424 | const char* XMLParser::parseXMLName(const char* endMarkers, UInt32& size) { |
| 425 | |
| 426 | if (!isalpha(*_current) && *_current!='_') { |
| 427 | _ex.set(Exception::FORMATTING, "XML name must start with an alphabetic character"); |
| 428 | return NULL; |
| 429 | } |
| 430 | const char* name(_current++); |
| 431 | while (_current < _end && isxml(*_current)) |
| 432 | ++_current; |
| 433 | size = (_current - name); |
| 434 | if (_current==_end || (!strchr(endMarkers,*_current) && !isspace(*_current))) { |
| 435 | _ex.set(Exception::FORMATTING, "XML name '",string(name,size),"' without termination"); |
| 436 | return NULL; |
| 437 | } |
| 438 | return name; |
| 439 | } |
| 440 | |
| 441 | } // namespace Mona |