version 1.34, 2005/11/03 00:35:04
|
version 1.35, 2005/11/07 23:20:01
|
|
|
// &apos - apostrophe | // &apos - apostrophe |
// | // |
// as well as character (numeric) references: | // as well as character (numeric) references: |
|
// |
// 1 - decimal reference for character '1' | // 1 - decimal reference for character '1' |
// 1 - hexadecimal reference for character '1' | // 1 - hexadecimal reference for character '1' |
// | // |
|
|
// | // |
// TODO: | // TODO: |
// | // |
// ATTN: KS P1 4 Mar 2002. Review the following TODOs to see if there is work. |
// ATTN: KS P1 4 Mar 2002. Review the following TODOs to see if there is |
// Handle <!DOCTYPE...> sections which are complicated (containing |
// work. Handle <!DOCTYPE...> sections which are complicated (containing |
// rules rather than references to files). | // rules rather than references to files). |
// | // |
// Remove newlines from string literals: | // Remove newlines from string literals: |
|
|
// Nothing to do! | // Nothing to do! |
} | } |
| |
|
// A-Za-z0-9_-:. |
|
static unsigned char _isInnerElementChar[] = |
|
{ |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
|
0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1, |
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1, |
|
1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
|
}; |
|
|
Boolean XmlParser::_getElementName(char*& p) | Boolean XmlParser::_getElementName(char*& p) |
{ | { |
if (!(((*p >= 'A') && (*p <= 'Z')) || |
if (!CharSet::isAlNumUnder(Uint8(*p))) |
((*p >= 'a') && (*p <= 'z')) || |
|
(*p == '_'))) |
|
throw XmlException(XmlException::BAD_START_TAG, _line); | throw XmlException(XmlException::BAD_START_TAG, _line); |
|
|
p++; | p++; |
| |
while ((*p) && |
while (*p && _isInnerElementChar[Uint8(*p)]) |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*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 (!(((*p >= 'A') && (*p <= 'Z')) || |
if (!CharSet::isAlNumUnder(Uint8(*p))) |
((*p >= 'a') && (*p <= 'z')) || |
|
(*p == '_'))) |
|
throw XmlException(XmlException::BAD_START_TAG, _line); | throw XmlException(XmlException::BAD_START_TAG, _line); |
|
|
p++; | p++; |
| |
while ((*p) && |
while (*p && _isInnerElementChar[Uint8(*p)]) |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*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 (!(((*p >= 'A') && (*p <= 'Z')) || |
if (!CharSet::isAlNumUnder((Uint8)*p)) |
((*p >= 'a') && (*p <= 'z')) || |
|
(*p == '_'))) |
|
throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line); | throw XmlException(XmlException::BAD_ATTRIBUTE_NAME, _line); |
|
|
p++; | p++; |
| |
while ((*p) && |
while (*p && _isInnerElementChar[Uint8(*p)]) |
(((*p >= 'A') && (*p <= 'Z')) || |
|
((*p >= 'a') && (*p <= 'z')) || |
|
((*p >= '0') && (*p <= '9')) || |
|
*p == '_' || *p == '-' || *p == ':' || *p == '.')) |
|
p++; | p++; |
| |
char* term = p; | char* term = p; |