version 1.18.6.4, 2003/08/14 18:31:23
|
version 1.21, 2003/07/29 20:50:11
|
|
|
"Common.XmlParser.SEMANTIC_ERROR" | "Common.XmlParser.SEMANTIC_ERROR" |
}; | }; |
| |
// l10n replace _formMessage (comment out the old one) |
// l10n TODO replace _formMessage with the commented one and uncomment |
|
// the new constructors |
/* | /* |
static String _formMessage(Uint32 code, Uint32 line, const String& message) | static String _formMessage(Uint32 code, Uint32 line, const String& message) |
{ | { |
|
|
| |
Boolean XmlParser::_getElementName(char*& p) | Boolean XmlParser::_getElementName(char*& p) |
{ | { |
if (!String::isUTF8(p) || |
if (!isalpha(*p) && *p != '_') |
!(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
(*p == '_'))) |
|
throw XmlException(XmlException::BAD_START_TAG, _line); | throw XmlException(XmlException::BAD_START_TAG, _line); |
p++; |
|
| |
while ((*p) && |
while (*p && |
(((*p >= 'A') && (*p <= 'Z')) || |
(isalnum(*p) || *p == '_' || *p == '-' || *p == ':' || *p == '.')) |
((*p >= 'a') && (*p <= 'z')) || |
|
((*p >= '0') && (*p <= '9')) || |
|
*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 (!String::isUTF8(p) || |
if (!isalpha(*p) && *p != '_') |
!(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
(*p == '_'))) |
|
throw XmlException(XmlException::BAD_START_TAG, _line); | throw XmlException(XmlException::BAD_START_TAG, _line); |
p++; |
|
| |
while ((*p) && |
while (*p && |
(((*p >= 'A') && (*p <= 'Z')) || |
(isalnum(*p) || *p == '_' || *p == '-' || *p == ':' || *p == '.')) |
((*p >= 'a') && (*p <= 'z')) || |
|
((*p >= '0') && (*p <= '9')) || |
|
*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 (!String::isUTF8(p) || |
if (!isalpha(*p) && *p != '_') |
!(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
(*p == '_'))) |
|
throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line); | throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line); |
p++; |
|
| |
while ((*p) && |
while (*p && |
(((*p >= 'A') && (*p <= 'Z')) || |
(isalnum(*p) || *p == '_' || *p == '-' || *p == ':' || *p == '.')) |
((*p >= 'a') && (*p <= 'z')) || |
|
((*p >= '0') && (*p <= '9')) || |
|
*p == '_' || *p == '-' || *p == ':' || *p == '.')) |
|
p++; | p++; |
| |
char* term = p; | char* term = p; |
|
|
| |
return; | return; |
} | } |
else if (String::isUTF8(p) && |
else if (isalpha(*p) || *p == '_') |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
(*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 = String(tmp,STRING_FLAG_UTF8); |
value = tmp; |
return true; | return true; |
} | } |
| |