1 #ifndef RAPIDXML_HPP_INCLUDED
2 #define RAPIDXML_HPP_INCLUDED
10 #if !defined(RAPIDXML_NO_STDLIB)
20 #pragma warning(disable:4127) // Conditional expression is constant
26 #if defined(RAPIDXML_NO_EXCEPTIONS)
28 #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); }
29 #define RAPIDXML_EOF_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)
57 #define RAPIDXML_EOF_ERROR(what, where) throw eof_error(what, where)
80 : std::runtime_error(what)
91 return reinterpret_cast<Ch *
>(m_where);
106 : std::runtime_error(what) {}
115 #ifndef RAPIDXML_STATIC_POOL_SIZE
119 #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024)
122 #ifndef RAPIDXML_DYNAMIC_POOL_SIZE
126 #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024)
129 #ifndef RAPIDXML_ALIGNMENT
134 #define RAPIDXML_ALIGNMENT sizeof(void *)
311 static const unsigned char lookup_whitespace[256];
312 static const unsigned char lookup_node_name[256];
313 static const unsigned char lookup_element_name[256];
314 static const unsigned char lookup_text[256];
315 static const unsigned char lookup_text_pure_no_ws[256];
316 static const unsigned char lookup_text_pure_with_ws[256];
317 static const unsigned char lookup_attribute_name[256];
318 static const unsigned char lookup_attribute_data_1[256];
319 static const unsigned char lookup_attribute_data_1_pure[256];
320 static const unsigned char lookup_attribute_data_2[256];
321 static const unsigned char lookup_attribute_data_2_pure[256];
322 static const unsigned char lookup_digits[256];
323 static const unsigned char lookup_upcase[256];
328 inline std::size_t measure(
const Ch *p)
338 inline bool compare(
const Ch *p1, std::size_t size1,
const Ch *p2, std::size_t size2,
bool case_sensitive)
344 for (
const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
350 for (
const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
351 if (lookup_tables<0>::lookup_upcase[
static_cast<unsigned char>(*p1)] != lookup_tables<0>::lookup_upcase[
static_cast<unsigned char>(*p2)])
396 template<
class Ch =
char>
403 typedef void *(alloc_func)(std::size_t);
404 typedef void (free_func)(
void *);
434 const Ch *name = 0,
const Ch *
value = 0,
435 std::size_t name_size = 0, std::size_t value_size = 0)
442 node->name(name, name_size);
448 node->name(this->
nullstr(), 0);
453 node->value(
value, value_size);
459 node->value(this->
nullstr(), 0);
474 std::size_t name_size = 0, std::size_t value_size = 0)
481 attribute->name(name, name_size);
483 attribute->name(name);
488 attribute->value(
value, value_size);
490 attribute->value(
value);
502 template<
typename Sch>
507 size = internal::measure(
source) + 1;
508 Ch *result =
static_cast<Ch *
>(allocate_aligned(size *
sizeof(Ch)));
510 for (std::size_t i = 0; i < size; ++i)
525 xmlns_size = internal::measure(m_xmlns_xml);
532 xmlns_size = internal::measure(m_xmlns_xmlns);
533 return m_xmlns_xmlns;
551 result->remove_all_attributes();
552 result->remove_all_nodes();
553 result->type(
source->type());
563 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()));
576 while (m_begin != m_static_memory)
578 char *previous_begin =
reinterpret_cast<header *
>(align(m_begin))->previous_begin;
580 m_free_func(m_begin);
583 m_begin = previous_begin;
603 assert(m_begin == m_static_memory && m_ptr == align(m_begin));
612 char *previous_begin;
617 m_begin = m_static_memory;
618 m_ptr = align(m_begin);
619 m_end = m_static_memory +
sizeof(m_static_memory);
625 char *align(
char *ptr)
628 return ptr + alignment;
631 char *allocate_raw(std::size_t size)
637 memory = m_alloc_func(size);
642 memory =
new char[size];
643 #ifdef RAPIDXML_NO_EXCEPTIONS
648 return static_cast<char *
>(memory);
651 void *allocate_aligned(std::size_t size)
654 char *result = align(m_ptr);
657 if (result + size > m_end)
661 if (pool_size < size)
666 char *raw_memory = allocate_raw(alloc_size);
669 char *pool = align(raw_memory);
670 header *new_header =
reinterpret_cast<header *
>(pool);
671 new_header->previous_begin = m_begin;
672 m_begin = raw_memory;
673 m_ptr = pool +
sizeof(header);
674 m_end = raw_memory + alloc_size;
677 result = align(m_ptr);
681 m_ptr = result + size;
689 alloc_func *m_alloc_func;
690 free_func *m_free_func;
702 template<
class Ch =
char>
786 this->
name(name, internal::measure(
name));
842 template<
class Ch =
char>
868 while (node->parent())
869 node = node->parent();
878 if (m_xmlns)
return m_xmlns;
880 Ch * name = this->name();
881 for (p = name; *p && *p !=
':'; ++p)
882 if ((p - name) >= this->name_size())
break;
883 if (!*p || ((p - name) >= this->name_size())) {
889 if (element) element->
xmlns_lookup(m_xmlns, m_xmlns_size, name, p - name);
894 return this->
xmlns() ? m_xmlns_size : 0;
906 name_size = internal::measure(name);
907 for (
xml_attribute<Ch> *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute)
908 if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
913 return this->m_parent ? m_prev_attribute : 0;
926 name_size = internal::measure(name);
927 for (
xml_attribute<Ch> *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
928 if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
933 return this->m_parent ? m_next_attribute : 0;
938 if (m_local_name)
return m_local_name;
939 Ch * p = this->name();
940 for (; *p && *p != Ch(
':'); ++p);
942 m_local_name = p + 1;
944 m_local_name = this->name();
950 return this->name_size() - (this->
local_name() - this->name());
957 mutable Ch * m_xmlns;
958 mutable std::size_t m_xmlns_size;
959 mutable Ch * m_local_name;
973 template<
class Ch =
char>
974 class xml_node:
public xml_base<Ch>
990 , m_first_attribute(0)
1006 m_prefix =
const_cast<Ch *
>(
prefix);
1007 m_prefix_size = size;
1021 return m_prefix ? m_prefix_size : 0;
1026 if (m_xmlns)
return m_xmlns;
1027 xmlns_lookup(m_xmlns, m_xmlns_size, m_prefix, m_prefix_size);
1040 &&
prefix[2] == Ch(
'l')) {
1046 &&
prefix[4] == Ch(
's')) {
1052 const char * p1=
"xmlns";
1053 while (*p1) *attrname++ = *p1++;
1055 *attrname++ = Ch(
':');
1063 freeme = attrname =
new Ch[6];
1064 const char * p1=
"xmlns";
1065 while (*p1) *attrname++ = *p1++;
1071 node = node->parent()) {
1074 xmlns = attr->value();
1087 if (freeme)
delete[] freeme;
1092 if (m_xmlns)
return m_xmlns_size;
1094 return m_xmlns_size;
1105 while (node->parent())
1106 node = node->parent();
1117 if (name && !name_size) name_size = internal::measure(name);
1119 if (!
xmlns && name) {
1125 for (
xml_node<Ch> *child = m_first_node; child; child = child->next_sibling())
1126 if ((!name || internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
1127 && (!
xmlns || internal::compare(child->xmlns(), child->xmlns_size(),
xmlns,
xmlns_size, case_sensitive)))
1141 assert(m_first_node);
1142 if (name && !name_size) name_size = internal::measure(name);
1144 if (!
xmlns && name) {
1150 for (
xml_node<Ch> *child = m_last_node; child; child = child->previous_sibling())
1151 if ((!name || internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
1152 && (!
xmlns || internal::compare(child->xmlns(), child->xmlns_size(),
xmlns,
xmlns_size, case_sensitive)))
1166 assert(this->m_parent);
1170 name_size = internal::measure(name);
1171 for (
xml_node<Ch> *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling)
1172 if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
1177 return m_prev_sibling;
1189 assert(this->m_parent);
1193 name_size = internal::measure(name);
1194 for (
xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
1195 if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
1200 return m_next_sibling;
1213 name_size = internal::measure(name);
1214 for (
xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
1215 if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
1220 return m_first_attribute;
1233 name_size = internal::measure(name);
1234 for (
xml_attribute<Ch> *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute)
1235 if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
1240 return m_first_attribute ? m_last_attribute : 0;
1261 assert(child && !child->parent() && child->type() !=
node_document);
1264 child->m_next_sibling = m_first_node;
1265 m_first_node->m_prev_sibling = child;
1269 child->m_next_sibling = 0;
1270 m_last_node = child;
1272 m_first_node = child;
1273 child->m_parent =
this;
1274 child->m_prev_sibling = 0;
1282 assert(child && !child->parent() && child->type() !=
node_document);
1285 child->m_prev_sibling = m_last_node;
1286 m_last_node->m_next_sibling = child;
1290 child->m_prev_sibling = 0;
1291 m_first_node = child;
1293 m_last_node = child;
1294 child->m_parent =
this;
1295 child->m_next_sibling = 0;
1304 assert(!where || where->parent() ==
this);
1305 assert(child && !child->parent() && child->type() !=
node_document);
1306 if (where == m_first_node)
1308 else if (where == 0)
1312 child->m_prev_sibling = where->m_prev_sibling;
1313 child->m_next_sibling = where;
1314 where->m_prev_sibling->m_next_sibling = child;
1315 where->m_prev_sibling = child;
1316 child->m_parent =
this;
1327 m_first_node = child->m_next_sibling;
1328 if (child->m_next_sibling)
1329 child->m_next_sibling->m_prev_sibling = 0;
1332 child->m_parent = 0;
1342 if (child->m_prev_sibling)
1344 m_last_node = child->m_prev_sibling;
1345 child->m_prev_sibling->m_next_sibling = 0;
1349 child->m_parent = 0;
1356 assert(where && where->parent() ==
this);
1358 if (where == m_first_node)
1360 else if (where == m_last_node)
1364 where->m_prev_sibling->m_next_sibling = where->m_next_sibling;
1365 where->m_next_sibling->m_prev_sibling = where->m_prev_sibling;
1366 where->m_parent = 0;
1382 assert(attribute && !attribute->parent());
1385 attribute->m_next_attribute = m_first_attribute;
1386 m_first_attribute->m_prev_attribute = attribute;
1390 attribute->m_next_attribute = 0;
1391 m_last_attribute = attribute;
1393 m_first_attribute = attribute;
1394 attribute->m_parent =
this;
1395 attribute->m_prev_attribute = 0;
1402 assert(attribute && !attribute->parent());
1405 attribute->m_prev_attribute = m_last_attribute;
1406 m_last_attribute->m_next_attribute = attribute;
1410 attribute->m_prev_attribute = 0;
1411 m_first_attribute = attribute;
1413 m_last_attribute = attribute;
1414 attribute->m_parent =
this;
1415 attribute->m_next_attribute = 0;
1424 assert(!where || where->parent() ==
this);
1425 assert(attribute && !attribute->parent());
1426 if (where == m_first_attribute)
1428 else if (where == 0)
1432 attribute->m_prev_attribute = where->m_prev_attribute;
1433 attribute->m_next_attribute = where;
1434 where->m_prev_attribute->m_next_attribute = attribute;
1435 where->m_prev_attribute = attribute;
1436 attribute->m_parent =
this;
1447 if (attribute->m_next_attribute)
1449 attribute->m_next_attribute->m_prev_attribute = 0;
1452 m_last_attribute = 0;
1453 attribute->m_parent = 0;
1454 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;
1470 m_first_attribute = 0;
1471 attribute->m_parent = 0;
1479 if (where == m_first_attribute)
1481 else if (where == m_last_attribute)
1485 where->m_prev_attribute->m_next_attribute = where->m_next_attribute;
1486 where->m_next_attribute->m_prev_attribute = where->m_prev_attribute;
1487 where->m_parent = 0;
1495 attribute->m_parent = 0;
1496 m_first_attribute = 0;
1501 if (this->
xmlns() == 0)
1505 child = child->next_sibling()) {
1510 attribute = attribute->m_next_attribute) {
1511 if (attribute->xmlns() == 0)
1514 otherattr != attribute;
1515 otherattr = otherattr->m_next_attribute) {
1516 if (internal::compare(attribute->name(), attribute->name_size(), otherattr->name(), otherattr->name_size(),
true)) {
1519 if (internal::compare(attribute->local_name(), attribute->local_name_size(), otherattr->local_name(), otherattr->local_name_size(),
true)
1520 && internal::compare(attribute->xmlns(), attribute->xmlns_size(), otherattr->xmlns(), otherattr->xmlns_size(),
true))
1548 mutable Ch *m_xmlns;
1549 std::size_t m_prefix_size;
1550 mutable std::size_t m_xmlns_size;
1571 template<
class Ch =
char>
1572 class xml_document:
public xml_node<Ch>,
public memory_pool<Ch>
1600 this->remove_all_nodes();
1601 this->remove_all_attributes();
1602 this->m_parent = parent ? parent->first_node() : 0;
1605 parse_bom<Flags>(text);
1611 skip<whitespace_pred, Flags>(text);
1616 if (*text == Ch(
'<'))
1620 this->append_node(node);
1635 return parse<Flags>(text, &parent);
1642 this->remove_all_nodes();
1643 this->remove_all_attributes();
1656 element->name()[element->name_size()] = 0;
1659 attr = attr->next_attribute()) {
1661 attr->name()[attr->name_size()] = 0;
1662 Ch *
value = attr->value();
1666 Ch quote =
value[-1];
1667 if (quote == Ch(
'\''))
1668 end = skip_and_expand_character_refs<attribute_value_pred<Ch(
'\'')>, attribute_value_pure_pred<Ch(
'\'')>, AttFlags>(p);
1670 end = skip_and_expand_character_refs<attribute_value_pred<Ch(
'"')>, attribute_value_pure_pred<Ch(
'"')>, AttFlags>(p);
1673 attr->value()[attr->value_size()] = 0;
1678 child = child->next_sibling()) {
1679 this->fixup<Flags>(child,
true);
1682 element->value()[element->value_size()] = 0;
1703 struct whitespace_pred
1705 static unsigned char test(Ch ch)
1707 return internal::lookup_tables<0>::lookup_whitespace[
static_cast<unsigned char>(ch)];
1712 struct node_name_pred
1714 static unsigned char test(Ch ch)
1716 return internal::lookup_tables<0>::lookup_node_name[
static_cast<unsigned char>(ch)];
1721 struct element_name_pred
1723 static unsigned char test(Ch ch)
1725 return internal::lookup_tables<0>::lookup_element_name[
static_cast<unsigned char>(ch)];
1730 struct attribute_name_pred
1732 static unsigned char test(Ch ch)
1734 return internal::lookup_tables<0>::lookup_attribute_name[
static_cast<unsigned char>(ch)];
1741 static unsigned char test(Ch ch)
1743 return internal::lookup_tables<0>::lookup_text[
static_cast<unsigned char>(ch)];
1748 struct text_pure_no_ws_pred
1750 static unsigned char test(Ch ch)
1752 return internal::lookup_tables<0>::lookup_text_pure_no_ws[
static_cast<unsigned char>(ch)];
1757 struct text_pure_with_ws_pred
1759 static unsigned char test(Ch ch)
1761 return internal::lookup_tables<0>::lookup_text_pure_with_ws[
static_cast<unsigned char>(ch)];
1767 struct attribute_value_pred
1769 static unsigned char test(Ch ch)
1771 if (Quote == Ch(
'\''))
1772 return internal::lookup_tables<0>::lookup_attribute_data_1[
static_cast<unsigned char>(ch)];
1773 if (Quote == Ch(
'\"'))
1774 return internal::lookup_tables<0>::lookup_attribute_data_2[
static_cast<unsigned char>(ch)];
1781 struct attribute_value_pure_pred
1783 static unsigned char test(Ch ch)
1785 if (Quote == Ch(
'\''))
1786 return internal::lookup_tables<0>::lookup_attribute_data_1_pure[
static_cast<unsigned char>(ch)];
1787 if (Quote == Ch(
'\"'))
1788 return internal::lookup_tables<0>::lookup_attribute_data_2_pure[
static_cast<unsigned char>(ch)];
1795 static void insert_coded_character(Ch *&text,
unsigned long code)
1801 text[0] =
static_cast<unsigned char>(code);
1809 text[0] =
static_cast<unsigned char>(code);
1812 else if (code < 0x800)
1814 text[1] =
static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
1815 text[0] =
static_cast<unsigned char>(code | 0xC0);
1818 else if (code < 0x10000)
1820 text[2] =
static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
1821 text[1] =
static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
1822 text[0] =
static_cast<unsigned char>(code | 0xE0);
1825 else if (code < 0x110000)
1827 text[3] =
static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
1828 text[2] =
static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
1829 text[1] =
static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
1830 text[0] =
static_cast<unsigned char>(code | 0xF0);
1841 template<
class StopPred,
int Flags>
1842 static void skip(Ch *&text)
1845 while (StopPred::test(*tmp))
1853 template<
class StopPred,
class StopPredPure,
int Flags>
1854 static Ch *skip_and_expand_character_refs(Ch *&text)
1861 skip<StopPred, Flags>(text);
1866 skip<StopPredPure, Flags>(text);
1871 while (StopPred::test(*src))
1877 if (src[0] == Ch(
'&'))
1884 if (src[2] == Ch(
'm') && src[3] == Ch(
'p') && src[4] == Ch(
';'))
1891 if (src[2] == Ch(
'p') && src[3] == Ch(
'o') && src[4] == Ch(
's') && src[5] == Ch(
';'))
1902 if (src[2] == Ch(
'u') && src[3] == Ch(
'o') && src[4] == Ch(
't') && src[5] == Ch(
';'))
1913 if (src[2] == Ch(
't') && src[3] == Ch(
';'))
1924 if (src[2] == Ch(
't') && src[3] == Ch(
';'))
1935 if (src[2] == Ch(
'x'))
1937 unsigned long code = 0;
1941 unsigned char digit = internal::lookup_tables<0>::lookup_digits[
static_cast<unsigned char>(*src)];
1944 code = code * 16 + digit;
1947 insert_coded_character<Flags>(dest, code);
1951 unsigned long code = 0;
1955 unsigned char digit = internal::lookup_tables<0>::lookup_digits[
static_cast<unsigned char>(*src)];
1958 code = code * 10 + digit;
1961 insert_coded_character<Flags>(dest, code);
1963 if (*src == Ch(
';'))
1982 if (whitespace_pred::test(*src))
1984 *dest = Ch(
' '); ++dest;
1987 while (whitespace_pred::test(*src))
2009 void parse_bom(Ch *&text)
2012 if (
static_cast<unsigned char>(text[0]) == 0xEF &&
2013 static_cast<unsigned char>(text[1]) == 0xBB &&
2014 static_cast<unsigned char>(text[2]) == 0xBF)
2022 xml_node<Ch> *parse_xml_declaration(Ch *&text)
2028 while (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2042 skip<whitespace_pred, Flags>(text);
2045 parse_node_attributes<Flags>(text, declaration);
2048 if (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2057 xml_node<Ch> *parse_comment(Ch *&text)
2063 while (text[0] != Ch(
'-') || text[1] != Ch(
'-') || text[2] != Ch(
'>'))
2077 while (text[0] != Ch(
'-') || text[1] != Ch(
'-') || text[2] != Ch(
'>'))
2085 xml_node<Ch> *comment = this->allocate_node(
node_comment);
2098 xml_node<Ch> *parse_doctype(Ch *&text)
2104 while (*text != Ch(
'>'))
2120 case Ch(
'['): ++depth;
break;
2121 case Ch(
']'): --depth;
break;
2144 xml_node<Ch> *doctype = this->allocate_node(
node_doctype);
2164 xml_node<Ch> *parse_pi(Ch *&text)
2170 xml_node<Ch> *pi = this->allocate_node(
node_pi);
2174 skip<node_name_pred, Flags>(text);
2177 pi->name(name, text - name);
2180 skip<whitespace_pred, Flags>(text);
2186 while (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2188 if (*text == Ch(
'\0'))
2199 pi->name()[pi->name_size()] = Ch(
'\0');
2200 pi->value()[pi->value_size()] = Ch(
'\0');
2209 while (text[0] != Ch(
'?') || text[1] != Ch(
'>'))
2211 if (*text == Ch(
'\0'))
2224 Ch parse_and_append_data(xml_node<Ch> *node, Ch *&text, Ch *contents_start)
2228 text = contents_start;
2231 Ch *
value = text, *end;
2233 end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);
2235 end = skip_and_expand_character_refs<text_pred, text_pure_no_ws_pred, Flags>(text);
2243 if (*(end - 1) == Ch(
' '))
2249 while (whitespace_pred::test(*(end - 1)))
2258 xml_node<Ch> *data = this->allocate_node(
node_data);
2260 node->append_node(data);
2265 if (*node->value() == Ch(
'\0'))
2282 xml_node<Ch> *parse_cdata(Ch *&text)
2288 while (text[0] != Ch(
']') || text[1] != Ch(
']') || text[2] != Ch(
'>'))
2300 while (text[0] != Ch(
']') || text[1] != Ch(
']') || text[2] != Ch(
'>'))
2308 xml_node<Ch> *cdata = this->allocate_node(
node_cdata);
2321 xml_node<Ch> *parse_element(Ch *&text)
2324 xml_node<Ch> *element = this->allocate_node(
node_element);
2328 skip<element_name_pred, Flags>(text);
2331 if (*text == Ch(
':')) {
2332 element->prefix(prefix, text - prefix);
2335 skip<node_name_pred, Flags>(text);
2338 element->name(name, text - name);
2340 element->name(prefix, text - prefix);
2344 skip<whitespace_pred, Flags>(text);
2347 parse_node_attributes<Flags>(text, element);
2350 if (*text == Ch(
'>'))
2354 parse_node_contents<Flags>(text, element);
2356 else if (*text == Ch(
'/'))
2359 if (*text != Ch(
'>'))
2370 element->name()[element->name_size()] = Ch(
'\0');
2371 if (element->prefix()) element->prefix()[element->prefix_size()] = Ch(
'\0');
2380 xml_node<Ch> *parse_node(Ch *&text)
2389 return parse_element<Flags>(text);
2394 if ((text[0] == Ch(
'x') || text[0] == Ch(
'X')) &&
2395 (text[1] == Ch(
'm') || text[1] == Ch(
'M')) &&
2396 (text[2] == Ch(
'l') || text[2] == Ch(
'L')) &&
2397 whitespace_pred::test(text[3]))
2401 return parse_xml_declaration<Flags>(text);
2406 return parse_pi<Flags>(text);
2418 if (text[2] == Ch(
'-'))
2422 return parse_comment<Flags>(text);
2428 if (text[2] == Ch(
'C') && text[3] == Ch(
'D') && text[4] == Ch(
'A') &&
2429 text[5] == Ch(
'T') && text[6] == Ch(
'A') && text[7] == Ch(
'['))
2433 return parse_cdata<Flags>(text);
2439 if (text[2] == Ch(
'O') && text[3] == Ch(
'C') && text[4] == Ch(
'T') &&
2440 text[5] == Ch(
'Y') && text[6] == Ch(
'P') && text[7] == Ch(
'E') &&
2441 whitespace_pred::test(text[8]))
2445 return parse_doctype<Flags>(text);
2452 while (*text != Ch(
'>'))
2466 void parse_node_contents(Ch *&text, xml_node<Ch> *node)
2472 Ch *contents_start = text;
2473 skip<whitespace_pred, Flags>(text);
2474 Ch next_char = *text;
2488 if (text[1] == Ch(
'/'))
2495 Ch *closing_name = text;
2496 skip<node_name_pred, Flags>(text);
2497 if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name,
true))
2503 skip<node_name_pred, Flags>(text);
2506 skip<whitespace_pred, Flags>(text);
2507 if (*text != Ch(
'>'))
2518 if (xml_node<Ch> *child = parse_node<Flags & ~parse_open_only>(text))
2519 node->append_node(child);
2533 next_char = parse_and_append_data<Flags>(node, text, contents_start);
2534 goto after_data_node;
2542 void parse_node_attributes(Ch *&text, xml_node<Ch> *node)
2545 while (attribute_name_pred::test(*text))
2550 skip<attribute_name_pred, Flags>(text);
2555 xml_attribute<Ch> *attribute = this->allocate_attribute();
2556 attribute->name(name, text - name);
2557 node->append_attribute(attribute);
2560 skip<whitespace_pred, Flags>(text);
2563 if (*text != Ch(
'='))
2569 attribute->name()[attribute->name_size()] = 0;
2572 skip<whitespace_pred, Flags>(text);
2576 if (quote != Ch(
'\'') && quote != Ch(
'"'))
2581 Ch *
value = text, *end;
2583 if (quote == Ch(
'\''))
2584 end = skip_and_expand_character_refs<attribute_value_pred<Ch(
'\'')>, attribute_value_pure_pred<Ch(
'\'')>, AttFlags>(text);
2586 end = skip_and_expand_character_refs<attribute_value_pred<Ch(
'"')>, attribute_value_pure_pred<Ch(
'"')>, AttFlags>(text);
2598 attribute->value()[attribute->value_size()] = 0;
2601 skip<whitespace_pred, Flags>(text);
2613 const unsigned char lookup_tables<Dummy>::lookup_whitespace[256] =
2616 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
2617 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2618 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2619 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2620 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2621 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2622 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2623 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2624 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2626 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2627 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2629 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2630 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
2636 const unsigned char lookup_tables<Dummy>::lookup_element_name[256] =
2639 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1,
2640 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2641 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2642 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0,
2643 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2644 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2646 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2648 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2654 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2659 const unsigned char lookup_tables<Dummy>::lookup_node_name[256] =
2662 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, 1, 1, 1, 1, 1, 1, 1,
2770 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2771 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2776 const unsigned char lookup_tables<Dummy>::lookup_attribute_data_1[256] =
2779 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2780 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2781 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
2782 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2783 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2784 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2785 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2786 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2787 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2788 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2789 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2790 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2791 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2792 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2799 const unsigned char lookup_tables<Dummy>::lookup_attribute_data_1_pure[256] =
2802 0, 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1, 1, 1, 1,
2855 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2856 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2857 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2858 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2859 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2860 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2861 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2862 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2863 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2868 const unsigned char lookup_tables<Dummy>::lookup_digits[256] =
2871 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2872 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2873 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2874 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255,
2875 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255,
2876 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2877 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255,
2878 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2879 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2880 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2881 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2882 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2883 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2884 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2885 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
2886 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
2891 const unsigned char lookup_tables<Dummy>::lookup_upcase[256] =
2894 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
2895 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
2896 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
2897 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
2898 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2899 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
2900 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2901 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127,
2902 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
2903 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
2904 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
2905 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
2906 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
2907 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
2908 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
2909 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
2917 #undef RAPIDXML_PARSE_ERROR
2921 #pragma warning(pop)