SophiaFramework UNIVERSE 5.3 |
#include <SFXXMLDocumentType.hpp>
class SFXXMLDocumentType : public SFXXMLNode;
SFMTYPEDEFCLASS(SFXXMLDocumentType)
A DocumentType node(SFXXMLDocumentType) contains a document type of the XML document.
Note | |
---|---|
The DocumentType node will be associated with a Document node(SFXXMLDocument) using the functions such as SFXXMLDocument::SetDocumentType, etc. |
SFXXMLNode | SFXXMLAttribute | SFXXMLCDATASection | SFXXMLComment | SFXXMLDocument | SFXXMLDocumentFragment | SFXXMLElement | SFXXMLEntity | SFXXMLEntityReference | SFXXMLNotation | SFXXMLProcessingInstruction | SFXXMLText
Constructor/Destructor |
---|
SFXXMLDocumentType(
SFXXMLDocumentPtr owner
, SFXAnsiStringConstRef name
, SFXAnsiStringConstRef publicId
, SFXAnsiStringConstRef systemId
) Constructor of the SFXXMLDocumentType class.
|
SFXXMLDocumentType(
SFXXMLDocumentTypeConstRef other
, Bool deep = false
) Constructor of the SFXXMLDocumentType class.
|
~SFXXMLDocumentType( Void ) Destructor of the SFXXMLDocumentType class.
|
Public Functions | |
---|---|
SFCError |
CloneNode(
SFXXMLNodeHandle clonenode
, Bool deep
) Create a copy of this node.
|
Bool |
EqualNode(
SFXXMLNodeConstPtr arg
) Check whether this node equals the specified node or not.
|
DOMNamedNodeMapPtr |
GetEntities( Void ) Get all the Entity nodes in the DOM tree.
|
ACharConstPtr |
GetInternalSubset( Void ) Get the internal subset.
|
ACharConstPtr |
GetName( Void ) Get the node name.
|
SFXXMLNodePtr |
GetNextSibling( Void ) Get the next sibling node.
|
ACharConstPtr |
GetNodeName( Void ) Get the node name.
|
NodeType |
GetNodeType( Void ) Get the node type.
|
DOMNamedNodeMapPtr |
GetNotations( Void ) Get all the Notation nodes in the DOM tree.
|
SFXXMLNodePtr |
GetParentNode( Void ) Get the parent node.
|
SFXXMLNodePtr |
GetPreviousSibling( Void ) Get the previous sibling node.
|
ACharConstPtr |
GetPublicID( Void ) Get the public identifier of external subset.
|
ACharConstPtr |
GetSystemID( Void ) Get the system identifier of external subset.
|
Void |
SetInternalSubset(
SFXAnsiStringConstRef intsubset
) Set the internal subset.
|
SFCError |
AppendChild(
SFXXMLNodeConstPtr newchild
)
(inherits from SFXXMLNode)
Append the specified child node at the end.
|
DOMNodeListPtr |
GetChildNodes( Void )
(inherits from SFXXMLNode)
Get all the child nodes.
|
SFXXMLNodePtr |
GetFirstChild( Void )
(inherits from SFXXMLNode)
Get the first child node.
|
SFXXMLNodePtr |
GetLastChild( Void )
(inherits from SFXXMLNode)
Get the last child node.
|
ACharConstPtr |
GetNodeValue( Void )
(inherits from SFXXMLNode)
Get the node value.
|
SFXAnsiString |
GetText( Void )
(inherits from SFXXMLNode)
Get the node text.
|
Bool |
HasChildNodes( Void )
(inherits from SFXXMLNode)
Check whether this node has any child nodes or not.
|
SFCError |
InsertBefore(
SFXXMLNodeConstPtr newchild
, SFXXMLNodeConstPtr refchild
)
(inherits from SFXXMLNode)
Insert the specified node.
|
Bool |
IsSameNode(
SFXXMLNodeConstPtr other
)
(inherits from SFXXMLNode)
Check whether this node is the same as the specified one or not.
|
SFCError |
RemoveChild(
SFXXMLNodeConstPtr oldchild
)
(inherits from SFXXMLNode)
Remove the specified child node including its descendant nodes.
|
SFCError |
ReplaceChild(
SFXXMLNodeConstPtr newchild
, SFXXMLNodeConstPtr oldchild
)
(inherits from SFXXMLNode)
Replace the specified child node.
|
Void |
SetNodeValue(
ACharConstPtr value
)
(inherits from SFXXMLNode)
Set the node value.
|
SFCError |
SetText(
SFXAnsiStringConstRef text
)
(inherits from SFXXMLNode)
Set the node text.
|
Types |
---|
DOMNamedNodeMap
(inherits from SFXXMLNode)
Class to manage the DOM nodes by name
|
DOMNodeList
(inherits from SFXXMLNode)
Class to manage the DOM nodes by list
|
NodeType
(inherits from SFXXMLNode)
SFXXMLNode::NodeType is an enumeration type of NodeType values defined in the W3C DOM Level 1 Specification.
Document Object Model (DOM) Level 1 Specification )
|
[ public, explicit ] SFXXMLDocumentType( SFXXMLDocumentPtr owner // root node of the DOM tree SFXAnsiStringConstRef name // name of the documentType node SFXAnsiStringConstRef publicId // Public identifier of external subset SFXAnsiStringConstRef systemId // System identifier of external subset );
[ public, explicit ] SFXXMLDocumentType( SFXXMLDocumentTypeConstRef other // DocumentType node Bool deep = false // whether or not to copy the child nodes recursively );
[ public, virtual ] virtual ~SFXXMLDocumentType(Void);
[ public, virtual ] SFCError CloneNode( SFXXMLNodeHandle clonenode // target node where to copy this node(Handle type) Bool deep // whether or not to copy the child nodes recursively );
Specify the target node where to copy this node.
If true is set to this argument, copy the child nodes recursively.
Otherwise, copy only this node.
[ public, virtual, const ] Bool EqualNode( SFXXMLNodeConstPtr arg // the specified node );
[ public, const ] DOMNamedNodeMapPtr GetEntities(Void);
Return all the Entity nodes in the DOM tree as the pointer to the SFXXMLNode::DOMNamedNodeMap instance.
<?xml version="1.0" encoding="shift_JIS" standalone="yes" ?> <!DOCTYPE list[ <!ELEMENT list (name, email)> <!ENTITY Name "sophia"> <!ENTITY Email "&Name;@s-cradle.com"> <!ELEMENT name "(#PCDATA)"> <!ELEMENT email "(#PCDATA)"> <!ATTLIST name number (001|002|003) #REQUIRED> ]> <list> <name number="001">Sophia Cradle</name> <email address>&Email;</email> </list> // get DocumentType node from root node SFXXMLDocumentTypePtr docType = root->GetDocumentType(); if (docType) { // get all the Entity nodes in the DOM tree SFXXMLNode::DOMNamedNodeMapPtr nodemap = docType->GetEntities(); if (nodemap) { // get "name" Entity node SFXXMLEntityPtr name = SFXXMLEntityPtr(nodemap->Item(0)); // get "Email" Entity node SFXXMLEntityPtr mail = SFXXMLEntityPtr(nodemap->Item(1)); .... // add new Entity node "<!ENTITY company SYSTEM "company.dtd">" SFXXMLEntityPtr entity = document.CreateEntity("company"); entity->SetSystemID("company.dtd"); nodemap->SetNamedItem(entity); } }
[ public, const ] ACharConstPtr GetInternalSubset(Void);
Return the internal subset if it exists. Otherwise, null is returned.
Note | |
---|---|
No square bracket for the delimiter is included in the return value. |
[ public, const ] ACharConstPtr GetName(Void);
Get the name of the DocumentType node.
Same as the SFXXMLDocumentType::GetNodeName function.
Note | |
---|---|
The name of the DocumentType node is the doctype name of the XML document. |
[ public, virtual, const ] SFXXMLNodePtr GetNextSibling(Void);
Return the next sibling node of this node. If this node has no next sibling node, null is returned.
SFXXMLDocumentType::GetPreviousSibling | SFXXMLNode::GetNextSibling | SFXXMLNode::GetPreviousSibling | SFXXMLNode
[ public, virtual, const ] ACharConstPtr GetNodeName(Void);
Get the name of the DocumentType node.
Same as the SFXXMLDocumentType::GetName function.
Note | |
---|---|
The name of the DocumentType node is the doctype name of the XML document. |
SFXXMLDocumentType::GetName | SFXXMLNode::GetNodeName | SFXXMLNode
[ public, virtual, const ] NodeType GetNodeType(Void);
Return DOCUMENT_TYPE_NODE.
[ public, const ] DOMNamedNodeMapPtr GetNotations(Void);
Return all the Notation nodes in the DOM tree as the pointer to the SFXXMLNode::DOMNamedNodeMap instance.
<?xml version="1.0" encoding="shift_JIS" standalone="yes" ?> <!DOCTYPE Studio [ <!ELEMENT Studio ANY> <!ELEMENT MultiMedia (#PCDATA)> <!ATTLIST MultiMedia player NOTATION (rm|gif|midi) #REQUIRED> <!NOTATION gif SYSTEM "Image/gif"> <!NOTATION rm SYSTEM "RealPlayer.exe"> <!NOTATION midi SYSTEM "wmplayer.exe"> ]> <Studio> <MultiMedia player="rm"></MultiMedia> </Studio> // get DocumentType node from root node of DOM tree SFXXMLDocumentTypePtr docType = root->GetDocumentType(); if (docType) { // get all Notation nodes in the DOM tree SFXXMLNode::DOMNamedNodeMapPtr nodemap = docType->GetNotations(); if (nodemap) { // get "gif" Notation node SFXXMLNotationPtr gif = SFXXMLNotationPtr(nodemap->Item(0)); // get "rm" Notation node SFXXMLNotationPtr rm = SFXXMLNotationPtr(nodemap->Item(1)); // get "midi" Notation node SFXXMLNotationPtr midi = SFXXMLNotationPtr(nodemap->Item(2)); .... // add new Notation node "<!NOTATION mp3 SYSTEM "winamp.exe">" SFXXMLNotationPtr mp3 = document.CreateNotation("mp3"); mp3->SetSystemID("winamp.exe"); nodemap->SetNamedItem(mp3); } }
[ public, virtual, const ] SFXXMLNodePtr GetParentNode(Void);
Return the parent node of this node. Return null if this node has no parent.
[ public, virtual, const ] SFXXMLNodePtr GetPreviousSibling(Void);
Return the previous sibling node of this node. If this node has no previous sibling node, null is returned.
SFXXMLDocumentType::GetNextSibling | SFXXMLNode::GetPreviousSibling | SFXXMLNode::GetNextSibling | SFXXMLNode
[ public, const ] ACharConstPtr GetPublicID(Void);
[ public, const ] ACharConstPtr GetSystemID(Void);
[ public ] Void SetInternalSubset( SFXAnsiStringConstRef intsubset // internal subset to set );
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |