2 #ifndef __RAPIDXML_H_INCLUDE__
3 #define __RAPIDXML_H_INCLUDE__
11 #if !defined(RAPIDXML_NO_STDLIB)
21 #pragma warning(disable:4127) // Conditional expression is constant
27 #if defined(RAPIDXML_NO_EXCEPTIONS)
29 #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); }
49 void parse_error_handler(
const char* what,
void* where);
56 #define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where)
86 const char*
what() const noexcept
override
97 return reinterpret_cast<Ch*
>(m_where);
113 #ifndef RAPIDXML_STATIC_POOL_SIZE
117 #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024)
120 #ifndef RAPIDXML_DYNAMIC_POOL_SIZE
124 #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024)
127 #ifndef RAPIDXML_ALIGNMENT
132 #define RAPIDXML_ALIGNMENT sizeof(void *)
295 static const unsigned char lookup_whitespace[256];
296 static const unsigned char lookup_node_name[256];
297 static const unsigned char lookup_text[256];
298 static const unsigned char lookup_text_pure_no_ws[256];
299 static const unsigned char lookup_text_pure_with_ws[256];
300 static const unsigned char lookup_attribute_name[256];
301 static const unsigned char lookup_attribute_data_1[256];
302 static const unsigned char lookup_attribute_data_1_pure[256];
303 static const unsigned char lookup_attribute_data_2[256];
304 static const unsigned char lookup_attribute_data_2_pure[256];
305 static const unsigned char lookup_digits[256];
306 static const unsigned char lookup_upcase[256];
311 inline std::size_t measure(
const Ch* p)
325 inline bool compare(
const Ch* p1, std::size_t size1,
const Ch* p2, std::size_t size2,
bool case_sensitive)
334 for (
const Ch* end = p1 + size1; p1 < end; ++p1, ++p2)
342 for (
const Ch* end = p1 + size1; p1 < end; ++p1, ++p2)
343 if (lookup_tables<0>::lookup_upcase[
static_cast<unsigned char>(*p1)] != lookup_tables<0>::lookup_upcase[
static_cast<unsigned char>(*p2)])
391 template<
class Ch =
char>
398 typedef void* (alloc_func)(std::size_t);
399 typedef void (free_func)(
void*);
404 : m_alloc_func(nullptr)
405 , m_free_func(nullptr)
429 const Ch* name =
nullptr,
const Ch*
value =
nullptr,
430 std::size_t name_size = 0, std::size_t value_size = 0)
439 node->name(name, name_size);
451 node->value(
value, value_size);
472 std::size_t name_size = 0, std::size_t value_size = 0)
481 attribute->name(name, name_size);
485 attribute->name(name);
493 attribute->value(
value, value_size);
497 attribute->value(
value);
517 size = internal::measure(
source) + 1;
520 Ch* result =
static_cast<Ch*
>(allocate_aligned(size *
sizeof(Ch)));
523 for (std::size_t i = 0; i < size; ++i)
545 result->remove_all_attributes();
546 result->remove_all_nodes();
547 result->type(
source->type());
559 for (
xml_node<Ch>* child =
source->first_node(); child; child = child->next_sibling())
566 result->append_attribute(
allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size()));
577 while (m_begin != m_static_memory)
579 char* previous_begin =
reinterpret_cast<header*
>(align(m_begin))->previous_begin;
583 m_free_func(m_begin);
590 m_begin = previous_begin;
611 assert(m_begin == m_static_memory && m_ptr == align(m_begin));
620 char* previous_begin;
625 m_begin = m_static_memory;
626 m_ptr = align(m_begin);
627 m_end = m_static_memory +
sizeof(m_static_memory);
630 char* align(
char* ptr)
633 return ptr + alignment;
636 char* allocate_raw(std::size_t size)
643 memory = m_alloc_func(size);
648 memory =
new char[size];
649 #ifdef RAPIDXML_NO_EXCEPTIONS
659 return static_cast<char*
>(memory);
662 void* allocate_aligned(std::size_t size)
665 char* result = align(m_ptr);
668 if (result + size > m_end)
673 if (pool_size < size)
680 char* raw_memory = allocate_raw(alloc_size);
683 char* pool = align(raw_memory);
684 header* new_header =
reinterpret_cast<header*
>(pool);
685 new_header->previous_begin = m_begin;
686 m_begin = raw_memory;
687 m_ptr = pool +
sizeof(header);
688 m_end = raw_memory + alloc_size;
691 result = align(m_ptr);
695 m_ptr = result + size;
703 alloc_func* m_alloc_func;
704 free_func* m_free_func;
713 template<
class Ch =
char>
798 this->
name(name, internal::measure(
name));
846 static Ch zero = Ch(
'\0');
863 template<
class Ch =
char>
889 while (node->parent())
891 node = node->parent();
913 name_size = internal::measure(name);
916 for (
xml_attribute<Ch>* attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute)
917 if (
internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
926 return this->m_parent ? m_prev_attribute : 0;
941 name_size = internal::measure(name);
944 for (
xml_attribute<Ch>* attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
945 if (
internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
954 return this->m_parent ? m_next_attribute :
nullptr;
976 template<
class Ch =
char>
977 class xml_node:
public xml_base<Ch>
990 , m_first_node(nullptr)
991 , m_first_attribute(nullptr)
1014 while (node->parent())
1016 node = node->parent();
1033 name_size = internal::measure(name);
1036 for (
xml_node<Ch>* child = m_first_node; child; child = child->next_sibling())
1037 if (
internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
1046 return m_first_node;
1059 assert(m_first_node);
1065 name_size = internal::measure(name);
1068 for (
xml_node<Ch>* child = m_last_node; child; child = child->previous_sibling())
1069 if (
internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
1091 assert(this->m_parent);
1097 name_size = internal::measure(name);
1100 for (
xml_node<Ch>* sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling)
1101 if (
internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
1110 return m_prev_sibling;
1123 assert(this->m_parent);
1129 name_size = internal::measure(name);
1132 for (
xml_node<Ch>* sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
1133 if (
internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
1142 return m_next_sibling;
1157 name_size = internal::measure(name);
1160 for (
xml_attribute<Ch>* attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
1161 if (
internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
1170 return m_first_attribute;
1185 name_size = internal::measure(name);
1188 for (
xml_attribute<Ch>* attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute)
1189 if (
internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
1198 return m_first_attribute ? m_last_attribute : 0;
1220 assert(child && !child->parent() && child->type() !=
node_document);
1224 child->m_next_sibling = m_first_node;
1225 m_first_node->m_prev_sibling = child;
1229 child->m_next_sibling = 0;
1230 m_last_node = child;
1233 m_first_node = child;
1234 child->m_parent =
this;
1235 child->m_prev_sibling = 0;
1243 assert(child && !child->parent() && child->type() !=
node_document);
1247 child->m_prev_sibling = m_last_node;
1248 m_last_node->m_next_sibling = child;
1252 child->m_prev_sibling =
nullptr;
1253 m_first_node = child;
1256 m_last_node = child;
1257 child->m_parent =
this;
1258 child->m_next_sibling =
nullptr;
1267 assert(!where || where->parent() ==
this);
1268 assert(child && !child->parent() && child->type() !=
node_document);
1270 if (where == m_first_node)
1274 else if (where == 0)
1280 child->m_prev_sibling = where->m_prev_sibling;
1281 child->m_next_sibling = where;
1282 where->m_prev_sibling->m_next_sibling = child;
1283 where->m_prev_sibling = child;
1284 child->m_parent =
this;
1295 m_first_node = child->m_next_sibling;
1297 if (child->m_next_sibling)
1299 child->m_next_sibling->m_prev_sibling = 0;
1306 child->m_parent = 0;
1317 if (child->m_prev_sibling)
1319 m_last_node = child->m_prev_sibling;
1320 child->m_prev_sibling->m_next_sibling = 0;
1327 child->m_parent = 0;
1334 assert(where && where->parent() ==
this);
1337 if (where == m_first_node)
1341 else if (where == m_last_node)
1347 where->m_prev_sibling->m_next_sibling = where->m_next_sibling;
1348 where->m_next_sibling->m_prev_sibling = where->m_prev_sibling;
1349 where->m_parent = 0;
1358 node->m_parent =
nullptr;
1361 m_first_node =
nullptr;
1368 assert(attribute && !attribute->parent());
1372 attribute->m_next_attribute = m_first_attribute;
1373 m_first_attribute->m_prev_attribute = attribute;
1377 attribute->m_next_attribute = 0;
1378 m_last_attribute = attribute;
1381 m_first_attribute = attribute;
1382 attribute->m_parent =
this;
1383 attribute->m_prev_attribute = 0;
1390 assert(attribute && !attribute->parent());
1394 attribute->m_prev_attribute = m_last_attribute;
1395 m_last_attribute->m_next_attribute = attribute;
1399 attribute->m_prev_attribute =
nullptr;
1400 m_first_attribute = attribute;
1403 m_last_attribute = attribute;
1404 attribute->m_parent =
this;
1405 attribute->m_next_attribute =
nullptr;
1414 assert(!where || where->parent() ==
this);
1415 assert(attribute && !attribute->parent());
1417 if (where == m_first_attribute)
1421 else if (where == 0)
1427 attribute->m_prev_attribute = where->m_prev_attribute;
1428 attribute->m_next_attribute = where;
1429 where->m_prev_attribute->m_next_attribute = attribute;
1430 where->m_prev_attribute = attribute;
1431 attribute->m_parent =
this;
1443 if (attribute->m_next_attribute)
1445 attribute->m_next_attribute->m_prev_attribute = 0;
1449 m_last_attribute = 0;
1452 attribute->m_parent = 0;
1453 m_first_attribute = attribute->m_next_attribute;
1464 if (attribute->m_prev_attribute)
1466 attribute->m_prev_attribute->m_next_attribute = 0;
1467 m_last_attribute = attribute->m_prev_attribute;
1471 m_first_attribute = 0;
1474 attribute->m_parent = 0;
1483 if (where == m_first_attribute)
1487 else if (where == m_last_attribute)
1493 where->m_prev_attribute->m_next_attribute = where->m_next_attribute;
1494 where->m_next_attribute->m_prev_attribute = where->m_prev_attribute;
1495 where->m_parent = 0;
1504 attribute->m_parent =
nullptr;
1507 m_first_attribute =
nullptr;
1551 template<
class Ch =
char>
1552 class xml_document:
public xml_node<Ch>,
public memory_pool<Ch>
1580 this->remove_all_nodes();
1581 this->remove_all_attributes();
1584 parse_bom<Flags>(text);
1590 skip<whitespace_pred, Flags>(text);
1598 if (*text == Ch(
'<'))
1604 this->append_node(node);
1619 this->remove_all_nodes();
1620 this->remove_all_attributes();
1630 struct whitespace_pred
1632 static unsigned char test(Ch ch)
1634 return internal::lookup_tables<0>::lookup_whitespace[
static_cast<unsigned char>(ch)];
1639 struct node_name_pred
1641 static unsigned char test(Ch ch)
1643 return internal::lookup_tables<0>::lookup_node_name[
static_cast<unsigned char>(ch)];
1648 struct attribute_name_pred
1650 static unsigned char test(Ch ch)
1652 return internal::lookup_tables<0>::lookup_attribute_name[
static_cast<unsigned char>(ch)];
1659 static unsigned char test(Ch ch)
1661 return internal::lookup_tables<0>::lookup_text[
static_cast<unsigned char>(ch)];
1666 struct text_pure_no_ws_pred
1668 static unsigned char test(Ch ch)
1670 return internal::lookup_tables<0>::lookup_text_pure_no_ws[
static_cast<unsigned char>(ch)];
1675 struct text_pure_with_ws_pred
1677 static unsigned char test(Ch ch)
1679 return internal::lookup_tables<0>::lookup_text_pure_with_ws[
static_cast<unsigned char>(ch)];
1685 struct attribute_value_pred
1687 static unsigned char test(Ch ch)
1689 if (Quote == Ch(
'\''))
1691 return internal::lookup_tables<0>::lookup_attribute_data_1[
static_cast<unsigned char>(ch)];
1694 if (Quote == Ch(
'\"'))
1696 return internal::lookup_tables<0>::lookup_attribute_data_2[
static_cast<unsigned char>(ch)];
1705 struct attribute_value_pure_pred
1707 static unsigned char test(Ch ch)
1709 if (Quote == Ch(
'\''))
1711 return internal::lookup_tables<0>::lookup_attribute_data_1_pure[
static_cast<unsigned char>(ch)];
1714 if (Quote == Ch(
'\"'))
1716 return internal::lookup_tables<0>::lookup_attribute_data_2_pure[
static_cast<unsigned char>(ch)];
1725 static void insert_coded_character(Ch*& text,
unsigned long code)
1731 text[0] =
static_cast<unsigned char>(code);
1739 text[0] =
static_cast<unsigned char>(code);
1742 else if (code < 0x800)
1744 text[1] =
static_cast<unsigned char>((code | 0x80) & 0xBF);
1746 text[0] =
static_cast<unsigned char>(code | 0xC0);
1749 else if (code < 0x10000)
1751 text[2] =
static_cast<unsigned char>((code | 0x80) & 0xBF);
1753 text[1] =
static_cast<unsigned char>((code | 0x80) & 0xBF);
1755 text[0] =
static_cast<unsigned char>(code | 0xE0);
1758 else if (code < 0x110000)
1760 text[3] =
static_cast<unsigned char>((code | 0x80) & 0xBF);
1762 text[2] =
static_cast<unsigned char>((code | 0x80) & 0xBF);
1764 text[1] =
static_cast<unsigned char>((code | 0x80) & 0xBF);
1766 text[0] =
static_cast<unsigned char>(code | 0xF0);
1777 template<
class StopPred,
int Flags>
1778 static void skip(Ch*& text)
1782 while (StopPred::test(*tmp))
1793 template<
class StopPred,
class StopPredPure,
int Flags>
1794 static Ch* skip_and_expand_character_refs(Ch*& text)
1801 skip<StopPred, Flags>(text);
1806 skip<StopPredPure, Flags>(text);
1812 while (StopPred::test(*src))
1818 if (src[0] == Ch(
'&'))
1825 if (src[2] == Ch(
'm') && src[3] == Ch(
'p') && src[4] == Ch(
';'))
1833 if (src[2] == Ch(
'p') && src[3] == Ch(
'o') && src[4] == Ch(
's') && src[5] == Ch(
';'))
1845 if (src[2] == Ch(
'u') && src[3] == Ch(
'o') && src[4] == Ch(
't') && src[5] == Ch(
';'))
1857 if (src[2] == Ch(
't') && src[3] == Ch(
';'))
1869 if (src[2] == Ch(
't') && src[3] == Ch(
';'))
1881 if (src[2] == Ch(
'x'))
1883 unsigned long code = 0;
1888 unsigned char digit = internal::lookup_tables<0>::lookup_digits[
static_cast<unsigned char>(*src)];
1895 code = code * 16 + digit;
1899 insert_coded_character<Flags>(dest, code);
1903 unsigned long code = 0;
1908 unsigned char digit = internal::lookup_tables<0>::lookup_digits[
static_cast<unsigned char>(*src)];
1915 code = code * 10 + digit;
1919 insert_coded_character<Flags>(dest, code);
1922 if (*src == Ch(
';'))
1946 if (whitespace_pred::test(*src))
1953 while (whitespace_pred::test(*src))
1978 void parse_bom(Ch*& text)
1981 if (
static_cast<unsigned char>(text[0]) == 0xEF &&
1982 static_cast<unsigned char>(text[1]) == 0xBB &&
1983 static_cast<unsigned char>(text[2]) == 0xBF)
1991 xml_node<Ch>* parse_xml_declaration(Ch*& text)
1997 while (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2015 skip<whitespace_pred, Flags>(text);
2018 parse_node_attributes<Flags>(text, declaration);
2021 if (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2033 xml_node<Ch>* parse_comment(Ch*& text)
2039 while (text[0] != Ch(
'-') || text[1] != Ch(
'-') || text[2] != Ch(
'>'))
2057 while (text[0] != Ch(
'-') || text[1] != Ch(
'-') || text[2] != Ch(
'>'))
2068 xml_node<Ch>* comment = this->allocate_node(
node_comment);
2083 xml_node<Ch>* parse_doctype(Ch*& text)
2089 while (*text != Ch(
'>'))
2139 xml_node<Ch>* doctype = this->allocate_node(
node_doctype);
2161 xml_node<Ch>* parse_pi(Ch*& text)
2167 xml_node<Ch>*
pi = this->allocate_node(
node_pi);
2171 skip<node_name_pred, Flags>(text);
2178 pi->name(name, text - name);
2181 skip<whitespace_pred, Flags>(text);
2187 while (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2189 if (*text == Ch(
'\0'))
2203 pi->name()[
pi->name_size()] = Ch(
'\0');
2204 pi->value()[
pi->value_size()] = Ch(
'\0');
2213 while (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2215 if (*text == Ch(
'\0'))
2232 Ch parse_and_append_data(xml_node<Ch>* node, Ch*& text, Ch* contents_start)
2237 text = contents_start;
2241 Ch*
value = text, *end;
2245 end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);
2249 end = skip_and_expand_character_refs<text_pred, text_pure_no_ws_pred, Flags>(text);
2258 if (*(end - 1) == Ch(
' '))
2266 while (whitespace_pred::test(*(end - 1)))
2279 node->append_node(
data);
2284 if (*node->value() == Ch(
'\0'))
2303 xml_node<Ch>* parse_cdata(Ch*& text)
2309 while (text[0] != Ch(
']') || text[1] != Ch(
']') || text[2] != Ch(
'>'))
2326 while (text[0] != Ch(
']') || text[1] != Ch(
']') || text[2] != Ch(
'>'))
2337 xml_node<Ch>* cdata = this->allocate_node(
node_cdata);
2352 xml_node<Ch>* parse_element(Ch*& text)
2355 xml_node<Ch>* element = this->allocate_node(
node_element);
2359 skip<node_name_pred, Flags>(text);
2366 element->name(name, text - name);
2369 skip<whitespace_pred, Flags>(text);
2372 parse_node_attributes<Flags>(text, element);
2375 if (*text == Ch(
'>'))
2378 parse_node_contents<Flags>(text, element);
2380 else if (*text == Ch(
'/'))
2384 if (*text != Ch(
'>'))
2399 element->name()[element->name_size()] = Ch(
'\0');
2408 xml_node<Ch>* parse_node(Ch*& text)
2417 return parse_element<Flags>(text);
2423 if ((text[0] == Ch(
'x') || text[0] == Ch(
'X')) &&
2424 (text[1] == Ch(
'm') || text[1] == Ch(
'M')) &&
2425 (text[2] == Ch(
'l') || text[2] == Ch(
'L')) &&
2426 whitespace_pred::test(text[3]))
2430 return parse_xml_declaration<Flags>(text);
2435 return parse_pi<Flags>(text);
2447 if (text[2] == Ch(
'-'))
2451 return parse_comment<Flags>(text);
2458 if (text[2] == Ch(
'C') && text[3] == Ch(
'D') && text[4] == Ch(
'A') &&
2459 text[5] == Ch(
'T') && text[6] == Ch(
'A') && text[7] == Ch(
'['))
2463 return parse_cdata<Flags>(text);
2470 if (text[2] == Ch(
'O') && text[3] == Ch(
'C') && text[4] == Ch(
'T') &&
2471 text[5] == Ch(
'Y') && text[6] == Ch(
'P') && text[7] == Ch(
'E') &&
2472 whitespace_pred::test(text[8]))
2476 return parse_doctype<Flags>(text);
2484 while (*text != Ch(
'>'))
2502 void parse_node_contents(Ch*& text, xml_node<Ch>* node)
2508 Ch* contents_start = text;
2509 skip<whitespace_pred, Flags>(text);
2510 Ch next_char = *text;
2524 if (text[1] == Ch(
'/'))
2532 Ch* closing_name = text;
2533 skip<node_name_pred, Flags>(text);
2535 if (!
internal::compare(node->name(), node->name_size(), closing_name, text - closing_name,
true))
2543 skip<node_name_pred, Flags>(text);
2547 skip<whitespace_pred, Flags>(text);
2549 if (*text != Ch(
'>'))
2562 if (xml_node<Ch>* child = parse_node<Flags>(text))
2564 node->append_node(child);
2576 next_char = parse_and_append_data<Flags>(node, text, contents_start);
2577 goto after_data_node;
2585 void parse_node_attributes(Ch*& text, xml_node<Ch>* node)
2588 while (attribute_name_pred::test(*text))
2593 skip<attribute_name_pred, Flags>(text);
2601 xml_attribute<Ch>* attribute = this->allocate_attribute();
2602 attribute->name(name, text - name);
2603 node->append_attribute(attribute);
2606 skip<whitespace_pred, Flags>(text);
2609 if (*text != Ch(
'='))
2619 attribute->name()[attribute->name_size()] = 0;
2623 skip<whitespace_pred, Flags>(text);
2628 if (quote != Ch(
'\'') && quote != Ch(
'"'))
2636 Ch*
value = text, *end;
2639 if (quote == Ch(
'\''))
2641 end = skip_and_expand_character_refs < attribute_value_pred < Ch(
'\'') >, attribute_value_pure_pred < Ch(
'\'') >, AttFlags > (text);
2645 end = skip_and_expand_character_refs < attribute_value_pred < Ch(
'"') >, attribute_value_pure_pred < Ch(
'"') >, AttFlags > (text);
2662 attribute->value()[attribute->value_size()] = 0;
2666 skip<whitespace_pred, Flags>(text);
2678 const unsigned char lookup_tables<Dummy>::lookup_whitespace[256] =
2681 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
2682 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2683 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2684 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2685 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2686 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2687 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2688 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2689 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2690 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2691 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2692 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2693 0, 0, 0, 0, 0, 0, 0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 1, 1
2724 const unsigned char lookup_tables<Dummy>::lookup_text[256] =
2727 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2728 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2729 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2730 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
2731 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2732 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2733 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2734 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2735 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2736 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2737 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2738 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2739 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2740 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2741 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2742 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2748 const unsigned char lookup_tables<Dummy>::lookup_text_pure_no_ws[256] =
2751 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2752 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2753 1, 1, 1, 1, 1, 1, 0, 1, 1,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 1
2864 const unsigned char lookup_tables<Dummy>::lookup_attribute_data_2[256] =
2867 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2868 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2869 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2870 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2871 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2872 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2873 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2874 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2875 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2876 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2877 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2878 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2879 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2880 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2881 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2882 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2887 const unsigned char lookup_tables<Dummy>::lookup_attribute_data_2_pure[256] =
2890 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2891 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2892 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2893 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2894 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2895 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2896 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2897 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2898 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2899 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2900 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2901 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2902 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2903 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2904 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2905 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2910 const unsigned char lookup_tables<Dummy>::lookup_digits[256] =
2913 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2914 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2915 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2916 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
2917 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2918 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2919 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2920 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2921 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2922 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2923 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2924 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2925 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2926 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2927 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2928 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
2933 const unsigned char lookup_tables<Dummy>::lookup_upcase[256] =
2936 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2937 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
2938 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
2939 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
2940 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2941 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2942 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2943 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127,
2944 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
2945 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
2946 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
2947 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
2948 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
2949 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
2950 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
2951 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
2959 #undef RAPIDXML_PARSE_ERROR
2963 #pragma warning(pop)