Lines Matching defs:node
20 * and indicating we are on / (the document node), probably need
64 * xmlElementType enums, to indicate a node of any type.
92 int nodeType; /* type of node */
139 xmlNodePtr node;
181 xmlNodePtr elem; /* the current node if any */
460 xmlPatPushState(xmlStepStates *states, int step, xmlNodePtr node) {
477 states->states[states->nbstates++].node = node;
479 fprintf(stderr, "Push: %d, %s\n", step, node->name);
487 * @node: a node
489 * Test whether the node matches the pattern
494 xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) {
499 if ((comp == NULL) || (node == NULL)) return(-1);
508 if (node->type == XML_NAMESPACE_DECL)
510 node = node->parent;
511 if ((node->type == XML_DOCUMENT_NODE) ||
513 (node->type == XML_DOCB_DOCUMENT_NODE) ||
515 (node->type == XML_HTML_DOCUMENT_NODE))
519 if (node->type != XML_ELEMENT_NODE)
523 if (step->value[0] != node->name[0])
525 if (!xmlStrEqual(step->value, node->name))
529 if (node->ns == NULL) {
532 } else if (node->ns->href != NULL) {
535 if (!xmlStrEqual(step->value2, node->ns->href))
542 if ((node->type != XML_ELEMENT_NODE) &&
543 (node->type != XML_DOCUMENT_NODE) &&
545 (node->type != XML_DOCB_DOCUMENT_NODE) &&
547 (node->type != XML_HTML_DOCUMENT_NODE))
550 lst = node->children;
566 if (node->type != XML_ATTRIBUTE_NODE)
569 if (step->value[0] != node->name[0])
571 if (!xmlStrEqual(step->value, node->name))
575 if (node->ns == NULL) {
579 if (!xmlStrEqual(step->value2, node->ns->href))
584 if ((node->type == XML_DOCUMENT_NODE) ||
585 (node->type == XML_HTML_DOCUMENT_NODE) ||
587 (node->type == XML_DOCB_DOCUMENT_NODE) ||
589 (node->type == XML_NAMESPACE_DECL))
591 node = node->parent;
592 if (node == NULL)
596 if (step->value[0] != node->name[0])
598 if (!xmlStrEqual(step->value, node->name))
601 if (node->ns == NULL) {
604 } else if (node->ns->href != NULL) {
607 if (!xmlStrEqual(step->value2, node->ns->href))
612 /* TODO: implement coalescing of ANCESTOR/NODE ops */
623 if (node
625 if ((node->type == XML_DOCUMENT_NODE) ||
626 (node->type == XML_HTML_DOCUMENT_NODE) ||
628 (node->type == XML_DOCB_DOCUMENT_NODE) ||
630 (node->type == XML_NAMESPACE_DECL))
632 node = node->parent;
633 while (node != NULL) {
634 if ((node->type == XML_ELEMENT_NODE) &&
635 (step->value[0] == node->name[0]) &&
636 (xmlStrEqual(step->value, node->name))) {
638 if (node->ns == NULL) {
641 } else if (node->ns->href != NULL) {
643 (xmlStrEqual(step->value2, node->ns->href)))
647 node = node->parent;
649 if (node == NULL)
653 * for ancestors of that node.
656 xmlPatPushState(&states, i, node);
658 xmlPatPushState(&states, i - 1, node);
661 if (node->type != XML_ELEMENT_NODE)
663 if (node->ns == NULL) {
666 } else if (node->ns->href != NULL) {
669 if (!xmlStrEqual(step->value, node->ns->href))
674 if (node->type != XML_ELEMENT_NODE)
695 node = states.states[states.nbstates].node;
697 fprintf(stderr, "Pop: %d, %s\n", i, node->name);
1018 * Context node.
1336 /* "." - "self::node()" */
1341 * Selection of the context node.
1352 /* "./" - "self::node()/" */
1364 /* ".//" - "self:node()/descendant-or-self::node()/" */
1638 * We have a "." or "self::node()" here.
1639 * Eliminate redundant self::node() tests like in "/./."
1642 * self::node() is the last node test and we had
1649 * to any type of node.
1662 * the result node-set; this is needed since only
1677 /* An element node. */
1686 /* An element node child. */
1841 * @nodeType: the type of the node
1871 /* We have a document node here (or a reset). */
1885 * In the case of "//." the document node will match
1906 * / and . are handled at the XPath node set creation
1992 * Check for correct node-type.
2104 * XS-IDC: The missing "self::node()" will always
2105 * match the first given node.
2119 * "self::node()" is responsible for the 2nd level being
2130 * Check expected node-type.
2206 * Otherwise the function will act as if it has been given an element-node.
2222 * @nodeType: the type of the node being pushed
2231 * processing-instruction-node.
2256 * Otherwise the function will act as if it has been given an attribute-node.
2452 * @node: a node
2454 * Test whether the node matches the pattern
2459 xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node)
2463 if ((comp == NULL) || (node == NULL))
2467 ret = xmlPatMatch(comp, node);