| 8438 | |
| 8439 | template<class T> |
| 8440 | void step_fill(xpath_node_set_raw& ns, const xml_node& n, xpath_allocator* alloc, T) |
| 8441 | { |
| 8442 | const axis_t axis = T::axis; |
| 8443 | |
| 8444 | switch (axis) |
| 8445 | { |
| 8446 | case axis_attribute: |
| 8447 | { |
| 8448 | for (xml_attribute a = n.first_attribute(); a; a = a.next_attribute()) |
| 8449 | step_push(ns, a, n, alloc); |
| 8450 | |
| 8451 | break; |
| 8452 | } |
| 8453 | |
| 8454 | case axis_child: |
| 8455 | { |
| 8456 | for (xml_node c = n.first_child(); c; c = c.next_sibling()) |
| 8457 | step_push(ns, c, alloc); |
| 8458 | |
| 8459 | break; |
| 8460 | } |
| 8461 | |
| 8462 | case axis_descendant: |
| 8463 | case axis_descendant_or_self: |
| 8464 | { |
| 8465 | if (axis == axis_descendant_or_self) |
| 8466 | step_push(ns, n, alloc); |
| 8467 | |
| 8468 | xml_node cur = n.first_child(); |
| 8469 | |
| 8470 | while (cur && cur != n) |
| 8471 | { |
| 8472 | step_push(ns, cur, alloc); |
| 8473 | |
| 8474 | if (cur.first_child()) |
| 8475 | cur = cur.first_child(); |
| 8476 | else if (cur.next_sibling()) |
| 8477 | cur = cur.next_sibling(); |
| 8478 | else |
| 8479 | { |
| 8480 | while (!cur.next_sibling() && cur != n) |
| 8481 | cur = cur.parent(); |
| 8482 | |
| 8483 | if (cur != n) |
| 8484 | cur = cur.next_sibling(); |
| 8485 | } |
| 8486 | } |
| 8487 | |
| 8488 | break; |
| 8489 | } |
| 8490 | |
| 8491 | case axis_following_sibling: |
| 8492 | { |
| 8493 | for (xml_node c = n.next_sibling(); c; c = c.next_sibling()) |
| 8494 | step_push(ns, c, alloc); |
| 8495 | |
| 8496 | break; |
| 8497 | } |
nothing calls this directly
no test coverage detected