UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
node.cpp
Go to the documentation of this file.
1/*******************************************************************************
2 *
3 * Copyright (c) 2000-2003 Intel Corporation
4 * All rights reserved.
5 * Copyright (c) 2012 France Telecom All rights reserved.
6 * Copyright (C) 2022+ GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
7 * Redistribution only with this Copyright remark. Last modified: 2025-05-29
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * - Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * - Neither name of Intel Corporation nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 ******************************************************************************/
38#include <ixml/ixmlparser.hpp>
39
40#include <cassert>
41#include <cstring>
42
43void ixmlNode_init(IXML_Node* nodeptr) {
44 assert(nodeptr != NULL);
45
46 memset(nodeptr, 0, sizeof(IXML_Node));
47}
48
50 memset(nodeptr, 0, sizeof(IXML_CDATASection));
51}
52
54 if (nodeptr != NULL) {
55 ixmlNode_free((IXML_Node*)nodeptr);
56 }
57}
58
64 IXML_Node* nodeptr) {
65 IXML_Element* element = NULL;
66
67 if (nodeptr != NULL) {
68 if (nodeptr->nodeName != NULL) {
69 free(nodeptr->nodeName);
70 }
71 if (nodeptr->nodeValue != NULL) {
72 free(nodeptr->nodeValue);
73 }
74 if (nodeptr->namespaceURI != NULL) {
75 free(nodeptr->namespaceURI);
76 }
77 if (nodeptr->prefix != NULL) {
78 free(nodeptr->prefix);
79 }
80 if (nodeptr->localName != NULL) {
81 free(nodeptr->localName);
82 }
83 switch (nodeptr->nodeType) {
84 case eELEMENT_NODE:
85 element = (IXML_Element*)nodeptr;
86 free(element->tagName);
87 break;
88 default:
89 break;
90 }
91 free(nodeptr);
92 }
93}
94
95#if 0
96/*
97 * Old implementation of ixmlNode_free(). Due to its recursive nature, it was
98 * succeptible to attacks overflowing the stack.
99 *
100 * void ixmlNode_free(IXML_Node *nodeptr)
101 */
102void ixmlNode_recursive_free(IXML_Node *nodeptr)
103{
104 if (nodeptr != NULL) {
105#ifdef IXML_HAVE_SCRIPTSUPPORT
106 IXML_BeforeFreeNode_t hndlr = Parser_getBeforeFree();
107 if (hndlr != NULL) hndlr(nodeptr);
108#endif
109 ixmlNode_free(nodeptr->firstChild);
110 ixmlNode_free(nodeptr->nextSibling);
111 ixmlNode_free(nodeptr->firstAttr);
113 }
114}
115#endif
116
117/*
118 * void ixmlNode_non_recursive_free(IXML_Node *nodeptr)
119 */
120void ixmlNode_free(IXML_Node* nodeptr) {
121 IXML_Node* curr_child;
122 IXML_Node* prev_child;
123 IXML_Node* next_child;
124 IXML_Node* curr_attr;
125 IXML_Node* next_attr;
126
127 if (nodeptr) {
128#ifdef IXML_HAVE_SCRIPTSUPPORT
129 IXML_BeforeFreeNode_t hndlr = Parser_getBeforeFree();
130#endif
131 prev_child = nodeptr;
132 next_child = nodeptr->firstChild;
133 do {
134 curr_child = next_child;
135 do {
136 while (curr_child) {
137 prev_child = curr_child;
138 curr_child = curr_child->firstChild;
139 }
140 curr_child = prev_child;
141 while (curr_child) {
142 prev_child = curr_child;
143 curr_child = curr_child->nextSibling;
144 }
145 curr_child = prev_child;
146 next_child = curr_child->firstChild;
147 } while (next_child);
148 curr_child = prev_child;
149 /* current is now the last sibling of the last child. */
150 /* Delete the attribute nodes of this child */
151 /* Attribute nodes only have siblings. */
152 curr_attr = curr_child->firstAttr;
153 while (curr_attr) {
154 next_attr = curr_attr->nextSibling;
155 ixmlNode_freeSingleNode(curr_attr);
156 curr_attr = next_attr;
157 }
158 curr_child->firstAttr = 0;
159 /* Return */
160 if (curr_child != nodeptr) {
161 if (curr_child->prevSibling) {
162 next_child = curr_child->prevSibling;
163 next_child->nextSibling = 0;
164 } else {
165 next_child = curr_child->parentNode;
166 next_child->firstChild = 0;
167 }
168 }
169#ifdef IXML_HAVE_SCRIPTSUPPORT
170 if (hndlr) {
171 hndlr(curr_child);
172 }
173#endif
174 ixmlNode_freeSingleNode(curr_child);
175 } while (curr_child != nodeptr);
176 }
177}
178
180 if (nodeptr != NULL) {
181 return nodeptr->nodeName;
182 }
183
184 return NULL;
185}
186
188 if (nodeptr != NULL) {
189 return nodeptr->localName;
190 }
191
192 return NULL;
193}
194
200 IXML_Node* nodeptr,
202 const char* namespaceURI) {
203 if (nodeptr == NULL) {
204 return IXML_INVALID_PARAMETER;
205 }
206
207 if (nodeptr->namespaceURI != NULL) {
208 free(nodeptr->namespaceURI);
209 nodeptr->namespaceURI = NULL;
210 }
211
212 if (namespaceURI != NULL) {
213 nodeptr->namespaceURI = strdup(namespaceURI);
214 if (nodeptr->namespaceURI == NULL) {
215 return IXML_INSUFFICIENT_MEMORY;
216 }
217 }
218
219 return IXML_SUCCESS;
220}
221
227 IXML_Node* nodeptr,
229 const char* prefix) {
230 if (nodeptr == NULL) {
231 return IXML_INVALID_PARAMETER;
232 }
233
234 if (nodeptr->prefix != NULL) {
235 free(nodeptr->prefix);
236 nodeptr->prefix = NULL;
237 }
238
239 if (prefix != NULL) {
240 nodeptr->prefix = strdup(prefix);
241 if (nodeptr->prefix == NULL) {
242 return IXML_INSUFFICIENT_MEMORY;
243 }
244 }
245
246 return IXML_SUCCESS;
247}
248
256 IXML_Node* nodeptr,
258 const char* localName) {
259 assert(nodeptr != NULL);
260
261 if (nodeptr->localName != NULL) {
262 free(nodeptr->localName);
263 nodeptr->localName = NULL;
264 }
265
266 if (localName != NULL) {
267 nodeptr->localName = strdup(localName);
268 if (nodeptr->localName == NULL) {
269 return IXML_INSUFFICIENT_MEMORY;
270 }
271 }
272
273 return IXML_SUCCESS;
274}
275
277 DOMString retNamespaceURI = NULL;
278
279 if (nodeptr != NULL) {
280 retNamespaceURI = nodeptr->namespaceURI;
281 }
282
283 return retNamespaceURI;
284}
285
287 const DOMString prefix = NULL;
288
289 if (nodeptr != NULL) {
290 prefix = nodeptr->prefix;
291 }
292
293 return prefix;
294}
295
297 if (nodeptr != NULL) {
298 return nodeptr->nodeValue;
299 }
300
301 return NULL;
302}
303
304int ixmlNode_setNodeValue(IXML_Node* nodeptr, const char* newNodeValue) {
305 int rc = IXML_SUCCESS;
306
307 if (nodeptr == NULL) {
308 return IXML_INVALID_PARAMETER;
309 }
310
311 if (nodeptr->nodeValue != NULL) {
312 free(nodeptr->nodeValue);
313 nodeptr->nodeValue = NULL;
314 }
315
316 if (newNodeValue != NULL) {
317 nodeptr->nodeValue = strdup(newNodeValue);
318 if (nodeptr->nodeValue == NULL) {
319 return IXML_INSUFFICIENT_MEMORY;
320 }
321 }
322
323 return rc;
324}
325
326unsigned short ixmlNode_getNodeType(IXML_Node* nodeptr) {
327 if (nodeptr != NULL) {
328 return static_cast<unsigned short>(nodeptr->nodeType);
329 } else {
330 return static_cast<unsigned short>(eINVALID_NODE);
331 }
332}
333
335 if (nodeptr != NULL) {
336 return nodeptr->parentNode;
337 } else {
338 return NULL;
339 }
340}
341
343 if (nodeptr != NULL) {
344 return nodeptr->firstChild;
345 } else {
346 return NULL;
347 }
348}
349
351 IXML_Node* prev;
352 IXML_Node* next;
353
354 if (nodeptr != NULL) {
355 prev = nodeptr;
356 next = nodeptr->firstChild;
357 while (next != NULL) {
358 prev = next;
359 next = next->nextSibling;
360 }
361 return prev;
362 } else {
363 return NULL;
364 }
365}
366
368 if (nodeptr != NULL) {
369 return nodeptr->prevSibling;
370 } else {
371 return NULL;
372 }
373}
374
376 if (nodeptr != NULL) {
377 return nodeptr->nextSibling;
378 } else {
379 return NULL;
380 }
381}
382
384 if (nodeptr != NULL) {
385 return (IXML_Document*)nodeptr->ownerDocument;
386 } else {
387 return NULL;
388 }
389}
390
398 IXML_Node* ancestorNode,
400 IXML_Node* toFind) {
401 int found = 0;
402
403 if (ancestorNode != NULL && toFind != NULL) {
404 if (toFind->parentNode == ancestorNode) {
405 return 1;
406 } else {
407 found = ixmlNode_isAncestor(ancestorNode->firstChild, toFind);
408 if (found == 0) {
409 found = ixmlNode_isAncestor(ancestorNode->nextSibling, toFind);
410 }
411 }
412 }
413
414 return found;
415}
416
424 IXML_Node* nodeptr,
426 IXML_Node* toFind) {
427 int found = 0;
428
429 assert(nodeptr != NULL && toFind != NULL);
430
431 if (nodeptr != NULL && toFind != NULL)
432 found = toFind->parentNode == nodeptr;
433
434 return found;
435}
436
446 IXML_Node* nodeptr,
448 IXML_Node* newChild) {
449 assert(nodeptr != NULL && newChild != NULL);
450
451 switch (nodeptr->nodeType) {
452 case eATTRIBUTE_NODE:
453 case eTEXT_NODE:
454 case eCDATA_SECTION_NODE:
455 return 0;
456
457 case eELEMENT_NODE:
458 switch (newChild->nodeType) {
459 case eATTRIBUTE_NODE:
460 case eDOCUMENT_NODE:
461 return 0;
462 default:
463 break;
464 }
465 break;
466
467 case eDOCUMENT_NODE:
468 switch (newChild->nodeType) {
469 case eELEMENT_NODE:
470 break;
471 default:
472 return 0;
473 }
474
475 default:
476 break;
477 }
478
479 return 1;
480}
481
492 IXML_Node* srcNode,
494 IXML_Node* destNode) {
495 assert(srcNode != NULL && destNode != NULL);
496
497 return srcNode == destNode ||
498 (strcmp(srcNode->nodeName, destNode->nodeName) == 0 &&
499 strcmp(srcNode->nodeValue, destNode->nodeValue) == 0 &&
500 srcNode->nodeType == destNode->nodeType &&
501 strcmp(srcNode->namespaceURI, destNode->namespaceURI) == 0 &&
502 strcmp(srcNode->prefix, destNode->prefix) == 0 &&
503 strcmp(srcNode->localName, destNode->localName) == 0);
504}
505
507 IXML_Node* refChild) {
508 int ret = IXML_SUCCESS;
509
510 if (nodeptr == NULL || newChild == NULL) {
511 return IXML_INVALID_PARAMETER;
512 }
513 /* whether nodeptr allow children of the type of newChild */
514 if (ixmlNode_allowChildren(nodeptr, newChild) == 0) {
515 return IXML_HIERARCHY_REQUEST_ERR;
516 }
517 /* or if newChild is one of nodeptr's ancestors */
518 if (ixmlNode_isAncestor(newChild, nodeptr)) {
519 return IXML_HIERARCHY_REQUEST_ERR;
520 }
521 /* if newChild was created from a different document */
522 if (nodeptr->ownerDocument != newChild->ownerDocument) {
523 return IXML_WRONG_DOCUMENT_ERR;
524 }
525 /* if refChild is not a child of nodeptr */
526 if (ixmlNode_isParent(nodeptr, refChild) == 0) {
527 return IXML_NOT_FOUND_ERR;
528 }
529
530 if (refChild != NULL) {
531 if (ixmlNode_isParent(nodeptr, newChild)) {
532 ixmlNode_removeChild(nodeptr, newChild, &newChild);
533 newChild->nextSibling = NULL;
534 newChild->prevSibling = NULL;
535 }
536 newChild->nextSibling = refChild;
537 if (refChild->prevSibling != NULL) {
538 refChild->prevSibling->nextSibling = newChild;
539 newChild->prevSibling = refChild->prevSibling;
540 }
541 refChild->prevSibling = newChild;
542 if (newChild->prevSibling == NULL) {
543 nodeptr->firstChild = newChild;
544 }
545 newChild->parentNode = nodeptr;
546 } else {
547 ret = ixmlNode_appendChild(nodeptr, newChild);
548 }
549
550 return ret;
551}
552
554 IXML_Node* oldChild, IXML_Node** returnNode) {
555 int ret = IXML_SUCCESS;
556
557 if (nodeptr == NULL || newChild == NULL || oldChild == NULL) {
558 return IXML_INVALID_PARAMETER;
559 }
560 /* if nodetype of nodeptr does not allow children of the type of
561 * newChild needs to add later or if newChild is one of nodeptr's
562 * ancestors */
563 if (ixmlNode_isAncestor(newChild, nodeptr)) {
564 return IXML_HIERARCHY_REQUEST_ERR;
565 }
566
567 if (ixmlNode_allowChildren(nodeptr, newChild) == 0) {
568 return IXML_HIERARCHY_REQUEST_ERR;
569 }
570 /* if newChild was created from a different document */
571 if (nodeptr->ownerDocument != newChild->ownerDocument) {
572 return IXML_WRONG_DOCUMENT_ERR;
573 }
574 /* if refChild is not a child of nodeptr */
575 if (ixmlNode_isParent(nodeptr, oldChild) != 1) {
576 return IXML_NOT_FOUND_ERR;
577 }
578
579 ret = ixmlNode_insertBefore(nodeptr, newChild, oldChild);
580 if (ret != IXML_SUCCESS) {
581 return ret;
582 }
583
584 ret = ixmlNode_removeChild(nodeptr, oldChild, returnNode);
585 return ret;
586}
587
589 IXML_Node** returnNode) {
590 if (!nodeptr || !oldChild)
591 return IXML_INVALID_PARAMETER;
592 if (!ixmlNode_isParent(nodeptr, oldChild))
593 return IXML_NOT_FOUND_ERR;
594 if (oldChild->prevSibling)
595 oldChild->prevSibling->nextSibling = oldChild->nextSibling;
596 if (nodeptr->firstChild == oldChild)
597 nodeptr->firstChild = oldChild->nextSibling;
598 if (oldChild->nextSibling)
599 oldChild->nextSibling->prevSibling = oldChild->prevSibling;
600 oldChild->nextSibling = NULL;
601 oldChild->prevSibling = NULL;
602 oldChild->parentNode = NULL;
603 if (returnNode)
604 *returnNode = oldChild;
605 else
606 ixmlNode_free(oldChild);
607
608 return IXML_SUCCESS;
609}
610
611int ixmlNode_appendChild(IXML_Node* nodeptr, IXML_Node* newChild) {
612 IXML_Node* prev = NULL;
613 IXML_Node* next = NULL;
614
615 if (nodeptr == NULL || newChild == NULL) {
616 return IXML_INVALID_PARAMETER;
617 }
618 /* if newChild was created from a different document */
619 if (newChild->ownerDocument != NULL &&
620 nodeptr->ownerDocument != newChild->ownerDocument) {
621 return IXML_WRONG_DOCUMENT_ERR;
622 }
623 /* if newChild is an ancestor of nodeptr */
624 if (ixmlNode_isAncestor(newChild, nodeptr)) {
625 return IXML_HIERARCHY_REQUEST_ERR;
626 }
627 /* if nodeptr does not allow to have newChild as children */
628 if (ixmlNode_allowChildren(nodeptr, newChild) == 0) {
629 return IXML_HIERARCHY_REQUEST_ERR;
630 }
631
632 if (ixmlNode_isParent(nodeptr, newChild)) {
633 ixmlNode_removeChild(nodeptr, newChild, &newChild);
634 }
635 /* set the parent node pointer */
636 newChild->parentNode = nodeptr;
637 newChild->ownerDocument = nodeptr->ownerDocument;
638
639 /* if the first child */
640 if (nodeptr->firstChild == NULL) {
641 nodeptr->firstChild = newChild;
642 } else {
643 prev = nodeptr->firstChild;
644 next = prev->nextSibling;
645 while (next != NULL) {
646 prev = next;
647 next = prev->nextSibling;
648 }
649 prev->nextSibling = newChild;
650 newChild->prevSibling = prev;
651 }
652
653 return IXML_SUCCESS;
654}
655
663 IXML_Node* nodeptr) {
664 IXML_Node* newNode = NULL;
665 int rc;
666
667 assert(nodeptr != NULL);
668
669 newNode = (IXML_Node*)malloc(sizeof(IXML_Node));
670 if (newNode == NULL) {
671 return NULL;
672 } else {
673 ixmlNode_init(newNode);
674 rc = ixmlNode_setNodeName(newNode, nodeptr->nodeName);
675 if (rc != IXML_SUCCESS) {
676 ixmlNode_free(newNode);
677 return NULL;
678 }
679 rc = ixmlNode_setNodeValue(newNode, nodeptr->nodeValue);
680 if (rc != IXML_SUCCESS) {
681 ixmlNode_free(newNode);
682 return NULL;
683 }
684 newNode->nodeType = eTEXT_NODE;
685 }
686
687 return newNode;
688}
689
697 IXML_CDATASection* nodeptr) {
698 IXML_CDATASection* newCDATA = NULL;
699 IXML_Node* newNode;
700 IXML_Node* srcNode;
701 int rc;
702
703 assert(nodeptr != NULL);
704 newCDATA = (IXML_CDATASection*)malloc(sizeof(IXML_CDATASection));
705 if (newCDATA != NULL) {
706 newNode = (IXML_Node*)newCDATA;
707 ixmlCDATASection_init(newCDATA);
708 srcNode = (IXML_Node*)nodeptr;
709 rc = ixmlNode_setNodeName(newNode, srcNode->nodeName);
710 if (rc != IXML_SUCCESS) {
711 ixmlCDATASection_free(newCDATA);
712 return NULL;
713 }
714 rc = ixmlNode_setNodeValue(newNode, srcNode->nodeValue);
715 if (rc != IXML_SUCCESS) {
716 ixmlCDATASection_free(newCDATA);
717 return NULL;
718 }
719 newNode->nodeType = eCDATA_SECTION_NODE;
720 }
721
722 return newCDATA;
723}
724
732 IXML_Element* nodeptr) {
733 IXML_Element* newElement;
734 IXML_Node* elementNode;
735 IXML_Node* srcNode;
736 int rc;
737
738 assert(nodeptr != NULL);
739
740 newElement = (IXML_Element*)malloc(sizeof(IXML_Element));
741 if (newElement == NULL) {
742 return NULL;
743 }
744
745 ixmlElement_init(newElement);
746 rc = ixmlElement_setTagName(newElement, nodeptr->tagName);
747 if (rc != IXML_SUCCESS) {
748 ixmlElement_free(newElement);
749 return NULL;
750 }
751
752 elementNode = (IXML_Node*)newElement;
753 srcNode = (IXML_Node*)nodeptr;
754 rc = ixmlNode_setNodeName(elementNode, srcNode->nodeName);
755 if (rc != IXML_SUCCESS) {
756 ixmlElement_free(newElement);
757 return NULL;
758 }
759
760 rc = ixmlNode_setNodeValue(elementNode, srcNode->nodeValue);
761 if (rc != IXML_SUCCESS) {
762 ixmlElement_free(newElement);
763 return NULL;
764 }
765
766 rc = ixmlNode_setNamespaceURI(elementNode, srcNode->namespaceURI);
767 if (rc != IXML_SUCCESS) {
768 ixmlElement_free(newElement);
769 return NULL;
770 }
771
772 rc = ixmlNode_setPrefix(elementNode, srcNode->prefix);
773 if (rc != IXML_SUCCESS) {
774 ixmlElement_free(newElement);
775 return NULL;
776 }
777
778 rc = ixmlNode_setLocalName(elementNode, srcNode->localName);
779 if (rc != IXML_SUCCESS) {
780 ixmlElement_free(newElement);
781 return NULL;
782 }
783
784 elementNode->nodeType = eELEMENT_NODE;
785
786 return newElement;
787}
788
798 IXML_Document* newDoc;
799 IXML_Node* docNode;
800 int rc;
801
802 newDoc = (IXML_Document*)malloc(sizeof(IXML_Document));
803 if (!newDoc)
804 return NULL;
805 ixmlDocument_init(newDoc);
806 docNode = (IXML_Node*)newDoc;
808 if (rc != IXML_SUCCESS) {
809 ixmlDocument_free(newDoc);
810 return NULL;
811 }
812 newDoc->n.nodeType = eDOCUMENT_NODE;
813
814 return newDoc;
815}
816
824 IXML_Attr* nodeptr) {
825 IXML_Attr* newAttr;
826 IXML_Node* attrNode;
827 IXML_Node* srcNode;
828 int rc;
829
830 assert(nodeptr != NULL);
831
832 newAttr = (IXML_Attr*)malloc(sizeof(IXML_Attr));
833 if (newAttr == NULL) {
834 return NULL;
835 }
836
837 ixmlAttr_init(newAttr);
838 attrNode = (IXML_Node*)newAttr;
839 srcNode = (IXML_Node*)nodeptr;
840
841 rc = ixmlNode_setNodeName(attrNode, srcNode->nodeName);
842 if (rc != IXML_SUCCESS) {
843 ixmlAttr_free(newAttr);
844 return NULL;
845 }
846
847 rc = ixmlNode_setNodeValue(attrNode, srcNode->nodeValue);
848 if (rc != IXML_SUCCESS) {
849 ixmlAttr_free(newAttr);
850 return NULL;
851 }
852
853 /* Check to see whether we need to split prefix and localname for
854 * attribute */
855 rc = ixmlNode_setNamespaceURI(attrNode, srcNode->namespaceURI);
856 if (rc != IXML_SUCCESS) {
857 ixmlAttr_free(newAttr);
858 return NULL;
859 }
860
861 rc = ixmlNode_setPrefix(attrNode, srcNode->prefix);
862 if (rc != IXML_SUCCESS) {
863 ixmlAttr_free(newAttr);
864 return NULL;
865 }
866
867 rc = ixmlNode_setLocalName(attrNode, srcNode->localName);
868 if (rc != IXML_SUCCESS) {
869 ixmlAttr_free(newAttr);
870 return NULL;
871 }
872
873 attrNode->nodeType = eATTRIBUTE_NODE;
874
875 return newAttr;
876}
877
885 IXML_Attr* nodeptr) {
886 IXML_Attr* newAttr;
887
888 assert(nodeptr != NULL);
889
890 newAttr = ixmlNode_cloneAttr(nodeptr);
891 if (newAttr != NULL) {
892 newAttr->specified = 1;
893 }
894
895 return newAttr;
896}
897
903 IXML_Node* nodeptr) {
904 IXML_Node* parentNode = nodeptr->parentNode;
905 IXML_Node* nextptr = nodeptr->nextSibling;
906
907 while (nextptr != NULL) {
908 nextptr->parentNode = parentNode;
909 nextptr = nextptr->nextSibling;
910 }
911}
912
920 IXML_Node* nodeptr,
922 int deep) {
923 IXML_Node* newNode = NULL;
924 IXML_Element* newElement = NULL;
925 IXML_Attr* newAttr = NULL;
926 IXML_CDATASection* newCDATA = NULL;
927 IXML_Document* newDoc = NULL;
928 IXML_Node* nextSib = NULL;
929
930 if (nodeptr != NULL) {
931 switch (nodeptr->nodeType) {
932 case eELEMENT_NODE:
933 newElement = ixmlNode_cloneElement((IXML_Element*)nodeptr);
934 if (newElement == NULL)
935 return NULL;
936 newElement->n.firstAttr =
937 ixmlNode_cloneNodeTreeRecursive(nodeptr->firstAttr, deep);
938 if (deep) {
939 newElement->n.firstChild =
940 ixmlNode_cloneNodeTreeRecursive(nodeptr->firstChild, deep);
941 if (newElement->n.firstChild != NULL) {
942 newElement->n.firstChild->parentNode =
943 (IXML_Node*)newElement;
944 ixmlNode_setSiblingNodesParent(newElement->n.firstChild);
945 }
946 nextSib =
947 ixmlNode_cloneNodeTreeRecursive(nodeptr->nextSibling, deep);
948 newElement->n.nextSibling = nextSib;
949 if (nextSib != NULL) {
950 nextSib->prevSibling = (IXML_Node*)newElement;
951 }
952 }
953 newNode = (IXML_Node*)newElement;
954 break;
955
956 case eATTRIBUTE_NODE:
957 newAttr = ixmlNode_cloneAttr((IXML_Attr*)nodeptr);
958 if (newAttr == NULL)
959 return NULL;
960 nextSib =
961 ixmlNode_cloneNodeTreeRecursive(nodeptr->nextSibling, deep);
962 newAttr->n.nextSibling = nextSib;
963 if (nextSib != NULL) {
964 nextSib->prevSibling = (IXML_Node*)newAttr;
965 }
966 newNode = (IXML_Node*)newAttr;
967 break;
968
969 case eTEXT_NODE:
970 newNode = ixmlNode_cloneTextNode(nodeptr);
971 break;
972
973 case eCDATA_SECTION_NODE:
974 newCDATA = ixmlNode_cloneCDATASect((IXML_CDATASection*)nodeptr);
975 newNode = (IXML_Node*)newCDATA;
976 break;
977
978 case eDOCUMENT_NODE:
979 newDoc = ixmlNode_newDoc();
980 if (newDoc == NULL)
981 return NULL;
982 newNode = (IXML_Node*)newDoc;
983 if (deep) {
984 newNode->firstChild =
985 ixmlNode_cloneNodeTreeRecursive(nodeptr->firstChild, deep);
986 if (newNode->firstChild != NULL) {
987 newNode->firstChild->parentNode = newNode;
988 }
989 }
990 break;
991
992 case eINVALID_NODE:
993 case eENTITY_REFERENCE_NODE:
994 case eENTITY_NODE:
995 case ePROCESSING_INSTRUCTION_NODE:
996 case eCOMMENT_NODE:
997 case eDOCUMENT_TYPE_NODE:
998 case eDOCUMENT_FRAGMENT_NODE:
999 case eNOTATION_NODE:
1000 break;
1001 }
1002 }
1003
1004 return newNode;
1005}
1006
1014 IXML_Node* nodeptr,
1016 int deep) {
1017 IXML_Node* newNode = NULL;
1018 IXML_Element* newElement;
1019 IXML_Node* childNode;
1020
1021 assert(nodeptr != NULL);
1022
1023 switch (nodeptr->nodeType) {
1024 case eELEMENT_NODE:
1025 newElement = ixmlNode_cloneElement((IXML_Element*)nodeptr);
1026 if (newElement == NULL)
1027 return NULL;
1028 newElement->n.firstAttr =
1029 ixmlNode_cloneNodeTreeRecursive(nodeptr->firstAttr, deep);
1030 if (deep) {
1031 newElement->n.firstChild =
1032 ixmlNode_cloneNodeTreeRecursive(nodeptr->firstChild, deep);
1033 childNode = newElement->n.firstChild;
1034 while (childNode != NULL) {
1035 childNode->parentNode = (IXML_Node*)newElement;
1036 childNode = childNode->nextSibling;
1037 }
1038 newElement->n.nextSibling = NULL;
1039 }
1040 newNode = (IXML_Node*)newElement;
1041 break;
1042
1043 case eATTRIBUTE_NODE:
1044 case eTEXT_NODE:
1045 case eCDATA_SECTION_NODE:
1046 case eDOCUMENT_NODE:
1047 newNode = ixmlNode_cloneNodeTreeRecursive(nodeptr, deep);
1048 break;
1049
1050 case eINVALID_NODE:
1051 case eENTITY_REFERENCE_NODE:
1052 case eENTITY_NODE:
1053 case ePROCESSING_INSTRUCTION_NODE:
1054 case eCOMMENT_NODE:
1055 case eDOCUMENT_TYPE_NODE:
1056 case eDOCUMENT_FRAGMENT_NODE:
1057 case eNOTATION_NODE:
1058#if 0
1059 /* create a new node here? */
1060 newNode = (IXML_Node *)malloc(sizeof(IXML_Node));
1061 if (newNode == NULL) {
1062 return NULL;
1063 }
1064#endif
1065 break;
1066 }
1067
1068 /* by spec, the duplicate node has no parent */
1069 if (newNode != NULL)
1070 newNode->parentNode = NULL;
1071
1072 return newNode;
1073}
1074
1076 IXML_Node* newNode;
1077 IXML_Attr* newAttrNode;
1078
1079 if (nodeptr == NULL) {
1080 return NULL;
1081 }
1082
1083 switch (nodeptr->nodeType) {
1084 case eATTRIBUTE_NODE:
1085 newAttrNode = ixmlNode_cloneAttrDirect((IXML_Attr*)nodeptr);
1086 return (IXML_Node*)newAttrNode;
1087 break;
1088
1089 default:
1090 newNode = ixmlNode_cloneNodeTree(nodeptr, deep);
1091 return newNode;
1092 break;
1093 }
1094}
1095
1097 IXML_Node* tempNode;
1098 IXML_NodeList* newNodeList;
1099 int rc;
1100
1101 if (nodeptr == NULL) {
1102 return NULL;
1103 }
1104
1105 newNodeList = (IXML_NodeList*)malloc(sizeof(IXML_NodeList));
1106 if (newNodeList == NULL) {
1107 return NULL;
1108 }
1109
1110 ixmlNodeList_init(newNodeList);
1111 tempNode = nodeptr->firstChild;
1112 while (tempNode != NULL) {
1113 rc = ixmlNodeList_addToNodeList(&newNodeList, tempNode);
1114 if (rc != IXML_SUCCESS) {
1115 ixmlNodeList_free(newNodeList);
1116 return NULL;
1117 }
1118
1119 tempNode = tempNode->nextSibling;
1120 }
1121
1122 return newNodeList;
1123}
1124
1126 IXML_NamedNodeMap* returnNamedNodeMap = NULL;
1127 IXML_Node* tempNode;
1128 int rc;
1129
1130 if (nodeptr == NULL) {
1131 return NULL;
1132 }
1133
1134 switch (nodeptr->nodeType) {
1135 case eELEMENT_NODE:
1136 returnNamedNodeMap =
1137 (IXML_NamedNodeMap*)malloc(sizeof(IXML_NamedNodeMap));
1138 if (returnNamedNodeMap == NULL) {
1139 return NULL;
1140 }
1141
1142 ixmlNamedNodeMap_init(returnNamedNodeMap);
1143 tempNode = nodeptr->firstAttr;
1144 while (tempNode != NULL) {
1145 rc = ixmlNamedNodeMap_addToNamedNodeMap(&returnNamedNodeMap,
1146 tempNode);
1147 if (rc != IXML_SUCCESS) {
1148 ixmlNamedNodeMap_free(returnNamedNodeMap);
1149 return NULL;
1150 }
1151
1152 tempNode = tempNode->nextSibling;
1153 }
1154 return returnNamedNodeMap;
1155 default:
1156 /* if not an ELEMENT_NODE */
1157 return NULL;
1158 }
1159}
1160
1162 if (nodeptr == NULL) {
1163 return 0;
1164 }
1165
1166 return nodeptr->firstChild != NULL;
1167}
1168
1170 if (nodeptr != NULL) {
1171 switch (nodeptr->nodeType) {
1172 case eELEMENT_NODE:
1173 if (nodeptr->firstAttr != NULL)
1174 return 1;
1175 break;
1176 default:
1177 break;
1178 }
1179 }
1180
1181 return 0;
1182}
1183
1190 IXML_Node* n,
1192 const char* tagname,
1194 IXML_NodeList** list) {
1195 const char* name;
1196
1197 if (n != NULL) {
1198 if (ixmlNode_getNodeType(n) == eELEMENT_NODE) {
1199 name = ixmlNode_getNodeName(n);
1200 if (strcmp(tagname, name) == 0 || strcmp(tagname, "*") == 0) {
1202 }
1203 }
1205 tagname, list);
1207 tagname, list);
1208 }
1209}
1210
1211void ixmlNode_getElementsByTagName(IXML_Node* n, const char* tagname,
1212 IXML_NodeList** list) {
1213 const char* name;
1214
1215 assert(n != NULL && tagname != NULL);
1216
1217 if (ixmlNode_getNodeType(n) == eELEMENT_NODE) {
1218 name = ixmlNode_getNodeName(n);
1219 if (strcmp(tagname, name) == 0 || strcmp(tagname, "*") == 0) {
1221 }
1222 }
1224 list);
1225}
1226
1232 IXML_Node* n,
1234 const char* namespaceURI,
1236 const char* localName,
1238 IXML_NodeList** list) {
1239 const DOMString nsURI;
1240 const DOMString name;
1241
1242 if (n != NULL) {
1243 if (ixmlNode_getNodeType(n) == eELEMENT_NODE) {
1244 name = ixmlNode_getLocalName(n);
1245 nsURI = ixmlNode_getNamespaceURI(n);
1246
1247 if (name != NULL && nsURI != NULL &&
1248 (strcmp(namespaceURI, nsURI) == 0 ||
1249 strcmp(namespaceURI, "*") == 0) &&
1250 (strcmp(name, localName) == 0 || strcmp(localName, "*") == 0)) {
1252 }
1253 }
1255 namespaceURI, localName, list);
1257 namespaceURI, localName, list);
1258 }
1259}
1260
1261void ixmlNode_getElementsByTagNameNS(IXML_Node* n, const char* namespaceURI,
1262 const char* localName,
1263 IXML_NodeList** list) {
1264 const DOMString nsURI;
1265 const DOMString name;
1266
1267 assert(n != NULL && namespaceURI != NULL && localName != NULL);
1268
1269 if (ixmlNode_getNodeType(n) == eELEMENT_NODE) {
1270 name = ixmlNode_getLocalName(n);
1271 nsURI = ixmlNode_getNamespaceURI(n);
1272 if (name != NULL && nsURI != NULL &&
1273 (strcmp(namespaceURI, nsURI) == 0 ||
1274 strcmp(namespaceURI, "*") == 0) &&
1275 (strcmp(name, localName) == 0 || strcmp(localName, "*") == 0)) {
1277 }
1278 }
1279
1281 namespaceURI, localName, list);
1282}
1283
1284int ixmlNode_setNodeName(IXML_Node* node, const DOMString qualifiedName) {
1285 int rc = IXML_SUCCESS;
1286
1287 assert(node != NULL);
1288
1289 if (node->nodeName != NULL) {
1290 free(node->nodeName);
1291 node->nodeName = NULL;
1292 }
1293
1294 if (qualifiedName != NULL) {
1295 /* set the name part */
1296 node->nodeName = strdup(qualifiedName);
1297 if (node->nodeName == NULL) {
1298 return IXML_INSUFFICIENT_MEMORY;
1299 }
1300
1302 if (rc != IXML_SUCCESS) {
1303 free(node->nodeName);
1304 }
1305 }
1306
1307 return rc;
1308}
1309
1311 int rc;
1312
1313 assert(destNode != NULL && src != NULL);
1314 if (destNode == NULL || src == NULL) {
1315 return IXML_INVALID_PARAMETER;
1316 }
1317
1318 rc = ixmlNode_setNodeValue(destNode, src->nodeValue);
1319 if (rc != IXML_SUCCESS) {
1320 goto ErrorHandler;
1321 }
1322
1323 rc = ixmlNode_setLocalName(destNode, src->localName);
1324 if (rc != IXML_SUCCESS) {
1325 goto ErrorHandler;
1326 }
1327
1328 rc = ixmlNode_setPrefix(destNode, src->prefix);
1329 if (rc != IXML_SUCCESS) {
1330 goto ErrorHandler;
1331 }
1332 /* set nodetype */
1333 destNode->nodeType = src->nodeType;
1334
1335 return IXML_SUCCESS;
1336
1337ErrorHandler:
1338 if (destNode->nodeName != NULL) {
1339 free(destNode->nodeName);
1340 destNode->nodeName = NULL;
1341 }
1342 if (destNode->nodeValue != NULL) {
1343 free(destNode->nodeValue);
1344 destNode->nodeValue = NULL;
1345 }
1346 if (destNode->localName != NULL) {
1347 free(destNode->localName);
1348 destNode->localName = NULL;
1349 }
1350
1351 return IXML_INSUFFICIENT_MEMORY;
1352}
1353
1354#ifdef IXML_HAVE_SCRIPTSUPPORT
1355void ixmlNode_setCTag(IXML_Node* nodeptr, void* ctag) {
1356 if (nodeptr != NULL)
1357 nodeptr->ctag = ctag;
1358}
1359
1360void* ixmlNode_getCTag(IXML_Node* nodeptr) {
1361 if (nodeptr != NULL)
1362 return nodeptr->ctag;
1363 else
1364 return NULL;
1365}
1366#endif
Data structure representing a CDATA section node.
Definition ixml.hpp:162
Data structure common to all types of nodes.
Definition ixml.hpp:132
Data structure representing an Attribute node.
Definition ixml.hpp:177
Data structure representing a list of nodes.
Definition ixml.hpp:193
Data structure representing a list of named nodes.
Definition ixml.hpp:201
Data structure representing an Element node.
Definition ixml.hpp:169
Data structure representing the DOM Document.
Definition ixml.hpp:155
IXML_Document * ixmlNode_getOwnerDocument(IXML_Node *nodeptr)
Retrieves the document object associated with this Node.
Definition node.cpp:383
unsigned short ixmlNode_getNodeType(IXML_Node *nodeptr)
Retrieves the type of a Node. Note that not all possible return values are actually implemented.
Definition node.cpp:326
int ixmlNode_appendChild(IXML_Node *nodeptr, IXML_Node *newChild)
Appends a child Node to the list of children of a Node.
Definition node.cpp:611
int ixmlNode_setNodeValue(IXML_Node *nodeptr, const char *newNodeValue)
Assigns a new value to a Node.
Definition node.cpp:304
int ixmlNode_replaceChild(IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *oldChild, IXML_Node **returnNode)
Replaces an existing child Node with a new child Node in the list of children of a Node.
Definition node.cpp:553
PUPNP_Api void ixmlAttr_free(IXML_Attr *attrNode)
Frees an Attr node.
Definition attr.cpp:45
void ixmlCDATASection_init(IXML_CDATASection *nodeptr)
Initializes a CDATASection node.
Definition node.cpp:49
int ixmlNode_removeChild(IXML_Node *nodeptr, IXML_Node *oldChild, IXML_Node **returnNode)
Removes a child from the list of children of a Node.
Definition node.cpp:588
#define DOMString
The type of DOM strings.
Definition ixml.hpp:47
void ixmlNode_free(IXML_Node *nodeptr)
Frees a Node and all Nodes in its subtree.
Definition node.cpp:120
void ixmlCDATASection_free(IXML_CDATASection *nodeptr)
Frees a CDATASection node.
Definition node.cpp:53
IXML_Node * ixmlNode_cloneNode(IXML_Node *nodeptr, int deep)
Clones a Node.
Definition node.cpp:1075
IXML_Node * ixmlNode_getNextSibling(IXML_Node *nodeptr)
Retrieves the sibling Node immediately following this Node.
Definition node.cpp:375
PUPNP_Api void ixmlElement_init(IXML_Element *element)
Initializes a IXML_Element node.
Definition element.cpp:43
const DOMString ixmlNode_getNodeValue(IXML_Node *nodeptr)
Returns the value of the Node as a string.
Definition node.cpp:296
const DOMString ixmlNode_getNodeName(IXML_Node *nodeptr)
Returns the name of the Node, depending on what type of Node it is, in a read-only string.
Definition node.cpp:179
IXML_Node * ixmlNode_getParentNode(IXML_Node *nodeptr)
Retrieves the parent Node for a Node.
Definition node.cpp:334
PUPNP_Api void ixmlDocument_init(IXML_Document *nodeptr)
Initializes a Document node.
Definition document.cpp:43
const DOMString ixmlNode_getLocalName(IXML_Node *nodeptr)
Retrieves the local name of a Node, if present.
Definition node.cpp:187
IXML_NodeList * ixmlNode_getChildNodes(IXML_Node *nodeptr)
Retrieves the list of children of a Node in a NodeList structure.
Definition node.cpp:1096
int ixmlNode_insertBefore(IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild)
Inserts a new child Node before the existing child Node.
Definition node.cpp:506
IXML_Node * ixmlNode_getLastChild(IXML_Node *nodeptr)
Retrieves the last child Node of a Node.
Definition node.cpp:350
const DOMString ixmlNode_getPrefix(IXML_Node *nodeptr)
Retrieves the namespace prefix, if present.
Definition node.cpp:286
PUPNP_Api void ixmlNodeList_free(IXML_NodeList *nList)
Frees a NodeList object.
Definition nodeList.cpp:129
int ixmlNode_hasAttributes(IXML_Node *nodeptr)
Queries whether this Node has attributes.
Definition node.cpp:1169
IXML_Node * ixmlNode_getPreviousSibling(IXML_Node *nodeptr)
Retrieves the sibling Node immediately preceding this Node.
Definition node.cpp:367
PUPNP_Api void ixmlElement_free(IXML_Element *element)
Frees the given Element and any subtree of the Element.
Definition element.cpp:654
#define DOCUMENTNODENAME
The type of the DOM node.
Definition ixml.hpp:114
const DOMString ixmlNode_getNamespaceURI(IXML_Node *nodeptr)
Retrieves the namespace URI for a Node as a DOMString.
Definition node.cpp:276
IXML_Node * ixmlNode_getFirstChild(IXML_Node *nodeptr)
Retrieves the first child Node of a Node.
Definition node.cpp:342
IXML_NamedNodeMap * ixmlNode_getAttributes(IXML_Node *nodeptr)
Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.
Definition node.cpp:1125
PUPNP_Api void ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap)
Frees a NamedNodeMap.
int ixmlNode_hasChildNodes(IXML_Node *nodeptr)
Queries whether or not a Node has children.
Definition node.cpp:1161
PUPNP_Api void ixmlDocument_free(IXML_Document *doc)
Frees a Document object and all Nodes associated with it.
Definition document.cpp:47
int ixmlNodeList_addToNodeList(IXML_NodeList **nList, IXML_Node *add)
Add a node to nodelist.
Definition nodeList.cpp:74
void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap)
Initializes a NamedNodeMap object.
void ixmlNodeList_init(IXML_NodeList *nList)
Initializes a nodelist.
Definition nodeList.cpp:43
int ixmlElement_setTagName(IXML_Element *element, const char *tagName)
Set the given element's tagName.
Definition element.cpp:57
void ixmlAttr_init(IXML_Attr *attrNode)
ixmlAttr_init
Definition attr.cpp:39
int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr)
Set the node prefix and localName as defined by the nodeName in the form of ns:name.
int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node *add)
Add a node to a NamedNodeMap.
static void ixmlNode_setSiblingNodesParent(IXML_Node *nodeptr)
Sets siblings nodes parent to be the same as this node's.
Definition node.cpp:901
static int ixmlNode_setPrefix(IXML_Node *nodeptr, const char *prefix)
Set the prefix of the node.
Definition node.cpp:225
static int ixmlNode_allowChildren(IXML_Node *nodeptr, IXML_Node *newChild)
Check to see whether nodeptr allows children of type newChild.
Definition node.cpp:444
static IXML_CDATASection * ixmlNode_cloneCDATASect(IXML_CDATASection *nodeptr)
Return a clone of CDATASection node.
Definition node.cpp:695
int ixmlNode_setNodeProperties(IXML_Node *destNode, IXML_Node *src)
Definition node.cpp:1310
static IXML_Node * ixmlNode_cloneTextNode(IXML_Node *nodeptr)
Returns a clone of nodeptr.
Definition node.cpp:661
static void ixmlNode_freeSingleNode(IXML_Node *nodeptr)
Frees a node content.
Definition node.cpp:62
static int ixmlNode_isAncestor(IXML_Node *ancestorNode, IXML_Node *toFind)
Check if ancestorNode is ancestor of toFind.
Definition node.cpp:396
static IXML_Node * ixmlNode_cloneNodeTree(IXML_Node *nodeptr, int deep)
Function that clones a node tree of nodeptr.
Definition node.cpp:1012
int ixmlNode_compare(IXML_Node *srcNode, IXML_Node *destNode)
Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignore...
Definition node.cpp:490
static int ixmlNode_setNamespaceURI(IXML_Node *nodeptr, const char *namespaceURI)
Sets the namespace URI of the node.
Definition node.cpp:198
static IXML_Attr * ixmlNode_cloneAttrDirect(IXML_Attr *nodeptr)
Return a clone of attribute node, with specified field set to 1.
Definition node.cpp:883
static IXML_Document * ixmlNode_newDoc(void)
Returns a new document node.
Definition node.cpp:797
static void ixmlNode_getElementsByTagNameNSRecursive(IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list)
ixmlNode_getElementsByTagNameNSRecursive
Definition node.cpp:1230
void ixmlNode_getElementsByTagName(IXML_Node *n, const char *tagname, IXML_NodeList **list)
Returns a nodeList of all descendant Elements with a given tagName, in the order in which they are en...
Definition node.cpp:1211
static IXML_Node * ixmlNode_cloneNodeTreeRecursive(IXML_Node *nodeptr, int deep)
Recursive function that clones a node tree of nodeptr.
Definition node.cpp:918
static void ixmlNode_getElementsByTagNameRecursive(IXML_Node *n, const char *tagname, IXML_NodeList **list)
Recursively traverse the whole tree, search for element with the given tagname.
Definition node.cpp:1188
void ixmlNode_init(IXML_Node *nodeptr)
Intializes a node.
Definition node.cpp:43
int ixmlNode_setNodeName(IXML_Node *node, const DOMString qualifiedName)
Definition node.cpp:1284
static int ixmlNode_isParent(IXML_Node *nodeptr, IXML_Node *toFind)
Check whether toFind is a children of nodeptr.
Definition node.cpp:422
static IXML_Element * ixmlNode_cloneElement(IXML_Element *nodeptr)
Returns a clone of element node.
Definition node.cpp:730
static IXML_Attr * ixmlNode_cloneAttr(IXML_Attr *nodeptr)
Returns a clone of an attribute node.
Definition node.cpp:822
static int ixmlNode_setLocalName(IXML_Node *nodeptr, const char *localName)
Set the localName of the node.
Definition node.cpp:254
void ixmlNode_getElementsByTagNameNS(IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list)
Returns a nodeList of all the descendant Elements with a given local name and namespace URI in the or...
Definition node.cpp:1261