version 1.21, 2003/07/29 20:50:11
|
version 1.22, 2003/08/12 17:50:18
|
|
|
| |
Boolean XmlParser::_getElementName(char*& p) | Boolean XmlParser::_getElementName(char*& p) |
{ | { |
if (!isalpha(*p) && *p != '_') |
if (!String::isUTF8(p)) |
throw XmlException(XmlException::BAD_START_TAG, _line); | throw XmlException(XmlException::BAD_START_TAG, _line); |
| |
while (*p && |
while ((*p) && |
(isalnum(*p) || *p == '_' || *p == '-' || *p == ':' || *p == '.')) |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
*p == '_' || *p == '-' || *p == ':' || *p == '.')) |
p++; | p++; |
| |
// The next character must be a space: | // The next character must be a space: |
|
|
{ | { |
openCloseElement = false; | openCloseElement = false; |
| |
if (!isalpha(*p) && *p != '_') |
if (!String::isUTF8(p)) |
throw XmlException(XmlException::BAD_START_TAG, _line); | throw XmlException(XmlException::BAD_START_TAG, _line); |
| |
while (*p && |
while ((*p) && |
(isalnum(*p) || *p == '_' || *p == '-' || *p == ':' || *p == '.')) |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
*p == '_' || *p == '-' || *p == ':' || *p == '.')) |
p++; | p++; |
| |
// The next character must be a space: | // The next character must be a space: |
|
|
| |
void XmlParser::_getAttributeNameAndEqual(char*& p) | void XmlParser::_getAttributeNameAndEqual(char*& p) |
{ | { |
if (!isalpha(*p) && *p != '_') |
if (!String::isUTF8(p)) |
throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line); | throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line); |
| |
while (*p && |
while ((*p) && |
(isalnum(*p) || *p == '_' || *p == '-' || *p == ':' || *p == '.')) |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
*p == '_' || *p == '-' || *p == ':' || *p == '.')) |
p++; | p++; |
| |
char* term = p; | char* term = p; |
|
|
| |
return; | return; |
} | } |
else if (isalpha(*p) || *p == '_') |
else if (String::isUTF8(p)) |
{ | { |
entry.type = XmlEntry::START_TAG; | entry.type = XmlEntry::START_TAG; |
entry.text = p; | entry.text = p; |
|
|
if (!getAttributeValue(name, tmp)) | if (!getAttributeValue(name, tmp)) |
return false; | return false; |
| |
value = tmp; |
value = String(tmp,STRING_FLAG_UTF8); |
return true; | return true; |
} | } |
| |