![]() ![]() ![]()
|
BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1 |
SophiaFramework provides you with the following 12 types of node classes defined by W3C. These classes inherit from the SFXXMLNode class.
Table 18.1. XML Node Class
| Class name | Description | Node Type ( SFXXMLNode::NodeType ) |
|---|---|---|
| SFXXMLNode | Base class for 12 types of node classes | - |
| SFXXMLElement | Class that represents an Element node | ELEMENT_NODE |
| SFXXMLAttribute | Class that represents an Attribute node | ATTRIBUTE_NODE |
| SFXXMLText | Class that represents a Text node | TEXT_NODE |
| SFXXMLCDATASection | Class that represents a CDATASection node | CDATA_SECTION_NODE |
| SFXXMLEntityReference | Class that represents an Entity Reference node | ENTITY_REFERENCE_NODE |
| SFXXMLEntity | Class that represents an Entity node | ENTITY_NODE |
| SFXXMLProcessingInstruction | Class that represents a Processing Instruction node | PROCESSING_INSTRUCTION_NODE |
| SFXXMLComment | Class that represents a Comment node | COMMENT_NODE |
| SFXXMLDocument | Class that represents a Document node | DOCUMENT_NODE |
| SFXXMLDocumentType | Class that represents a DocumentType node | DOCUMENT_TYPE_NODE |
| SFXXMLDocumentFragment | Class that represents a DocumentFragment node | DOCUMENT_FRAGMENT_NODE |
| SFXXMLNotation | Class that represents a Notation node | NOTATION_NODE |
The following are provided as basic functions of the SFXXMLNode class.
Table 18.2. Function to get a node from the DOM tree
| Function Name | Description |
|---|---|
| GetFirstChild | get the first child node |
| GetLastChild | get the last child node |
| GetNextSibling | get the next node amongst brothers |
| GetPreviousSibling | get the previous node amongst brothers |
| GetParentNode | get the parent node |
Table 18.3. Function to create or update the DOM tree
| Function Name | Description |
|---|---|
| AppendChild | append a child node |
| RemoveChild | remove a child node |
| ReplaceChild | replace a child node |
| InsertBefore | insert a node |
| CloneNode | clone a node(It is possible to copy a node including child node trees) |
Table 18.4. Function to get or set the node attribute
| Function Name | Description |
|---|---|
| HasChildNodes | test if it has a child node |
| GetChildNodes | get all the child nodes |
| GetNodeType | get a node type |
| GetNodeName | get a node name |
| SetNodeValue | set node contents |
| GetText | get texts included in all the child nodes |
| SetText | set a text into its child node |
Table 18.5. Function to compare nodes
| Function Name | Description |
|---|---|
| IsSameNode | test if two nodes are same |
| EqualNode | test if two nodes are equal |
An XML parser receives XML documents grammatically checked by DTD or XML Schema, expands the documents onto memory as tree-structured objects ( DOM tree ), and sends them to an application.
In SophiaFramework, a DOM parser ( SFXXMLDOMParser / SFXXSDDOMParser ) is created to analyze XML document, and return an DOM tree of SFXXMLDocument.
![]() |
SFXXMLScanner |
|---|---|
SFXXMLScanner is the class used by SophiaFramework. | |
The most important object in parsing XML document is the root node of SFXXMLDocument in the DOM tree.
Basic Functions of "SFXXMLDocument"
|
Copyright (C) 2002 - 2008 Sophia Cradle, Inc. All Rights Reserved. |
![]() ![]() ![]()
|