UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
element.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
44 if (element != NULL) {
45 memset(element, 0, sizeof(IXML_Element));
46 }
47}
48
50 if (element != NULL) {
51 return element->tagName;
52 } else {
53 return NULL;
54 }
55}
56
57int ixmlElement_setTagName(IXML_Element* element, const char* tagName) {
58 int rc = IXML_SUCCESS;
59
60 assert(element != NULL && tagName != NULL);
61
62 if (element == NULL || tagName == NULL) {
63 return IXML_FAILED;
64 }
65
66 if (element->tagName != NULL) {
67 free(element->tagName);
68 }
69 element->tagName = strdup(tagName);
70 if (element->tagName == NULL) {
71 rc = IXML_INSUFFICIENT_MEMORY;
72 }
73
74 return rc;
75}
76
78 const DOMString name) {
79 IXML_Node* attrNode;
80
81 if (element == NULL || name == NULL) {
82 return NULL;
83 }
84
85 attrNode = element->n.firstAttr;
86 while (attrNode != NULL) {
87 if (strcmp(attrNode->nodeName, name) == 0) {
88 return attrNode->nodeValue;
89 } else {
90 attrNode = attrNode->nextSibling;
91 }
92 }
93
94 return NULL;
95}
96
98 const DOMString value) {
99 IXML_Node* attrNode;
100 IXML_Attr* newAttrNode;
101 int errCode = IXML_SUCCESS;
102
103 if (element == NULL || name == NULL || value == NULL) {
104 errCode = IXML_INVALID_PARAMETER;
105 goto ErrorHandler;
106 }
107
108 if (Parser_isValidXmlName(name) == 0) {
109 errCode = IXML_INVALID_CHARACTER_ERR;
110 goto ErrorHandler;
111 }
112
113 attrNode = element->n.firstAttr;
114 while (attrNode != NULL) {
115 if (strcmp(attrNode->nodeName, name) == 0) {
116 /* Found it */
117 break;
118 } else {
119 attrNode = attrNode->nextSibling;
120 }
121 }
122
123 if (attrNode == NULL) {
124 /* Add a new attribute */
126 (IXML_Document*)element->n.ownerDocument, name, &newAttrNode);
127 if (errCode != IXML_SUCCESS) {
128 goto ErrorHandler;
129 }
130
131 attrNode = (IXML_Node*)newAttrNode;
132 attrNode->nodeValue = strdup(value);
133 if (attrNode->nodeValue == NULL) {
134 ixmlAttr_free(newAttrNode);
135 errCode = IXML_INSUFFICIENT_MEMORY;
136 goto ErrorHandler;
137 }
138
139 errCode = ixmlElement_setAttributeNode(element, newAttrNode, NULL);
140 if (errCode != IXML_SUCCESS) {
141 ixmlAttr_free(newAttrNode);
142 goto ErrorHandler;
143 }
144 } else {
145 if (attrNode->nodeValue != NULL) {
146 /* Attribute name has a value already */
147 free(attrNode->nodeValue);
148 }
149 attrNode->nodeValue = strdup(value);
150 if (attrNode->nodeValue == NULL) {
151 errCode = IXML_INSUFFICIENT_MEMORY;
152 }
153 }
154
155ErrorHandler:
156 return errCode;
157}
158
160 IXML_Node* attrNode;
161
162 if (element == NULL || name == NULL) {
163 return IXML_INVALID_PARAMETER;
164 }
165
166 attrNode = element->n.firstAttr;
167 while (attrNode != NULL) {
168 if (strcmp(attrNode->nodeName, name) == 0) {
169 /* Found it */
170 break;
171 } else {
172 attrNode = attrNode->nextSibling;
173 }
174 }
175 if (attrNode != NULL) {
176 /* Has the attribute */
177 if (attrNode->nodeValue != NULL) {
178 free(attrNode->nodeValue);
179 attrNode->nodeValue = NULL;
180 }
181 }
182
183 return IXML_SUCCESS;
184}
185
187 const DOMString name) {
188 IXML_Node* attrNode;
189
190 if (element == NULL || name == NULL) {
191 return NULL;
192 }
193
194 attrNode = element->n.firstAttr;
195 while (attrNode != NULL) {
196 if (strcmp(attrNode->nodeName, name) == 0) {
197 /* found it */
198 break;
199 } else {
200 attrNode = attrNode->nextSibling;
201 }
202 }
203
204 return (IXML_Attr*)attrNode;
205}
206
208 IXML_Attr** rtAttr) {
209 IXML_Node* attrNode = NULL;
210 IXML_Node* node = NULL;
211 IXML_Node* nextAttr = NULL;
212 IXML_Node* prevAttr = NULL;
213 IXML_Node* preSib = NULL;
214 IXML_Node* nextSib = NULL;
215
216 if (!element || !newAttr)
217 return IXML_INVALID_PARAMETER;
218 if (newAttr->n.ownerDocument != element->n.ownerDocument)
219 return IXML_WRONG_DOCUMENT_ERR;
220 if (newAttr->ownerElement)
221 return IXML_INUSE_ATTRIBUTE_ERR;
222 newAttr->ownerElement = element;
223 node = (IXML_Node*)newAttr;
224 attrNode = element->n.firstAttr;
225 while (attrNode) {
226 if (!strcmp(attrNode->nodeName, node->nodeName))
227 /* Found it */
228 break;
229 else
230 attrNode = attrNode->nextSibling;
231 }
232 if (attrNode) {
233 /* Already present, will replace by newAttr */
234 preSib = attrNode->prevSibling;
235 nextSib = attrNode->nextSibling;
236 if (preSib)
237 preSib->nextSibling = node;
238 if (nextSib)
239 nextSib->prevSibling = node;
240 if (element->n.firstAttr == attrNode)
241 element->n.firstAttr = node;
242 if (rtAttr)
243 *rtAttr = (IXML_Attr*)attrNode;
244 else
245 ixmlAttr_free((IXML_Attr*)attrNode);
246 } else {
247 /* Add this attribute */
248 if (element->n.firstAttr) {
249 prevAttr = element->n.firstAttr;
250 nextAttr = prevAttr->nextSibling;
251 while (nextAttr) {
252 prevAttr = nextAttr;
253 nextAttr = prevAttr->nextSibling;
254 }
255 prevAttr->nextSibling = node;
256 node->prevSibling = prevAttr;
257 } else {
258 /* This is the first attribute node */
259 element->n.firstAttr = node;
260 node->prevSibling = NULL;
261 node->nextSibling = NULL;
262 }
263 if (rtAttr)
264 *rtAttr = NULL;
265 }
266
267 return IXML_SUCCESS;
268}
269
278 IXML_Element* element,
280 IXML_Attr* oldAttr) {
281 IXML_Node* attrNode;
282 IXML_Node* oldAttrNode = (IXML_Node*)oldAttr;
283
284 assert(element != NULL && oldAttr != NULL);
285
286 attrNode = element->n.firstAttr;
287 while (attrNode != NULL) {
288 /* parentNode, prevSib, nextSib and ownerDocument doesn't matter
289 */
290 if (ixmlNode_compare(attrNode, oldAttrNode) == 1) {
291 /* Found it */
292 break;
293 } else {
294 attrNode = attrNode->nextSibling;
295 }
296 }
297
298 return attrNode;
299}
300
302 IXML_Attr** rtAttr) {
303 IXML_Node* attrNode;
304 IXML_Node* preSib;
305 IXML_Node* nextSib;
306
307 if (element == NULL || oldAttr == NULL) {
308 return IXML_INVALID_PARAMETER;
309 }
310
311 attrNode = ixmlElement_findAttributeNode(element, oldAttr);
312 if (attrNode != NULL) {
313 /* Has the attribute */
314 preSib = attrNode->prevSibling;
315 nextSib = attrNode->nextSibling;
316 if (preSib != NULL) {
317 preSib->nextSibling = nextSib;
318 }
319 if (nextSib != NULL) {
320 nextSib->prevSibling = preSib;
321 }
322 if (element->n.firstAttr == attrNode) {
323 element->n.firstAttr = nextSib;
324 }
325 attrNode->parentNode = NULL;
326 attrNode->prevSibling = NULL;
327 attrNode->nextSibling = NULL;
328 *rtAttr = (IXML_Attr*)attrNode;
329 return IXML_SUCCESS;
330 } else {
331 return IXML_NOT_FOUND_ERR;
332 }
333}
334
336 const DOMString tagName) {
337 IXML_NodeList* returnNodeList = NULL;
338
339 if (element != NULL && tagName != NULL) {
340 ixmlNode_getElementsByTagName((IXML_Node*)element, tagName,
341 &returnNodeList);
342 }
343 return returnNodeList;
344}
345
347 /* IN */ IXML_Element* element,
348 /* IN */ const DOMString namespaceURI,
349 /* IN */ const DOMString localName) {
350 IXML_Node* attrNode;
351
352 if (element == NULL || namespaceURI == NULL || localName == NULL) {
353 return NULL;
354 }
355
356 attrNode = element->n.firstAttr;
357 while (attrNode != NULL) {
358 if (strcmp(attrNode->localName, localName) == 0 &&
359 strcmp(attrNode->namespaceURI, namespaceURI) == 0) {
360 /* Found it */
361 return attrNode->nodeValue;
362 } else {
363 attrNode = attrNode->nextSibling;
364 }
365 }
366
367 return NULL;
368}
369
371 const DOMString namespaceURI,
372 const DOMString qualifiedName,
373 const DOMString value) {
374 IXML_Node* attrNode = NULL;
375 IXML_Node newAttrNode;
376 IXML_Attr* newAttr;
377 int rc;
378
379 if (element == NULL || namespaceURI == NULL || qualifiedName == NULL ||
380 value == NULL) {
381 return IXML_INVALID_PARAMETER;
382 }
383
384 if (Parser_isValidXmlName(qualifiedName) == 0) {
385 return IXML_INVALID_CHARACTER_ERR;
386 }
387
388 ixmlNode_init(&newAttrNode);
389 newAttrNode.nodeName = strdup(qualifiedName);
390 if (newAttrNode.nodeName == NULL) {
391 return IXML_INSUFFICIENT_MEMORY;
392 }
393
394 rc = Parser_setNodePrefixAndLocalName(&newAttrNode);
395 if (rc != IXML_SUCCESS) {
396 Parser_freeNodeContent(&newAttrNode);
397 return rc;
398 }
399
400 /* see DOM 2 spec page 59 */
401 if ((newAttrNode.prefix != NULL && namespaceURI == NULL) ||
402 (newAttrNode.prefix != NULL && strcmp(newAttrNode.prefix, "xml") == 0 &&
403 strcmp(namespaceURI, "http://www.w3.org/XML/1998/namespace") != 0) ||
404 (strcmp(qualifiedName, "xmlns") == 0 &&
405 strcmp(namespaceURI, "http://www.w3.org/2000/xmlns/") != 0)) {
406 Parser_freeNodeContent(&newAttrNode);
407 return IXML_NAMESPACE_ERR;
408 }
409
410 attrNode = element->n.firstAttr;
411 while (attrNode != NULL) {
412 if (strcmp(attrNode->localName, newAttrNode.localName) == 0 &&
413 strcmp(attrNode->namespaceURI, namespaceURI) == 0) {
414 /* Found it */
415 break;
416 } else {
417 attrNode = attrNode->nextSibling;
418 }
419 }
420 if (attrNode != NULL) {
421 if (attrNode->prefix != NULL) {
422 /* Remove the old prefix */
423 free(attrNode->prefix);
424 }
425 /* replace it with the new prefix */
426 if (newAttrNode.prefix != NULL) {
427 attrNode->prefix = strdup(newAttrNode.prefix);
428 if (attrNode->prefix == NULL) {
429 Parser_freeNodeContent(&newAttrNode);
430 return IXML_INSUFFICIENT_MEMORY;
431 }
432 } else
433 attrNode->prefix = newAttrNode.prefix;
434
435 if (attrNode->nodeValue != NULL) {
436 free(attrNode->nodeValue);
437 }
438 attrNode->nodeValue = strdup(value);
439 if (attrNode->nodeValue == NULL) {
440 free(attrNode->prefix);
441 Parser_freeNodeContent(&newAttrNode);
442 return IXML_INSUFFICIENT_MEMORY;
443 }
444 } else {
445 /* Add a new attribute */
447 (IXML_Document*)element->n.ownerDocument, namespaceURI,
448 qualifiedName, &newAttr);
449 if (rc != IXML_SUCCESS) {
450 Parser_freeNodeContent(&newAttrNode);
451 return rc;
452 }
453 newAttr->n.nodeValue = strdup(value);
454 if (newAttr->n.nodeValue == NULL) {
455 ixmlAttr_free(newAttr);
456 Parser_freeNodeContent(&newAttrNode);
457 return IXML_INSUFFICIENT_MEMORY;
458 }
459 if (ixmlElement_setAttributeNodeNS(element, newAttr, &newAttr) !=
460 IXML_SUCCESS) {
461 ixmlAttr_free(newAttr);
462 Parser_freeNodeContent(&newAttrNode);
463 return IXML_FAILED;
464 }
465 }
466 Parser_freeNodeContent(&newAttrNode);
467
468 return IXML_SUCCESS;
469}
470
472 const DOMString namespaceURI,
473 const DOMString localName) {
474 IXML_Node* attrNode = NULL;
475
476 if (element == NULL || namespaceURI == NULL || localName == NULL) {
477 return IXML_INVALID_PARAMETER;
478 }
479
480 attrNode = element->n.firstAttr;
481 while (attrNode != NULL) {
482 if (strcmp(attrNode->localName, localName) == 0 &&
483 strcmp(attrNode->namespaceURI, namespaceURI) == 0) {
484 /* Found it */
485 break;
486 } else {
487 attrNode = attrNode->nextSibling;
488 }
489 }
490 if (attrNode != NULL) {
491 /* Has the attribute */
492 if (attrNode->nodeValue != NULL) {
493 free(attrNode->nodeValue);
494 attrNode->nodeValue = NULL;
495 }
496 }
497
498 return IXML_SUCCESS;
499}
500
502 const DOMString namespaceURI,
503 const DOMString localName) {
504 IXML_Node* attrNode = NULL;
505
506 if (element == NULL || namespaceURI == NULL || localName == NULL) {
507 return NULL;
508 }
509
510 attrNode = element->n.firstAttr;
511 while (attrNode != NULL) {
512 if (strcmp(attrNode->localName, localName) == 0 &&
513 strcmp(attrNode->namespaceURI, namespaceURI) == 0) {
514 /* found it */
515 break;
516 } else {
517 attrNode = attrNode->nextSibling;
518 }
519 }
520
521 return (IXML_Attr*)attrNode;
522}
523
525 /* IN */ IXML_Element* element,
526 /* IN */ IXML_Attr* newAttr,
527 /* OUT */ IXML_Attr** rtAttr) {
528 IXML_Node* attrNode = NULL;
529 IXML_Node* node = NULL;
530 IXML_Node* prevAttr = NULL;
531 IXML_Node* nextAttr = NULL;
532 IXML_Node* preSib = NULL;
533 IXML_Node* nextSib = NULL;
534
535 if (element == NULL || newAttr == NULL) {
536 return IXML_INVALID_PARAMETER;
537 }
538
539 if (newAttr->n.ownerDocument != element->n.ownerDocument) {
540 return IXML_WRONG_DOCUMENT_ERR;
541 }
542
543 if (newAttr->ownerElement != NULL && newAttr->ownerElement != element) {
544 return IXML_INUSE_ATTRIBUTE_ERR;
545 }
546
547 newAttr->ownerElement = element;
548 node = (IXML_Node*)newAttr;
549 attrNode = element->n.firstAttr;
550 while (attrNode != NULL) {
551 if (strcmp(attrNode->localName, node->localName) == 0 &&
552 strcmp(attrNode->namespaceURI, node->namespaceURI) == 0) {
553 /* Found it */
554 break;
555 } else {
556 attrNode = attrNode->nextSibling;
557 }
558 }
559 if (attrNode != NULL) {
560 /* already present, will replace by newAttr */
561 preSib = attrNode->prevSibling;
562 nextSib = attrNode->nextSibling;
563 if (preSib != NULL) {
564 preSib->nextSibling = node;
565 }
566 if (nextSib != NULL) {
567 nextSib->prevSibling = node;
568 }
569 if (element->n.firstAttr == attrNode) {
570 element->n.firstAttr = node;
571 }
572 *rtAttr = (IXML_Attr*)attrNode;
573
574 } else {
575 /* Add this attribute */
576 if (element->n.firstAttr != NULL) {
577 /* Element has attribute already */
578 prevAttr = element->n.firstAttr;
579 nextAttr = prevAttr->nextSibling;
580 while (nextAttr != NULL) {
581 prevAttr = nextAttr;
582 nextAttr = prevAttr->nextSibling;
583 }
584 prevAttr->nextSibling = node;
585 } else {
586 /* This is the first attribute node */
587 element->n.firstAttr = node;
588 node->prevSibling = NULL;
589 node->nextSibling = NULL;
590 }
591 if (rtAttr != NULL) {
592 *rtAttr = NULL;
593 }
594 }
595
596 return IXML_SUCCESS;
597}
598
600 const DOMString namespaceURI,
601 const DOMString localName) {
602 IXML_Node* node = (IXML_Node*)element;
603 IXML_NodeList* nodeList = NULL;
604
605 if (element != NULL && namespaceURI != NULL && localName != NULL) {
606 ixmlNode_getElementsByTagNameNS(node, namespaceURI, localName,
607 &nodeList);
608 }
609
610 return nodeList;
611}
612
614 IXML_Node* attrNode = NULL;
615
616 if (element == NULL || name == NULL) {
617 return 0;
618 }
619
620 attrNode = element->n.firstAttr;
621 while (attrNode != NULL) {
622 if (strcmp(attrNode->nodeName, name) == 0) {
623 return 1;
624 } else {
625 attrNode = attrNode->nextSibling;
626 }
627 }
628
629 return 0;
630}
631
633 const DOMString namespaceURI,
634 const DOMString localName) {
635 IXML_Node* attrNode = NULL;
636
637 if (element == NULL || namespaceURI == NULL || localName == NULL) {
638 return 0;
639 }
640
641 attrNode = element->n.firstAttr;
642 while (attrNode != NULL) {
643 if (strcmp(attrNode->localName, localName) == 0 &&
644 strcmp(attrNode->namespaceURI, namespaceURI) == 0) {
645 return 1;
646 } else {
647 attrNode = attrNode->nextSibling;
648 }
649 }
650
651 return 0;
652}
653
655 if (element != NULL) {
656 ixmlNode_free((IXML_Node*)element);
657 }
658}
int ixmlElement_setTagName(IXML_Element *element, const char *tagName)
Set the given element's tagName.
Definition element.cpp:57
static IXML_Node * ixmlElement_findAttributeNode(IXML_Element *element, IXML_Attr *oldAttr)
Find a attribute node whose contents are the same as the oldAttr.
Definition element.cpp:276
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 an Element node.
Definition ixml.hpp:169
Data structure representing the DOM Document.
Definition ixml.hpp:155
const DOMString ixmlElement_getAttributeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Retrieves an attribute value using the local name and namespace URI.
Definition element.cpp:346
int ixmlElement_setAttribute(IXML_Element *element, const DOMString name, const DOMString value)
Adds a new attribute to an Element.
Definition element.cpp:97
PUPNP_Api void ixmlAttr_free(IXML_Attr *attrNode)
Frees an Attr node.
Definition attr.cpp:45
int ixmlElement_removeAttribute(IXML_Element *element, const DOMString name)
Removes an attribute value by name. The attribute node is not removed.
Definition element.cpp:159
int ixmlElement_hasAttribute(IXML_Element *element, const DOMString name)
Queries whether the Element has an attribute with the given name or a default value.
Definition element.cpp:613
PUPNP_Api int ixmlDocument_createAttributeNSEx(IXML_Document *doc, const DOMString namespaceURI, const DOMString qualifiedName, IXML_Attr **attrNode)
Creates a new Attr node with the given qualified name and namespace URI.
Definition document.cpp:293
PUPNP_Api int ixmlDocument_createAttributeEx(IXML_Document *doc, const DOMString name, IXML_Attr **attrNode)
Creates a new Attr node with the given name.
Definition document.cpp:246
#define DOMString
The type of DOM strings.
Definition ixml.hpp:47
PUPNP_Api void ixmlNode_free(IXML_Node *nodeptr)
Frees a Node and all Nodes in its subtree.
Definition node.cpp:120
IXML_Attr * ixmlElement_getAttributeNode(IXML_Element *element, const DOMString name)
Retrieves an attribute node by name. See ixmlElement_getAttributeNodeNS to retrieve an attribute node...
Definition element.cpp:186
void ixmlElement_init(IXML_Element *element)
Initializes a IXML_Element node.
Definition element.cpp:43
const DOMString ixmlElement_getAttribute(IXML_Element *element, const DOMString name)
Retrieves an attribute of an Element by name.
Definition element.cpp:77
int ixmlElement_removeAttributeNode(IXML_Element *element, IXML_Attr *oldAttr, IXML_Attr **rtAttr)
Removes the specified attribute node from an Element.
Definition element.cpp:301
IXML_Attr * ixmlElement_getAttributeNodeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Retrieves an Attr node by local name and namespace URI.
Definition element.cpp:501
int ixmlElement_setAttributeNode(IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr)
Adds a new attribute node to an Element.
Definition element.cpp:207
void ixmlElement_free(IXML_Element *element)
Frees the given Element and any subtree of the Element.
Definition element.cpp:654
int ixmlElement_setAttributeNodeNS(IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr)
Adds a new attribute node to the element node specified.
Definition element.cpp:524
int ixmlElement_setAttributeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString qualifiedName, const DOMString value)
Adds a new attribute to an Element using the local name and namespace URI.
Definition element.cpp:370
int ixmlElement_removeAttributeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Removes an attribute using the namespace URI and local name.
Definition element.cpp:471
int ixmlElement_hasAttributeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Queries whether the Element has an attribute with the given local name and namespace URI or has a def...
Definition element.cpp:632
IXML_NodeList * ixmlElement_getElementsByTagNameNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Returns a NodeList of all descendant Elements with a given local name and namespace in the order in w...
Definition element.cpp:599
const DOMString ixmlElement_getTagName(IXML_Element *element)
Returns the name of the tag as a constant string.
Definition element.cpp:49
IXML_NodeList * ixmlElement_getElementsByTagName(IXML_Element *element, const DOMString tagName)
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are e...
Definition element.cpp:335
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
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
void ixmlNode_init(IXML_Node *nodeptr)
Intializes a node.
Definition node.cpp:43
void Parser_freeNodeContent(IXML_Node *IXML_Nodeptr)
Fees a node contents.
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 Parser_isValidXmlName(const DOMString name)
Check to see whether name is a valid xml name.
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