Use the functions from the libxml2 library to parse the nodes (keys) in an XML file, including child keys, attributes, and their contents. By examining the sample code in this video, a C programmer can easily extract data from an XML file.
- For the color presented in this movie I'll … be examining the sample XML file shown here. … It contains nested tags, attributes and content. … To exam the file in your code use the XML 2 library … to parse the XML file. … The basic parsing structure is shown here in this … source code file. … The xmlDocPtr doc variable doc is returned … from the xmlParseFile function at line 13. … Here I'm only fetching the root element or node … shown at line 21. … At line 28 the root nodes name is output. … I've already compiled and linked the source code … so I'm just going to run the program. … And you see that the correct root node name person is output … In this modification to the code I've added a recursive … function dump_elements which is shown at line 45. … This function cascades through all the nodes in the XML … file displaying each one. … The current next variable at line 50 references … subsequent nodes similar to the way a linked list … works in C. … And here you see the full list of nodes. …
- 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.