ˆ 973_•I|¥‰ÓMdœv ©ƒ&íK<óo¬À¿Í Index of /FSS-BCZ/root/proc/thread-self/cwd/lib64/python3.9/xml/sax

Index of /FSS-BCZ/root/proc/thread-self/cwd/lib64/python3.9/xml/sax

 NameLast modifiedSizeDescription

 Parent Directory   -  
 __pycache__/ 2026-10-22 17:49 -  

ˆÂÁ ƒh¹À¿MODALIAS=acpi:QEMU0002: Bˆl–Ðz¾” Ja,j�nà_¸!)‹Fÿ ƒeç__‡I|¥‰ÓMa–Ãa¾”*j"Tâ�~à�¸TÅ£Â'Writing element content

Writing element content

Writing element content uses many of the same steps we used above — parsing the document and walking the tree. We parse the document, then traverse the tree to find the place we want to insert our element. For this example, we want to again find the "storyinfo" element and this time insert a keyword. Then we'll write the file to disk. Full code: Appendix E, Code for Add Keyword Example

The main difference in this example is in parseStory:

void
parseStory (xmlDocPtr doc, xmlNodePtr cur, char *keyword) {

	1 xmlNewTextChild (cur, NULL, "keyword", keyword);
    return;
}
      

1

The xmlNewTextChild function adds a new child element at the current node pointer's location in the tree, specified by cur.

Once the node has been added, we would like to write the document to file. Is you want the element to have a namespace, you can add it here as well. In our case, the namespace is NULL.

	xmlSaveFormatFile (docname, d