SophiaFramework UNIVERSE 5.3 |
SophiaFramework provides you with the following 12 types of node classes defined by W3C. These classes inherit from the SFXXMLNode class.
Table 19.1. XML Node Class
Class name | Description | Node Type ( SFXXMLNode::NodeType ) |
---|---|---|
SFXXMLNode | Base class for 12 types of node classes. | - |
SFXXMLElement | Class which represents an Element node. | ELEMENT_NODE |
SFXXMLAttribute | Class which represents an Attribute node. | ATTRIBUTE_NODE |
SFXXMLText | Class which represents a Text node. | TEXT_NODE |
SFXXMLCDATASection | Class which represents a CDATASection node. | CDATA_SECTION_NODE |
SFXXMLEntityReference | Class which represents an Entity Reference node. | ENTITY_REFERENCE_NODE |
SFXXMLEntity | Class which represents an Entity node. | ENTITY_NODE |
SFXXMLProcessingInstruction | Class which represents a Processing Instruction node. | PROCESSING_INSTRUCTION_NODE |
SFXXMLComment | Class which represents a Comment node. | COMMENT_NODE |
SFXXMLDocument | Class which represents a Document node. | DOCUMENT_NODE |
SFXXMLDocumentType | Class which represents a DocumentType node. | DOCUMENT_TYPE_NODE |
SFXXMLDocumentFragment | Class which represents a DocumentFragment node. | DOCUMENT_FRAGMENT_NODE |
SFXXMLNotation | Class which represents a Notation node. | NOTATION_NODE |
The following are provided as basic functions of the SFXXMLNode class.
Table 19.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 19.3. Function to create or update the DOM tree
Function Name | Description |
---|---|
AppendChild | Append the specified child node. |
RemoveChild | Remove the specified child node. |
ReplaceChild | Replace the specified child node. |
InsertBefore | Insert the specified node. |
CloneNode | Clone the specified node(It is possible to copy the specified node including child node trees). |
Table 19.4. Function to get or set the node attribute
Function Name | Description |
---|---|
HasChildNodes | Check whether or not the node has any child nodes. |
GetChildNodes | Get all child nodes. |
GetNodeType | Get the node type. |
GetNodeName | Get the node name. |
SetNodeValue | Set the node value. |
GetText | Get the text from the node value. |
SetText | Set the specified text into the node value. |
Table 19.5. Function to compare nodes
Function Name | Description |
---|---|
IsSameNode | Check whether or not the node is the same with the specified node. |
EqualNode | Check whether or not the node equals the specified node. |
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) 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 - 2024 Sophia Cradle Incorporated All Rights Reserved. |