Lines Matching defs:node
20 * and indicating we are on / (the document node), probably need
67 * xmlElementType enums, to indicate a node of any type.
95 int nodeType; /* type of node */
142 xmlNodePtr node;
184 xmlNodePtr elem; /* the current node if any */
464 xmlPatPushState(xmlStepStates *states, int step, xmlNodePtr node) {
481 states->states[states->nbstates++].node = node;
483 fprintf(stderr, "Push: %d, %s\n", step, node->name);
491 * @node: a node
493 * Test whether the node matches the pattern
498 xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) {
503 if ((comp == NULL) || (node == NULL)) return(-1);
512 if (node->type == XML_NAMESPACE_DECL)
514 node = node->parent;
515 if ((node->type == XML_DOCUMENT_NODE) ||
517 (node->type == XML_DOCB_DOCUMENT_NODE) ||
519 (node->type == XML_HTML_DOCUMENT_NODE))
523 if (node->type != XML_ELEMENT_NODE)
527 if (step->value[0] != node->name[0])
529 if (!xmlStrEqual(step->value, node->name))
533 if (node->ns == NULL) {
536 } else if (node->ns->href != NULL) {
539 if (!xmlStrEqual(step->value2, node->ns->href))
546 if ((node->type != XML_ELEMENT_NODE) &&
547 (node->type != XML_DOCUMENT_NODE) &&
549 (node->type != XML_DOCB_DOCUMENT_NODE) &&
551 (node->type != XML_HTML_DOCUMENT_NODE))
554 lst = node->children;
570 if (node->type != XML_ATTRIBUTE_NODE)
573 if (step->value[0] != node->name[0])
575 if (!xmlStrEqual(step->value, node->name))
579 if (node->ns == NULL) {
583 if (!xmlStrEqual(step->value2, node->ns->href))
588 if ((node->type == XML_DOCUMENT_NODE) ||
589 (node->type == XML_HTML_DOCUMENT_NODE) ||
591 (node->type == XML_DOCB_DOCUMENT_NODE) ||
593 (node->type == XML_NAMESPACE_DECL))
595 node = node->parent;
596 if (node == NULL)
600 if (step->value[0] != node->name[0])
602 if (!xmlStrEqual(step->value, node->name))
605 if (node->ns == NULL) {
608 } else if (node->ns->href != NULL) {
611 if (!xmlStrEqual(step->value2, node->ns->href))
616 /* TODO: implement coalescing of ANCESTOR/NODE ops */
627 if (node == NULL)
629 if ((node->type == XML_DOCUMENT_NODE) ||
630 (node->type == XML_HTML_DOCUMENT_NODE) ||
632 (node->type == XML_DOCB_DOCUMENT_NODE) ||
634 (node->type == XML_NAMESPACE_DECL))
636 node = node->parent;
637 while (node != NULL) {
638 if ((node->type == XML_ELEMENT_NODE) &&
639 (step->value[0] == node->name[0]) &&
640 (xmlStrEqual(step->value, node->name))) {
642 if (node->ns == NULL) {
645 } else if (node->ns->href != NULL) {
647 (xmlStrEqual(step->value2, node->ns->href)))
651 node = node->parent;
653 if (node == NULL)
657 * for ancestors of that node.
660 xmlPatPushState(&states, i, node);
662 xmlPatPushState(&states, i - 1, node);
665 if (node->type != XML_ELEMENT_NODE)
667 if (node->ns == NULL) {
670 } else if (node->ns->href != NULL) {
673 if (!xmlStrEqual(step->value, node->ns->href))
678 if (node->type != XML_ELEMENT_NODE)
699 node = states.states[states.nbstates].node;
701 fprintf(stderr, "Pop: %d, %s\n", i, node->name);
1022 * Context node.
1340 /* "." - "self::node()" */
1345 * Selection of the context node.
1356 /* "./" - "self::node()/" */
1368 /* ".//" - "self:node()/descendant-or-self::node()/" */
1642 * We have a "." or "self::node()" here.
1643 * Eliminate redundant self::node() tests like in "/./."
1646 * self::node() is the last node test and we had
1653 * to any type of node.
1666 * the result node-set; this is needed since only
1681 /* An element node. */
1690 /* An element node child. */
1845 * @nodeType: the type of the node
1875 /* We have a document node here (or a reset). */
1889 * In the case of "//." the document node will match
1910 * / and . are handled at the XPath node set creation
1996 * Check for correct node-type.
2108 * XS-IDC: The missing "self::node()" will always
2109 * match the first given node.
2123 * "self::node()" is responsible for the 2nd level being
2134 * Check expected node-type.
2210 * Otherwise the function will act as if it has been given an element-node.
2226 * @nodeType: the type of the node being pushed
2235 * processing-instruction-node.
2260 * Otherwise the function will act as if it has been given an attribute-node.
2456 * @node: a node
2458 * Test whether the node matches the pattern
2463 xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node)
2467 if ((comp == NULL) || (node == NULL))
2471 ret = xmlPatMatch(comp, node);