#include <xercesc/dom/DOM.hpp>#include <xercesc/framework/StdOutFormatTarget.hpp>#include <iostream>#include "xercesc/dom/DOMTreeWalker.hpp"#include <string.h>#include <stdlib.h>Functions | |
| XMLCh * | X (const char *const input) |
| DOMDocument * | createDOM (DOMImplementation *impl) |
| void | printTree (DOMDocument *doc, DOMImplementation *impl) |
| void | displayAttributes (DOMNamedNodeMap *attributes, int level) |
| void | treeWalker (DOMDocument *doc) |
| void | banner (string type) |
| int | main (int argC, char *argV[]) |
Variables | |
| const char * | courses [] |
| const char * | professors [] |
| const char * | semesters [] |
| int | courseLoad [] = {4, 4, 5, 5, 3, 5, 5, 3, 4, 3} |
| const char * | campus [] |
| void banner | ( | string | type | ) |
Function to add a banner describing the output type.
| type | - The output type which is be described by the banner. |
| DOMDocument* createDOM | ( | DOMImplementation * | impl | ) |
Function to create the DOM structure. Scans through each member of the 'semesters' array, creating a child node of the root for each. Each of the semester nodes are then given children corresponding to each course in that semester. Each course is then given a Instructor, Campus, and Grade child. Also, courses may or may not have attributes associated with them. Much of this function is based on the Xerces DOMPrint sample program.
| impl | - DOMImplementation used to create the DOM structure. |
| void displayAttributes | ( | DOMNamedNodeMap * | attributes, |
| int | level | ||
| ) |
Function to display a DOM element's attributes.
| attributes | - a DOM map which contains a list of attribute names and values. |
| level | - The level on which an attribute's parent is located. Used for output formatting. |
| int main | ( | int | argC, |
| char * | argV[] | ||
| ) |
Standard C++ main function.
| argc | - Number of command line arguments. |
| argv | - Array of pointers to command line arguments. |
| void printTree | ( | DOMDocument * | doc, |
| DOMImplementation * | impl | ||
| ) |
Function that uses the Xerces serializer to display the tree in an XML format. Much of this function is based on the Xerces DOMPrint sample program.
| doc | - The DOMDocument that contains the DOM structure. |
| impl | - The DOMImplementation used to create the DOM structure. |
| void treeWalker | ( | DOMDocument * | doc | ) |
Function that implements the DOMTreeWalkers which is used to traverse the DOM structure. Creates the tree then scans through each node, checks its type, and depending on the results outputs the content in a particular format.
| doc | - The DOM document containing the DOM structure. |
| XMLCh* X | ( | const char *const | input | ) |
Function to simplify use of the XMLString::transcode function.
| - | A char* (string) to use as an argument for transcode. |
| const char* campus[] |
An array of campuses in which the above courses took place. Used as tag content.
| int courseLoad[] = {4, 4, 5, 5, 3, 5, 5, 3, 4, 3} |
Array of the number of courses for each semester. Used as a for loop limit when populating the DOM structure.
| const char* courses[] |
An array of courses I have taken, am taking and intend to take. Used as element content.
| const char* professors[] |
An array of professors for the courses listed above. Used as element content.
| const char* semesters[] |
An array of the semesters in my program of study. Each of these will be used as a tag name for the direct children of the root.
1.8.8