• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/pyobjc-45/2.6/pyobjc/pyobjc-core/libxml2-src/

Lines Matching refs:node

46     xmlNodePtr node;		/* current node */
54 static void xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node);
66 ctxt->node = NULL;
83 * @node: the node
84 * @ns: the namespace node
86 * Check that a given namespace is in scope on a node.
90 * an ancestor node.
93 xmlNsCheckScope(xmlNodePtr node, xmlNsPtr ns)
97 if ((node == NULL) || (ns == NULL))
100 if ((node->type != XML_ELEMENT_NODE) &&
101 (node->type != XML_ATTRIBUTE_NODE) &&
102 (node->type != XML_DOCUMENT_NODE) &&
103 (node->type != XML_TEXT_NODE) &&
104 (node->type != XML_HTML_DOCUMENT_NODE) &&
105 (node->type != XML_XINCLUDE_START))
108 while ((node != NULL) &&
109 ((node->type == XML_ELEMENT_NODE) ||
110 (node->type == XML_ATTRIBUTE_NODE) ||
111 (node->type == XML_TEXT_NODE) ||
112 (node->type == XML_XINCLUDE_START))) {
113 if ((node->type == XML_ELEMENT_NODE) ||
114 (node->type == XML_XINCLUDE_START)) {
115 cur = node->nsDef;
124 node = node->parent;
126 /* the xml namespace may be declared on the document node */
127 if ((node != NULL) &&
128 ((node->type == XML_DOCUMENT_NODE) ||
129 (node->type == XML_HTML_DOCUMENT_NODE))) {
130 xmlNsPtr oldNs = ((xmlDocPtr) node)->oldNs;
162 NULL, ctxt->node, XML_FROM_CHECK,
172 NULL, ctxt->node, XML_FROM_CHECK,
182 NULL, ctxt->node, XML_FROM_CHECK,
191 * @node: the node
192 * @ns: the namespace node
197 xmlCtxtNsCheckScope(xmlDebugCtxtPtr ctxt, xmlNodePtr node, xmlNsPtr ns)
201 ret = xmlNsCheckScope(node, ns);
273 xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) {
277 doc = node->doc;
279 if (node->parent == NULL)
282 if (node->doc == NULL) {
304 if ((node->parent != NULL) && (node->doc != node->parent->doc) &&
305 (!xmlStrEqual(node->name, BAD_CAST "pseudoroot")))
308 if (node->prev == NULL) {
309 if (node->type == XML_ATTRIBUTE_NODE) {
310 if ((node->parent != NULL) &&
311 (node != (xmlNodePtr) node->parent->properties))
315 } else if ((node->parent != NULL) && (node->parent->children != node))
319 if (node->prev->next != node)
323 if (node->next == NULL) {
324 if ((node->parent != NULL) && (node->type != XML_ATTRIBUTE_NODE) &&
325 (node->parent->last != node) &&
326 (node->parent->type == XML_ELEMENT_NODE))
330 if (node->next->prev != node)
333 if (node->next->parent != node->parent)
337 if (node->type == XML_ELEMENT_NODE) {
340 ns = node->nsDef;
342 xmlCtxtNsCheckScope(ctxt, node, ns);
345 if (node->ns != NULL)
346 xmlCtxtNsCheckScope(ctxt, node, node->ns);
347 } else if (node->type == XML_ATTRIBUTE_NODE) {
348 if (node->ns != NULL)
349 xmlCtxtNsCheckScope(ctxt, node, node->ns);
352 if ((node->type != XML_ELEMENT_NODE) &&
353 (node->type != XML_ATTRIBUTE_NODE) &&
354 (node->type != XML_ELEMENT_DECL) &&
355 (node->type != XML_ATTRIBUTE_DECL) &&
356 (node->type != XML_DTD_NODE) &&
357 (node->type != XML_ELEMENT_DECL) &&
358 (node->type != XML_HTML_DOCUMENT_NODE) &&
359 (node->type != XML_DOCUMENT_NODE)) {
360 if (node->content != NULL)
361 xmlCtxtCheckString(ctxt, (const xmlChar *) node->content);
363 switch (node->type) {
366 xmlCtxtCheckName(ctxt, node->name);
369 if ((node->name == xmlStringText) ||
370 (node->name == xmlStringTextNoenc))
374 (node->name == xmlDictLookup(ctxt->dict, BAD_CAST "nbktext",
379 "Text node has wrong name '%s'",
380 (const char *) node->name);
383 if (node->name == xmlStringComment)
386 "Comment node has wrong name '%s'",
387 (const char *) node->name);
390 xmlCtxtCheckName(ctxt, node->name);
393 if (node->name == NULL)
397 (const char *) node->name);
452 fprintf(ctxt->output, "DTD node is NULL\n");
722 fprintf(ctxt->output, "namespace node is NULL\n");
872 * @node: the node
875 * Dumps debug information for the element node, it is not recursive
878 xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
880 if (node == NULL) {
883 fprintf(ctxt->output, "node is NULL\n");
887 ctxt->node = node;
889 switch (node->type) {
894 if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
895 xmlCtxtDumpString(ctxt, node->ns->prefix);
898 xmlCtxtDumpString(ctxt, node->name);
906 xmlCtxtGenericNodeCheck(ctxt, node);
911 if (node->name == (const xmlChar *) xmlStringTextNoenc)
916 if (node->content == (xmlChar *) &(node->properties))
918 else if (xmlDictOwns(ctxt->dict, node->content) == 1)
936 (char *) node->name);
948 fprintf(ctxt->output, "PI %s\n", (char *) node->name);
963 xmlCtxtGenericNodeCheck(ctxt, node);
984 xmlCtxtDumpDtdNode(ctxt, (xmlDtdPtr) node);
987 xmlCtxtDumpElemDecl(ctxt, (xmlElementPtr) node);
990 xmlCtxtDumpAttrDecl(ctxt, (xmlAttributePtr) node);
993 xmlCtxtDumpEntityDecl(ctxt, (xmlEntityPtr) node);
996 xmlCtxtDumpNamespace(ctxt, (xmlNsPtr) node);
1014 "Unknown node type %d\n", node->type);
1017 if (node->doc == NULL) {
1024 if ((node->type == XML_ELEMENT_NODE) && (node->nsDef != NULL))
1025 xmlCtxtDumpNamespaceList(ctxt, node->nsDef);
1026 if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL))
1027 xmlCtxtDumpAttrList(ctxt, node->properties);
1028 if (node->type != XML_ENTITY_REF_NODE) {
1029 if ((node->type != XML_ELEMENT_NODE) && (node->content != NULL)) {
1033 xmlCtxtDumpString(ctxt, node->content);
1040 ent = xmlGetDocEntity(node->doc, node->name);
1049 xmlCtxtGenericNodeCheck(ctxt, node);
1055 * @node: the node
1058 * Dumps debug information for the element node, it is recursive
1061 xmlCtxtDumpNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
1063 if (node == NULL) {
1066 fprintf(ctxt->output, "node is NULL\n");
1070 xmlCtxtDumpOneNode(ctxt, node);
1071 if ((node->type != XML_NAMESPACE_DECL) &&
1072 (node->children != NULL) && (node->type != XML_ENTITY_REF_NODE)) {
1074 xmlCtxtDumpNodeList(ctxt, node->children);
1082 * @node: the node list
1085 * Dumps debug information for the list of element node, it is recursive
1088 xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node)
1090 while (node != NULL) {
1091 xmlCtxtDumpNode(ctxt, node);
1092 node = node->next;
1104 ctxt->node = (xmlNodePtr) doc;
1109 "Misplaced ELEMENT node\n");
1113 "Misplaced ATTRIBUTE node\n");
1117 "Misplaced TEXT node\n");
1121 "Misplaced CDATA node\n");
1125 "Misplaced ENTITYREF node\n");
1129 "Misplaced ENTITY node\n");
1133 "Misplaced PI node\n");
1137 "Misplaced COMMENT node\n");
1149 "Misplaced DOCTYPE node\n");
1153 "Misplaced FRAGMENT node\n");
1157 "Misplaced NOTATION node\n");
1161 "Unknown node type %d\n", doc->type);
1432 * @node: the node
1435 * Dumps debug information for the element node, it is not recursive
1438 xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth)
1446 xmlCtxtDumpOneNode(&ctxt, node);
1453 * @node: the node
1456 * Dumps debug information for the element node, it is recursive
1459 xmlDebugDumpNode(FILE * output, xmlNodePtr node, int depth)
1468 xmlCtxtDumpNode(&ctxt, node);
1475 * @node: the node list
1478 * Dumps debug information for the list of element node, it is recursive
1481 xmlDebugDumpNodeList(FILE * output, xmlNodePtr node, int depth)
1490 xmlCtxtDumpNodeList(&ctxt, node);
1596 * @node: the node to count
1598 * Count the children of @node.
1600 * Returns the number of children of @node.
1603 xmlLsCountNode(xmlNodePtr node) {
1607 if (node == NULL)
1610 switch (node->type) {
1612 list = node->children;
1619 list = ((xmlDocPtr) node)->children;
1622 list = ((xmlAttrPtr) node)->children;
1628 if (node->content != NULL) {
1629 ret = xmlStrlen(node->content);
1655 * @node: the node to dump
1657 * Dump to @output the type and name of @node.
1660 xmlLsOneNode(FILE *output, xmlNodePtr node) {
1662 if (node == NULL) {
1666 switch (node->type) {
1712 if (node->type != XML_NAMESPACE_DECL) {
1713 if (node->properties != NULL)
1717 if (node->nsDef != NULL)
1723 fprintf(output, " %8d ", xmlLsCountNode(node));
1725 switch (node->type) {
1727 if (node->name != NULL)
1728 fprintf(output, "%s", (const char *) node->name);
1731 if (node->name != NULL)
1732 fprintf(output, "%s", (const char *) node->name);
1735 if (node->content != NULL) {
1736 xmlDebugDumpString(output, node->content);
1742 if (node->name != NULL)
1743 fprintf(output, "%s", (const char *) node->name);
1746 if (node->name != NULL)
1747 fprintf(output, "%s", (const char *) node->name);
1750 if (node->name != NULL)
1751 fprintf(output, "%s", (const char *) node->name);
1766 xmlNsPtr ns = (xmlNsPtr) node;
1776 if (node->name != NULL)
1777 fprintf(output, "%s", (const char *) node->name);
1833 "%s: no such node\n", arg);
1881 * @node : a non-null node to print to the output FILE
1883 * Print node to the output FILE
1886 xmlShellPrintNodeCtxt(xmlShellCtxtPtr ctxt,xmlNodePtr node)
1890 if (!node)
1897 if (node->type == XML_DOCUMENT_NODE)
1898 xmlDocDump(fp, (xmlDocPtr) node);
1899 else if (node->type == XML_ATTRIBUTE_NODE)
1900 xmlDebugDumpAttrList(fp, (xmlAttrPtr) node, 0);
1902 xmlElemDump(fp, node->doc, node);
1909 * @node : a non-null node to print to the output FILE
1911 * Print node to the output FILE
1914 xmlShellPrintNode(xmlNodePtr node)
1916 xmlShellPrintNodeCtxt(NULL, node);
1947 "Empty node set\n");
1991 * @node: a node
1995 * Does an Unix like listing of the given node (like a directory)
2001 char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
2007 if (node == NULL) {
2011 if ((node->type == XML_DOCUMENT_NODE) ||
2012 (node->type == XML_HTML_DOCUMENT_NODE)) {
2013 cur = ((xmlDocPtr) node)->children;
2014 } else if (node->type == XML_NAMESPACE_DECL) {
2015 xmlLsOneNode(ctxt->output, node);
2017 } else if (node->children != NULL) {
2018 cur = node->children;
2020 xmlLsOneNode(ctxt->output, node);
2034 * @node: a node
2038 * dumps the current XML base of the node
2044 char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
2050 if (node == NULL) {
2055 base = xmlNodeGetBase(node->doc, node);
2071 * @node: a node
2075 * change the current XML base of the node
2081 char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
2084 xmlNodeSetBase(node, (xmlChar*) arg);
2094 * @node: unused
2105 xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr node2 ATTRIBUTE_UNUSED)
2151 * @node: the root element
2184 * @node: a node
2188 * dumps informations about the node (namespace, attributes, content).
2194 char *arg, xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
2198 if (node == NULL)
2209 while (node != NULL) {
2210 if (node->type == XML_COMMENT_NODE) {
2211 if (xmlStrstr(node->content, (xmlChar *) arg)) {
2213 fprintf(ctxt->output, "%s : ", xmlGetNodePath(node));
2214 xmlShellList(ctxt, NULL, node, NULL);
2216 } else if (node->type == XML_TEXT_NODE) {
2217 if (xmlStrstr(node->content, (xmlChar *) arg)) {
2219 fprintf(ctxt->output, "%s : ", xmlGetNodePath(node->parent));
2220 xmlShellList(ctxt, NULL, node->parent, NULL);
2228 if ((node->type == XML_DOCUMENT_NODE) ||
2229 (node->type == XML_HTML_DOCUMENT_NODE)) {
2230 node = ((xmlDocPtr) node)->children;
2231 } else if ((node->children != NULL)
2232 && (node->type != XML_ENTITY_REF_NODE)) {
2234 node = node->children;
2235 } else if (node->next != NULL) {
2237 node = node->next;
2240 while (node != NULL) {
2241 if (node->parent != NULL) {
2242 node = node->parent;
2244 if (node->next != NULL) {
2245 node = node->next;
2248 if (node->parent == NULL) {
2249 node = NULL;
2262 * @node: a node
2266 * dumps informations about the node (namespace, attributes, content).
2272 char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
2277 if (node == NULL) {
2281 if ((node->type == XML_DOCUMENT_NODE) ||
2282 (node->type == XML_HTML_DOCUMENT_NODE)) {
2283 xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node);
2284 } else if (node->type == XML_ATTRIBUTE_NODE) {
2285 xmlDebugDumpAttr(ctxt->output, (xmlAttrPtr) node, 0);
2287 xmlDebugDumpOneNode(ctxt->output, node, 0);
2296 * @node: a node
2300 * dumps informations about the node (namespace, attributes, content).
2306 char *value, xmlNodePtr node,
2314 if (node == NULL) {
2323 ret = xmlParseInNodeContext(node, value, strlen(value), 0, &results);
2325 if (node->children != NULL) {
2326 xmlFreeNodeList(node->children);
2327 node->children = NULL;
2328 node->last = NULL;
2330 xmlAddChildList(node, results);
2342 * @node: a node
2352 xmlNodePtr node ATTRIBUTE_UNUSED,
2398 * @node: a node
2402 * dumps the serialization node content (XML or HTML).
2408 xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
2412 if (node == NULL) {
2418 if (node->type == XML_HTML_DOCUMENT_NODE)
2419 htmlDocDump(ctxt->output, (htmlDocPtr) node);
2421 htmlNodeDumpFile(ctxt->output, ctxt->doc, node);
2423 if (node->type == XML_DOCUMENT_NODE)
2424 xmlDocDump(ctxt->output, (xmlDocPtr) node);
2426 xmlElemDump(ctxt->output, ctxt->doc, node);
2429 if (node->type == XML_DOCUMENT_NODE)
2430 xmlDocDump(ctxt->output, (xmlDocPtr) node);
2432 xmlElemDump(ctxt->output, ctxt->doc, node);
2443 * @node: unused
2453 xmlNodePtr node ATTRIBUTE_UNUSED,
2483 ctxt->node = (xmlNodePtr) doc;
2498 * @node: a node in the tree
2502 * Write the current node to the filename, it saves the serialization
2503 * of the subtree under the @node specified
2508 xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
2511 if (node == NULL)
2523 switch (node->type) {
2555 xmlElemDump(f, ctxt->doc, node);
2566 * @node: unused
2576 xmlNodePtr node ATTRIBUTE_UNUSED,
2627 * @node: unused
2638 xmlNodePtr node ATTRIBUTE_UNUSED,
2669 * @tree: a node defining a subtree
2673 * show the structure of the subtree under node @tree
2674 * If @tree is null, the command works on the current node.
2683 xmlNodePtr node;
2691 node = tree;
2692 while (node != NULL) {
2693 if ((node->type == XML_DOCUMENT_NODE) ||
2694 (node->type == XML_HTML_DOCUMENT_NODE)) {
2696 } else if (node->type == XML_ELEMENT_NODE) {
2699 fprintf(ctxt->output, "%s\n", node->name);
2707 if ((node->type == XML_DOCUMENT_NODE) ||
2708 (node->type == XML_HTML_DOCUMENT_NODE)) {
2709 node = ((xmlDocPtr) node)->children;
2710 } else if ((node->children != NULL)
2711 && (node->type != XML_ENTITY_REF_NODE)) {
2713 node = node->children;
2715 } else if ((node != tree) && (node->next != NULL)) {
2717 node = node->next;
2718 } else if (node != tree) {
2720 while (node != tree) {
2721 if (node->parent != NULL) {
2722 node = node->parent;
2725 if ((node != tree) && (node->next != NULL)) {
2726 node = node->next;
2729 if (node->parent == NULL) {
2730 node = NULL;
2733 if (node == tree) {
2734 node = NULL;
2739 if (node == tree)
2740 node = NULL;
2742 node = NULL;
2751 * @node: a node
2755 * Show the full path from the root to the node, if needed building
2763 xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
2767 if ((node == NULL) || (buffer == NULL))
2770 path = xmlGetNodePath(node);
2828 ctxt->node = (xmlNodePtr) ctxt->doc;
2838 if (ctxt->node == (xmlNodePtr) ctxt->doc)
2840 else if ((ctxt->node != NULL) && (ctxt->node->name))
2841 snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name);
2893 fprintf(ctxt->output, "\tbase display XML base of the node\n");
2894 fprintf(ctxt->output, "\tsetbase URI change the XML base of the node\n");
2896 fprintf(ctxt->output, "\tcat [node] display node or current node\n");
2898 fprintf(ctxt->output, "\tdir [path] dumps informations about the node (namespace, attributes, content)\n");
2899 fprintf(ctxt->output, "\tdu [path] show the structure of the subtree under path or the current node\n");
2905 fprintf(ctxt->output, "\tset xml_fragment replace the current node content with the fragment parsed in context\n");
2917 fprintf(ctxt->output, "\twrite [name] write the current node to the filename\n");
2947 xmlShellGrep(ctxt, arg, ctxt->node, NULL);
2960 if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
2963 xmlShellDu(ctxt, NULL, ctxt->node, NULL);
2965 xmlShellBase(ctxt, NULL, ctxt->node, NULL);
2967 xmlShellSetContent(ctxt, arg, ctxt->node, NULL);
2986 ctxt->pctxt->node = ctxt->node;
2994 xmlShellSetBase(ctxt, arg, ctxt->node, NULL);
3001 xmlShellDir(ctxt, NULL, ctxt->node, NULL);
3003 xmlShellList(ctxt, NULL, ctxt->node, NULL);
3005 ctxt->pctxt->node = ctxt->node;
3007 ctxt->pctxt->node = ctxt->node;
3016 "%s: no such node\n", arg);
3077 "%s: no such node\n", arg);
3079 ctxt->pctxt->node = NULL;
3083 ctxt->node = (xmlNodePtr) ctxt->doc;
3086 ctxt->pctxt->node = ctxt->node;
3095 "%s: no such node\n", arg);
3100 ctxt->node = list->nodesetval->nodeTab[0];
3101 if ((ctxt->node != NULL) &&
3102 (ctxt->node->type ==
3106 ctxt->node = NULL;
3157 "%s: no such node\n", arg);
3159 ctxt->pctxt->node = NULL;
3164 xmlShellCat(ctxt, NULL, ctxt->node, NULL);
3166 ctxt->pctxt->node = ctxt->node;
3168 ctxt->pctxt->node = ctxt->node;
3177 "%s: no such node\n", arg);
3235 "%s: no such node\n", arg);
3237 ctxt->pctxt->node = NULL;