The libxml2 library allows you to add new keys and content to an existing XML data file as well as create XML data files from scratch. In this video, discover the libxml2 functions that let you use a C program to output XML data.
- The libxml2 library allows you to modify … xml data by adding a new element or node. … In this code, the sample xml document is updated … with a new key and data. … After opening and validating the document, … a new child node is created for the root node … by using the xmlNewTextChild function … at line 38. … The tag is "spouse" and the content is … "Martha". … Line 46 saves the updated file, … overriding the original. … Appropriate messages are output. … I've already compiled and linked the program. … And the file was updated. … Now, let's concatenate it to see what it looks like. … And you see the new tag inserted at the last line, … it's rather inelegant, but the data is there. … To add a new element beyond the top level, … the code must search for a specific child tag. … Starting at line 37, … this code looks for the name element, … which is just under the root level in the document. … Once found, the xml new text child function … at line 44, … adds the middle tag with the value …
- Finding, installing, and linking libraries
- Accessing and generating XML data
- Working with JSON
- Working with the libcurl library
- Text programming
- Reading, writing, and manipulating JPEG images
- Working with PNG images
Skill Level Advanced
1. Setup and Configuration
2. Data Structures
3. Web Access
4. Text Programming
5. Computer Graphics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.