Home | History | Annotate | Download | only in libxml2

Lines Matching defs:node

81 xmlTreeErr(int code, xmlNodePtr node, const char *extra)
101 __xmlSimpleError(XML_FROM_TREE, code, node, msg, extra);
705 * @node: the element carrying the namespace
711 * node.
717 xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) {
720 if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
746 if (node != NULL) {
747 if (node->nsDef == NULL) {
748 node->nsDef = cur;
750 xmlNsPtr prev = node->nsDef;
773 * @node: a node in the document
776 * Associate a namespace to a node, a posteriori.
779 xmlSetNs(xmlNodePtr node, xmlNsPtr ns) {
780 if (node == NULL) {
783 "xmlSetNs: node == NULL\n");
787 node->ns = ns;
1240 * Parse the value string and build the node list associated. Should
1247 xmlNodePtr node;
1268 node = xmlNewDocTextLen(doc, q, cur - q);
1269 if (node == NULL) return(ret);
1271 last = ret = node;
1273 last->next = node;
1274 node->prev = last;
1275 last = node;
1353 node = xmlNewDocText(doc, ent->content);
1354 last = ret = node;
1356 node = xmlNewDocText(doc, ent->content);
1357 last = xmlAddNextSibling(last, node);
1363 * Create a new REFERENCE_REF node
1365 node = xmlNewReference(doc, val);
1366 if (node == NULL) {
1374 (const xmlChar*)node->content);
1384 last = ret = node;
1386 last = xmlAddNextSibling(last, node);
1400 node = xmlNewDocText(doc, buf);
1401 if (node != NULL) {
1403 last = ret = node;
1405 last = xmlAddNextSibling(last, node);
1420 node = xmlNewDocTextLen(doc, q, cur - q);
1421 if (node == NULL) return(ret);
1423 last = ret = node;
1425 last = xmlAddNextSibling(last, node);
1437 * Parse the value string and build the node list associated. Should
1444 xmlNodePtr node;
1465 node = xmlNewDocTextLen(doc, q, cur - q);
1466 if (node == NULL) return(ret);
1468 last = ret = node;
1470 last->next = node;
1471 node->prev = last;
1472 last = node;
1538 node = xmlNewDocText(doc, ent->content);
1539 last = ret = node;
1541 node = xmlNewDocText(doc, ent->content);
1542 last = xmlAddNextSibling(last, node);
1548 * Create a new REFERENCE_REF node
1550 node = xmlNewReference(doc, val);
1551 if (node == NULL) {
1559 (const xmlChar*)node->content);
1568 last = ret = node;
1570 last = xmlAddNextSibling(last, node);
1584 node = xmlNewDocText(doc, buf);
1585 if (node != NULL) {
1587 last = ret = node;
1589 last = xmlAddNextSibling(last, node);
1605 node = xmlNewDocTextLen(doc, q, cur - q);
1606 if (node == NULL) return(ret);
1608 last = ret = node;
1610 last = xmlAddNextSibling(last, node);
1620 * @list: a Node list
1623 * Build the string equivalent to the text contained in the Node list
1631 xmlNodePtr node = list;
1638 while (node != NULL) {
1639 if ((node->type == XML_TEXT_NODE) ||
1640 (node->type == XML_CDATA_SECTION_NODE)) {
1642 ret = xmlStrcat(ret, node->content);
1646 buffer = xmlEncodeEntitiesReentrant(doc, node->content);
1652 } else if (node->type == XML_ENTITY_REF_NODE) {
1654 ent = xmlGetDocEntity(doc, node->name);
1671 ret = xmlStrcat(ret, node->content);
1679 ret = xmlStrcat(ret, node->name);
1688 "xmlGetNodeListString : invalid node type %d\n",
1689 node->type);
1692 node = node->next;
1701 * @list: a Node list
1704 * Builds the string equivalent to the text contained in the Node list
1713 xmlNodePtr node = list;
1720 while (node != NULL) {
1721 if ((node->type == XML_TEXT_NODE) ||
1722 (node->type == XML_CDATA_SECTION_NODE)) {
1724 ret = xmlStrcat(ret, node->content);
1728 buffer = xmlEncodeSpecialChars(doc, node->content);
1734 } else if (node->type == XML_ENTITY_REF_NODE) {
1736 ent = xmlGetDocEntity(doc, node->name);
1754 ret = xmlStrcat(ret, node->content);
1762 ret = xmlStrcat(ret, node->name);
1771 "xmlGetNodeListString : invalid node type %d\n",
1772 node->type);
1775 node = node->next;
1782 xmlNewPropInternal(xmlNodePtr node, xmlNsPtr ns,
1789 if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
1791 ((node->doc == NULL) ||
1792 (!(xmlDictOwns(node->doc->dict, name)))))
1803 ((node->doc == NULL) ||
1804 (!(xmlDictOwns(node->doc->dict, name)))))
1812 cur->parent = node;
1813 if (node != NULL) {
1814 doc = node->doc;
1850 if (node != NULL) {
1851 if (node->properties == NULL) {
1852 node->properties = cur;
1854 xmlAttrPtr prev = node->properties;
1863 if (xmlIsID((node == NULL) ? NULL : node->doc, node, cur) == 1)
1864 xmlAddID(NULL, node->doc, value, cur);
1875 * @node: the holding node
1879 * Create a new property carried by a node.
1883 xmlNewProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value) {
1893 return xmlNewPropInternal(node, NULL, name, value, 0);
1899 * @node: the holding node
1904 * Create a new property tagged with a namespace and carried by a node.
1908 xmlNewNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
1919 return xmlNewPropInternal(node, ns, name, value, 0);
1924 * @node: the holding node
1929 * Create a new property tagged with a namespace and carried by a node.
1933 xmlNewNsPropEatName(xmlNodePtr node, xmlNsPtr ns, xmlChar *name,
1944 return xmlNewPropInternal(node, ns, name, value, 1);
2092 "xmlRemoveProp : attribute not owned by its node\n");
2104 * Returns a pointer to the new node object.
2119 * Allocate a new node and fill the fields.
2151 * Returns a pointer to the new node object.
2161 * @name: the node name
2163 * Creation of a new node element. @ns is optional (NULL).
2165 * Returns a pointer to the new node object. Uses xmlStrdup() to make
2181 * Allocate a new node and fill the fields.
2185 xmlTreeErrMemory("building node");
2202 * @name: the node name
2204 * Creation of a new node element. @ns is optional (NULL).
2206 * Returns a pointer to the new node object, with pointer @name as
2207 * new node's name. Use xmlNewNode() if a copy of @name string is
2208 * is needed as new node's name.
2223 * Allocate a new node and fill the fields.
2227 xmlTreeErrMemory("building node");
2246 * @name: the node name
2249 * Creation of a new node element within a document. @ns and @content
2256 * Returns a pointer to the new node object.
2283 * @name: the node name
2286 * Creation of a new node element within a document. @ns and @content
2293 * Returns a pointer to the new node object.
2321 * @name: the node name
2324 * Creation of a new node element within a document. @ns and @content
2327 * Returns a pointer to the new node object.
2349 * Creation of a new Fragment node.
2350 * Returns a pointer to the new node object.
2357 * Allocate a new DocumentFragment node and fill the fields.
2379 * Creation of a new text node.
2380 * Returns a pointer to the new node object.
2387 * Allocate a new node and fill the fields.
2410 * @parent: the parent node
2418 * a child TEXT node will be created containing the string @content.
2425 * Returns a pointer to the new node object.
2449 * Allocate a new node
2494 * Creation of a new character reference node.
2495 * Returns a pointer to the new node object.
2505 * Allocate a new node and fill the fields.
2537 * Creation of a new reference node.
2538 * Returns a pointer to the new node object.
2549 * Allocate a new node and fill the fields.
2593 * Creation of a new text node within a document.
2594 * Returns a pointer to the new node object.
2610 * Creation of a new text node with an extra parameter for the content's length
2611 * Returns a pointer to the new node object.
2618 * Allocate a new node and fill the fields.
2644 * Creation of a new text node with an extra content length parameter. The
2645 * text node pertain to a given document.
2646 * Returns a pointer to the new node object.
2661 * Creation of a new node containing a comment.
2662 * Returns a pointer to the new node object.
2669 * Allocate a new node and fill the fields.
2695 * Creation of a new node containing a CDATA block.
2696 * Returns a pointer to the new node object.
2703 * Allocate a new node and fill the fields.
2728 * Creation of a new node containing a comment within a document.
2729 * Returns a pointer to the new node object.
2792 * @parent: the parent node
2800 * a child list containing the TEXTs and ENTITY_REFs node will be created.
2805 * Returns a pointer to the new node object.
2829 * Allocate a new node
2920 * @cur: the child node
2921 * @elem: the new node
2923 * Add a new node @elem as the next sibling of @cur
2924 * If the new node was already inserted in a document it is
2927 * If the new node is ATTRIBUTE, it is added into properties instead of children.
2930 * Returns the new node or NULL in case of error.
2998 * @cur: the child node
2999 * @elem: the new node
3001 * Add a new node @elem as the previous sibling of @cur
3003 * If the new node was already inserted in a document it is
3005 * If the new node is ATTRIBUTE, it is added into properties instead of children.
3008 * Returns the new node or NULL in case of error.
3076 * @cur: the child node
3077 * @elem: the new node
3146 * @parent: the parent node
3147 * @cur: the first node in the list
3149 * Add a list of node at the end of the child list of the parent
3230 * @parent: the parent node
3231 * @cur: the child node
3233 * Add a new node to @parent, at the end of the child (or property) list
3235 * If the new node is ATTRIBUTE, it is added into properties instead of children.
3268 * If cur is a TEXT node, merge its content with adjacent TEXT nodes
3297 * tries to add a node to its parent multiple times
3359 * @parent: the parent node
3361 * Search the last child of a node.
3383 * @parent: the parent node
3420 * @parent: the parent node
3422 * Finds the first child node of that element which is a Element node
3455 * @parent: the parent node
3457 * Finds the last child node of that element which is a Element node
3490 * @node: the current node
3492 * Finds the first closest previous sibling of the node which is an
3493 * element node.
3501 xmlPreviousElementSibling(xmlNodePtr node) {
3502 if (node == NULL)
3504 switch (node->type) {
3514 node = node->prev;
3519 while (node != NULL) {
3520 if (node->type == XML_ELEMENT_NODE)
3521 return(node);
3522 node = node->next;
3529 * @node: the current node
3531 * Finds the first closest next sibling of the node which is an
3532 * element node.
3540 xmlNextElementSibling(xmlNodePtr node) {
3541 if (node == NULL)
3543 switch (node->type) {
3554 node = node->next;
3559 while (node != NULL) {
3560 if (node->type == XML_ELEMENT_NODE)
3561 return(node);
3562 node = node->next;
3571 * @cur: the first node in the list
3573 * Free a node and all its siblings, this is a recursive behaviour, all
3624 * When a node is a text node or a comment, it uses a global static
3625 * variable for the name of the node.
3626 * Otherwise the node name might come from the document's
3641 * @cur: the node
3643 * Free a node, this is a recursive behaviour, all the children are freed too.
3694 * When a node is a text node or a comment, it uses a global static
3695 * variable for the name of the node.
3696 * Otherwise the node name might come from the document's dictionnary
3713 * @cur: the node
3715 * Unlink a node from it's current context, the node is not freed
3722 "xmlUnlinkNode : node == NULL\n");
3782 * @old: the old node
3783 * @cur: the node
3785 * Unlink the old node from its current context, prune the new one
3789 * Returns the @old node
3811 "xmlReplaceNode : Trying to replace attribute node with other node type\n");
3818 "xmlReplaceNode : Trying to replace a non-attribute node with attribute node\n");
3908 xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent);
4054 * tricky reason: namespaces. Doing a direct copy of a node
4064 * of the node with values 0 (no) and 1 (yes). For XInclude,
4070 xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
4074 if (node == NULL) return(NULL);
4075 switch (node->type) {
4088 return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
4090 return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
4098 return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
4110 * Allocate a new node and fill the fields.
4114 xmlTreeErrMemory("copying node");
4118 ret->type = node->type;
4122 if (node->name == xmlStringText)
4124 else if (node->name == xmlStringTextNoenc)
4126 else if (node->name == xmlStringComment)
4128 else if (node->name != NULL) {
4130 ret->name = xmlDictLookup(doc->dict, node->name, -1);
4132 ret->name = xmlStrdup(node->name);
4134 if ((node->type != XML_ELEMENT_NODE) &&
4135 (node->content != NULL) &&
4136 (node->type != XML_ENTITY_REF_NODE) &&
4137 (node->type != XML_XINCLUDE_END) &&
4138 (node->type != XML_XINCLUDE_START)) {
4139 ret->content = xmlStrdup(node->content);
4141 if (node->type == XML_ELEMENT_NODE)
4142 ret->line = node->line;
4148 * this is a tricky part for the node register thing:
4150 * the deregister-node callback is called; so we register ret now already
4156 /* node could have coalesced */
4163 if ((node->type == XML_ELEMENT_NODE) && (node->nsDef != NULL))
4164 ret->nsDef = xmlCopyNamespaceList(node->nsDef);
4166 if (node->ns != NULL) {
4169 ns = xmlSearchNs(doc, ret, node->ns->prefix);
4176 ns = xmlSearchNs(node->doc, node, node->ns->prefix);
4190 if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL))
4191 ret->properties = xmlCopyPropList(ret, node->properties);
4192 if (node->type == XML_ENTITY_REF_NODE) {
4193 if ((doc == NULL) || (node->doc != doc)) {
4195 * The copied node will go into a separate document, so
4196 * to avoid dangling references to the ENTITY_DECL node
4202 ret->children = node->children;
4205 } else if ((node->children != NULL) && (extended != 2)) {
4206 ret->children = xmlStaticCopyNodeList(node->children, doc, ret);
4211 /* if parent != NULL we already registered the node above */
4219 xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
4223 while (node != NULL) {
4225 if (node->type == XML_DTD_NODE ) {
4227 node = node->next;
4231 q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
4242 q = xmlStaticCopyNode(node, doc, parent, 1);
4252 node = node->next;
4259 * @node: the node
4264 * Do a copy of the node.
4269 xmlCopyNode(const xmlNodePtr node, int extended) {
4272 ret = xmlStaticCopyNode(node, NULL, NULL, extended);
4278 * @node: the node
4284 * Do a copy of the node to a given document.
4289 xmlDocCopyNode(const xmlNodePtr node, xmlDocPtr doc, int extended) {
4292 ret = xmlStaticCopyNode(node, doc, NULL, extended);
4299 * @node: the first node in the list.
4301 * Do a recursive copy of the node list.
4305 xmlNodePtr xmlDocCopyNodeList(xmlDocPtr doc, const xmlNodePtr node) {
4306 xmlNodePtr ret = xmlStaticCopyNodeList(node, doc, NULL);
4312 * @node: the first node in the list.
4314 * Do a recursive copy of the node list.
4319 xmlNodePtr xmlCopyNodeList(const xmlNodePtr node) {
4320 xmlNodePtr ret = xmlStaticCopyNodeList(node, NULL, NULL);
4476 * @node: valid node
4478 * Get line number of @node. This requires activation of this option
4484 xmlGetLineNo(xmlNodePtr node)
4488 if (!node)
4490 if ((node->type == XML_ELEMENT_NODE) ||
4491 (node->type == XML_TEXT_NODE) ||
4492 (node->type == XML_COMMENT_NODE) ||
4493 (node->type == XML_PI_NODE))
4494 result = (long) node->line;
4495 else if ((node->prev != NULL) &&
4496 ((node->prev->type == XML_ELEMENT_NODE) ||
4497 (node->prev->type == XML_TEXT_NODE) ||
4498 (node->prev->type == XML_COMMENT_NODE) ||
4499 (node->prev->type == XML_PI_NODE)))
4500 result = xmlGetLineNo(node->prev);
4501 else if ((node->parent != NULL) &&
4502 (node->parent->type == XML_ELEMENT_NODE))
4503 result = xmlGetLineNo(node->parent);
4511 * @node: a node
4513 * Build a structure based Path for the given node
4519 xmlGetNodePath(xmlNodePtr node)
4530 if (node == NULL)
4536 xmlTreeErrMemory("getting node path");
4541 xmlTreeErrMemory("getting node path");
4547 cur = node;
4652 * Evaluate if this is the only text- or CDATA-section-node;
4726 xmlTreeErrMemory("getting node path");
4734 xmlTreeErrMemory("getting node path");
4783 * to remove a node from a document use xmlUnlinkNode(root) instead.
4823 * @cur: the node being changed
4826 * Set the language of a node, i.e. the values of the xml:lang
4870 * @cur: the node being checked
4872 * Searches the language of a node, i.e. the values of the xml:lang
4895 * @cur: the node being changed
4898 * Set (or reset) the space preserving behaviour of a node, i.e. the
4949 * @cur: the node being checked
4951 * Searches the space preserving behaviour of a node, i.e. the values
4982 * @cur: the node being changed
4985 * Set (or reset) the name of a node.
5040 * @cur: the node being changed
5043 * Set (or reset) the base URI of a node, i.e. the value of the
5105 * @doc: the document the node pertains to
5106 * @cur: the node being checked
5193 * @cur: the node being read
5195 * Read the value of a node @cur, this can be either the text carried
5196 * directly by this node if it's a TEXT node or the aggregate string
5197 * of the values carried by this node child's (TEXT and ENTITY_REF).
5230 * Skip to next node
5292 * xmlNodeGetContent() which handles all possible node types */
5334 * @cur: the node being read
5336 * Read the value of a node, this can be either the text carried
5337 * directly by this node if it's a TEXT node or the aggregate string
5338 * of the values carried by this node child's (TEXT and ENTITY_REF).
5443 * @cur: the node being modified
5446 * Replace the content of a node.
5456 "xmlNodeSetContent : node == NULL\n");
5519 * @cur: the node being modified
5523 * Replace the content of a node.
5533 "xmlNodeSetContentLen : node == NULL\n");
5593 * @cur: the node being modified
5597 * Append the extra substring to the node content.
5607 "xmlNodeAddContentLen : node == NULL\n");
5669 * @cur: the node being modified
5672 * Append the extra substring to the node content.
5684 "xmlNodeAddContent : node == NULL\n");
5695 * @first: the first text node
5696 * @second: the second text node being merged
5699 * Returns the first text node augmented
5719 * @node: the current node
5727 xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node)
5735 while (node != NULL) {
5736 if (node->type == XML_ELEMENT_NODE) {
5737 cur = node->nsDef;
5773 node = node->parent;
5814 * @node: the current node
5828 xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
5831 xmlNodePtr orig = node;
5833 if (node == NULL) return(NULL);
5836 if ((doc == NULL) && (node->type == XML_ELEMENT_NODE)) {
5840 * node element.
5851 cur->next = node->nsDef;
5852 node->nsDef = cur;
5856 doc = node->doc;
5868 while (node != NULL) {
5869 if ((node->type == XML_ENTITY_REF_NODE) ||
5870 (node->type == XML_ENTITY_NODE) ||
5871 (node->type == XML_ENTITY_DECL))
5873 if (node->type == XML_ELEMENT_NODE) {
5874 cur = node->nsDef;
5885 if (orig != node) {
5886 cur = node->ns;
5898 node = node->parent;
5906 * @node: the current node
5911 * on node.
5916 xmlNsInScope(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node,
5921 while ((node != NULL) && (node != ancestor)) {
5922 if ((node->type == XML_ENTITY_REF_NODE) ||
5923 (node->type == XML_ENTITY_NODE) ||
5924 (node->type == XML_ENTITY_DECL))
5926 if (node->type == XML_ELEMENT_NODE) {
5927 tst = node->nsDef;
5939 node = node->parent;
5941 if (node != ancestor)
5949 * @node: the current node
5957 xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
5960 xmlNodePtr orig = node;
5963 if ((node == NULL) || (href == NULL))
5969 if ((doc == NULL) && (node->type == XML_ELEMENT_NODE)) {
5973 * node element.
5984 cur->next = node->nsDef;
5985 node->nsDef = cur;
5989 doc = node->doc;
6001 is_attr = (node->type == XML_ATTRIBUTE_NODE);
6002 while (node != NULL) {
6003 if ((node->type == XML_ENTITY_REF_NODE) ||
6004 (node->type == XML_ENTITY_NODE) ||
6005 (node->type == XML_ENTITY_DECL))
6007 if (node->type == XML_ELEMENT_NODE) {
6008 cur = node->nsDef;
6013 (xmlNsInScope(doc, orig, node, cur->prefix) == 1))
6018 if (orig != node) {
6019 cur = node->ns;
6024 (xmlNsInScope(doc, orig, node, cur->prefix) == 1))
6030 node = node->parent;
6038 * @tree: a node expected to hold the new namespace
6042 * ancestors, or create a new namespace definition node similar to
6106 * @tree: a node defining the subtree to reconciliate
6125 xmlNodePtr node = tree;
6129 if ((node == NULL) || (node->type != XML_ELEMENT_NODE)) return(-1);
6131 if (node->doc != doc) return(-1);
6132 while (node != NULL) {
6134 * Reconciliate the node namespace
6136 if (node->ns != NULL) {
6157 if (oldNs[i] == node->ns) {
6158 node->ns = newNs[i];
6166 n = xmlNewReconciliedNs(doc, tree, node->ns);
6189 oldNs[nbCache++] = node->ns;
6190 node->ns = n;
6195 * now check for namespace hold by attributes on the node.
6197 if (node->type == XML_ELEMENT_NODE) {
6198 attr = node->properties;
6265 if ((node->children != NULL) && (node->type != XML_ENTITY_REF_NODE)) {
6267 node = node->children;
6268 } else if ((node != tree) && (node->next != NULL)) {
6270 node = node->next;
6271 } else if (node != tree) {
6273 while (node != tree) {
6274 if (node->parent != NULL)
6275 node = node->parent;
6276 if ((node != tree) && (node->next != NULL)) {
6277 node = node->next;
6280 if (node->parent == NULL) {
6281 node = NULL;
6286 if (node == tree)
6287 node = NULL;
6300 xmlGetPropNodeInternal(xmlNodePtr node, const xmlChar *name,
6305 if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
6308 if (node->properties != NULL) {
6309 prop = node->properties;
6343 if ((node->doc != NULL) && (node->doc->intSubset != NULL)) {
6344 xmlDocPtr doc = node->doc;
6351 if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
6352 tmpstr = xmlStrdup(node->ns->prefix);
6354 tmpstr = xmlStrcat(tmpstr, node->name);
6359 elemQName = (xmlChar *) node->name;
6377 nsList = xmlGetNsList(node->doc, node);
6429 * Optimization for the common case: only 1 text node.
6449 * @node: the node
6452 * Search an attribute associated to a node
6460 xmlHasProp(xmlNodePtr node, const xmlChar *name) {
6464 if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
6467 * Check on the properties attached to the node
6469 prop = node->properties;
6482 doc = node->doc;
6486 attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
6488 attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
6500 * @node: the node
6504 * Search for an attribute associated to a node
6515 xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
6517 return(xmlGetPropNodeInternal(node, name, nameSpace, xmlCheckDTD));
6522 * @node: the node
6525 * Search and get the value of an attribute associated to a node
6537 xmlGetProp(xmlNodePtr node, const xmlChar *name) {
6540 prop = xmlHasProp(node, name);
6548 * @node: the node
6551 * Search and get the value of an attribute associated to a node
6562 xmlGetNoNsProp(xmlNodePtr node, const xmlChar *name) {
6565 prop = xmlGetPropNodeInternal(node, name, NULL, xmlCheckDTD);
6573 * @node: the node
6577 * Search and get the value of an attribute associated to a node
6587 xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
6590 prop = xmlGetPropNodeInternal(node, name, nameSpace, xmlCheckDTD);
6599 * @node: the node
6602 * Remove an attribute carried by a node.
6607 xmlUnsetProp(xmlNodePtr node, const xmlChar *name) {
6610 prop = xmlGetPropNodeInternal(node, name, NULL, 0);
6620 * @node: the node
6624 * Remove an attribute carried by a node.
6628 xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) {
6631 prop = xmlGetPropNodeInternal(node, name, (ns != NULL) ? ns->href : NULL, 0);
6643 * @node: the node
6647 * Set (or reset) an attribute carried by a node.
6656 xmlSetProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value) {
6660 if ((node == NULL) || (name == NULL) || (node->type != XML_ELEMENT_NODE))
6670 ns = xmlSearchNs(node->doc, node, prefix);
6674 return(xmlSetNsProp(node, ns, nqname, value));
6676 return(xmlSetNsProp(node, NULL, name, value));
6681 * @node: the node
6686 * Set (or reset) an attribute carried by a node.
6692 xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
6699 prop = xmlGetPropNodeInternal(node, name, (ns != NULL) ? ns->href : NULL, 0);
6705 xmlRemoveID(node->doc, prop);
6717 xmlTreeErr(XML_TREE_NOT_UTF8, (xmlNodePtr) node->doc,
6719 if (node->doc != NULL)
6720 node->doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
6722 prop->children = xmlNewDocText(node->doc, value);
6733 xmlAddID(NULL, node->doc, value, prop);
6739 return(xmlNewPropInternal(node, ns, name, value, 0));
6746 * @node: the node
6748 * Is this node a Text node ?
6752 xmlNodeIsText(xmlNodePtr node) {
6753 if (node == NULL) return(0);
6755 if (node->type == XML_TEXT_NODE) return(1);
6761 * @node: the node
6763 * Checks whether this node is an empty or whitespace only
6764 * (and possibly ignorable) text-node.
6769 xmlIsBlankNode(xmlNodePtr node) {
6771 if (node == NULL) return(0);
6773 if ((node->type != XML_TEXT_NODE) &&
6774 (node->type != XML_CDATA_SECTION_NODE))
6776 if (node->content == NULL) return(1);
6777 cur = node->content;
6788 * @node: the node
6792 * Concat the given string at the end of the existing node content
6798 xmlTextConcat(xmlNodePtr node, const xmlChar *content, int len) {
6799 if (node == NULL) return(-1);
6801 if ((node->type != XML_TEXT_NODE) &&
6802 (node->type != XML_CDATA_SECTION_NODE) &&
6803 (node->type != XML_COMMENT_NODE) &&
6804 (node->type != XML_PI_NODE)) {
6807 "xmlTextConcat: node is not text nor CDATA\n");
6812 if ((nodenode->properties)) ||
6813 ((node->doc != NULL) && (node->doc->dict != NULL) &&
6814 xmlDictOwns(node->doc->dict, node->content))) {
6815 node->content = xmlStrncatNew(node->content, content, len);
6817 node->content = xmlStrncat(node->content, content, len);
6819 node->properties = NULL;
6820 if (node->content == NULL)
7589 * >= 0 == @node's ns-decls
7845 * @node: the node to start with
7853 xmlNodePtr node)
7865 cur = node;
7973 * @node: the node to be removed.
7976 * Unlinks the given node from its owner.
7977 * This will substitute ns-references to node->nsDef for
7983 * Returns 0 on success, 1 if the node is not supported,
7988 xmlNodePtr node, int options ATTRIBUTE_UNUSED)
7994 if ((node == NULL) || (doc == NULL) || (node->doc != doc))
7998 if (node->parent == NULL)
8001 switch (node->type) {
8007 xmlUnlinkNode(node);
8015 xmlUnlinkNode(node);
8020 switch (node->type) {
8022 if ((ctxt == NULL) && (node->nsDef != NULL)) {
8023 ns = node->nsDef;
8033 if (node->ns != NULL) {
8039 if (node->ns == list[j]) {
8040 node->ns = list[++j];
8054 ns = xmlDOMWrapStoreNs(doc, node->ns->href,
8055 node->ns->prefix);
8064 &nbList, node->ns, ns) == -1)
8067 node->ns = ns;
8069 if ((node->type == XML_ELEMENT_NODE) &&
8070 (node->properties != NULL)) {
8071 node = (xmlNodePtr) node->properties;
8079 if ((node->type == XML_ELEMENT_NODE) &&
8080 (node->children != NULL)) {
8081 node = node->children;
8085 if (node == NULL)
8087 if (node->next != NULL)
8088 node = node->next;
8090 node = node->parent;
8093 } while (node != NULL);
8108 * @node: the start node
8114 * the given @nsName in the ancestor-or-self axis of @node.
8120 xmlSearchNsByNamespaceStrict(xmlDocPtr doc, xmlNodePtr node,
8137 cur = node;
8178 ret = xmlNsInScope(doc, node, prev, ns->prefix);
8209 * @node: the start node
8214 * the given @nsName in the ancestor-or-self axis of @node.
8220 xmlSearchNsByPrefixStrict(xmlDocPtr doc, xmlNodePtr node,
8227 if ((doc == NULL) || (node == NULL))
8240 cur = node;
8272 * @elem: the element-node to declare on
8344 * @elem: the element-node to declare namespaces on
8433 * Store ns-decls in "oldNs" of the document-node.
8488 * @elem: the element-node
8572 * Remove the ns-decl from the element-node.
8747 * @node: the element-node to start with
8749 * @destParent: the optional new parent of @node in @destDoc
8768 xmlNodePtr node,
8811 cur = node;
8828 (cur->doc == node->doc))
8832 if (cur->doc != node->doc)
8852 * since they won't be referenced by node->ns.
8957 * Further node properties.
8970 * Process first attribute node.
8998 * Remove reference to the entitity-node.
9006 * Assign new entity-node if available.
9034 if (cur == node)
9104 * @node: the node to start with
9105 * @resNode: the clone of the given @node
9107 * @destParent: the optional new parent of @node in @destDoc
9126 * 1 if a node of unsupported (or not yet supported) type was given,
9133 xmlNodePtr node,
9159 if ((node == NULL) || (resNode == NULL) || (destDoc == NULL))
9164 if (node->type != XML_ELEMENT_NODE)
9167 * Check node->doc sanity.
9169 if ((node->doc != NULL) && (sourceDoc != NULL) &&
9170 (node->doc != sourceDoc)) {
9172 * Might be an XIncluded node.
9177 sourceDoc = node->doc;
9190 cur = node;
9201 * Create a new node.
9224 xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating a node");
9248 xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node");
9277 * Clone the name of the node if any.
9283 * NOTE: Although xmlStringTextNoenc is never assigned to a node
9347 * since they won't be referenced by node->ns.
9400 * Different doc: Assign new entity-node if available.
9411 * Same doc: Use the current node's entity declaration
9549 * At this point we are done with the node, its content
9552 if (cur == node)
9630 * TODO: Should we try a cleanup of the cloned node in case of a
9641 * @attr: the attribute-node to be adopted
9717 * Remove reference to the entitity-node.
9725 * Assign new entity-node if available.
9761 * @node: the node to start with
9763 * @destParent: the optional new parent of @node in @destDoc
9769 * This is the case when you have an unliked node and just want to move it
9780 * 1 if a node of unsupported type was given,
9781 * 2 if a node of not yet supported type was given and
9787 xmlNodePtr node,
9792 if ((node == NULL) || (destDoc == NULL) ||
9796 * Check node->doc sanity.
9798 if ((node->doc != NULL) && (sourceDoc != NULL) &&
9799 (node->doc != sourceDoc)) {
9801 * Might be an XIncluded node.
9806 sourceDoc = node->doc;
9809 switch (node->type) {
9825 * Unlink only if @node was not already added to @destParent.
9827 if ((node->parent != NULL) && (destParent != node->parent))
9828 xmlUnlinkNode(node);
9830 if (node->type == XML_ELEMENT_NODE) {
9831 return (xmlDOMWrapAdoptBranch(ctxt, sourceDoc, node,
9833 } else if (node->type == XML_ATTRIBUTE_NODE) {
9835 (xmlAttrPtr) node, destDoc, destParent, options));
9837 xmlNodePtr cur = node;
9847 switch (node->type) {
9850 XML_TREE_ADOPT_STR_2(node->content)
9854 * Remove reference to the entitity-node.
9856 node->content = NULL;
9857 node->children = NULL;
9858 node->last = NULL;
9862 * Assign new entity-node if available.
9864 ent = xmlGetDocEntity(destDoc, node->name);
9866 node->content = ent->content;
9867 node->children = (xmlNodePtr) ent;
9868 node->last = (xmlNodePtr) ent;
9871 XML_TREE_ADOPT_STR(node->name)
9874 XML_TREE_ADOPT_STR(node->name)
9875 XML_TREE_ADOPT_STR_2(node->content)