SophiaFramework UNIVERSE 5.3 |
#include <SFXXMLAttribute.hpp>
class SFXXMLAttribute : public SFXXMLNode;
SFMTYPEDEFCLASS(SFXXMLAttribute)
An Attribute node(SFXXMLAttribute) contains an attribute of the XML document.
SFXXMLNode | SFXXMLCDATASection | SFXXMLComment | SFXXMLDocument | SFXXMLDocumentFragment | SFXXMLDocumentType | SFXXMLElement | SFXXMLEntity | SFXXMLEntityReference | SFXXMLNotation | SFXXMLProcessingInstruction | SFXXMLText
Constructor/Destructor |
---|
SFXXMLAttribute(
SFXXMLDocumentPtr owner
, SFXAnsiStringConstRef name
, SFXAnsiStringConstRef value
) Constructor of the SFXXMLAttribute class.
|
SFXXMLAttribute(
SFXXMLDocumentPtr owner
, SFXAnsiStringConstRef name
, SFXAnsiStringConstRef namespaceURI
, SFXAnsiStringConstRef value
) Constructor of the SFXXMLAttribute class.
|
SFXXMLAttribute(
SFXXMLAttributeConstRef other
, Bool deep = false
) Constructor of the SFXXMLAttribute class.
|
~SFXXMLAttribute( Void ) Destructor of the SFXXMLAttribute class.
|
Public Functions | |
---|---|
SFCError |
AppendChild(
SFXXMLNodeConstPtr newchild
) Append the specified child node at the end.
|
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.
|
DOMNodeListPtr |
GetChildNodes( Void ) Get all the child nodes.
|
SFXXMLNodePtr |
GetFirstChild( Void ) Get the first child node.
|
SFXXMLNodePtr |
GetLastChild( Void ) Get the last child node.
|
ACharConstPtr |
GetLocalName( Void ) Get the local name.
|
ACharConstPtr |
GetName( Void ) Get the node name.
|
ACharConstPtr |
GetNamespaceURI( Void ) Get the namespace URI.
|
ACharConstPtr |
GetNodeName( Void ) Get the node name.
|
NodeType |
GetNodeType( Void ) Get the node type.
|
ACharConstPtr |
GetNodeValue( Void ) Get the node value.
|
ACharConstPtr |
GetPrefix( Void ) Get the prefix.
|
ACharConstPtr |
GetValue( Void ) Get the node value.
|
Bool |
HasChildNodes( Void ) Check whether this node has any child nodes or not.
|
SFCError |
InsertBefore(
SFXXMLNodeConstPtr newchild
, SFXXMLNodeConstPtr refchild
) Insert the specified node.
|
SFCError |
RemoveChild(
SFXXMLNodeConstPtr oldchild
) Remove the specified child node including its descendant nodes.
|
SFCError |
ReplaceChild(
SFXXMLNodeConstPtr newchild
, SFXXMLNodeConstPtr oldchild
) Replace the specified child node.
|
Void |
SetNodeValue(
ACharConstPtr value
) Set the node value.
|
Void |
SetValue(
SFXAnsiStringConstRef value
) Set the node value.
|
SFXXMLNodePtr |
GetNextSibling( Void )
(inherits from SFXXMLNode)
Get the next sibling node.
|
SFXXMLNodePtr |
GetParentNode( Void )
(inherits from SFXXMLNode)
Get the parent node.
|
SFXXMLNodePtr |
GetPreviousSibling( Void )
(inherits from SFXXMLNode)
Get the previous sibling node.
|
SFXAnsiString |
GetText( Void )
(inherits from SFXXMLNode)
Get the node text.
|
Bool |
IsSameNode(
SFXXMLNodeConstPtr other
)
(inherits from SFXXMLNode)
Check whether this node is the same as the specified one or not.
|
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 ] SFXXMLAttribute( SFXXMLDocumentPtr owner // root node of the DOM tree SFXAnsiStringConstRef name // name of the Attribute node SFXAnsiStringConstRef value // value of the Attribute node );
[ public, explicit ] SFXXMLAttribute( SFXXMLDocumentPtr owner // root node of the DOM tree SFXAnsiStringConstRef name // name of the Attribute node SFXAnsiStringConstRef namespaceURI // namespace URI of the Attribute node SFXAnsiStringConstRef value // value of the Attribute node );
[ public, explicit ] SFXXMLAttribute( SFXXMLAttributeConstRef other // Attribute node Bool deep = false // whether or not to copy child nodes recursively );
[ public, virtual ] virtual ~SFXXMLAttribute(Void);
[ public, virtual ] SFCError AppendChild( SFXXMLNodeConstPtr newchild // child node to append );
The "newchild" node is appended as the last child node to this node without copying it.
If the "newchild" node belongs to a DOM tree, it will be removed from that tree.
[ 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 // specified node );
[ public, virtual, const ] DOMNodeListPtr GetChildNodes(Void);
Return the pointer to the SFXXMLNode::DOMNodeList instance that contains all child nodes of this node.
Note | |
---|---|
Each element of SFXXMLNode::DOMNodeList is of the "pointer to the SFXXMLNode" type. |
SFXXMLNode::DOMNodeList | SFXXMLNode::GetChildNodes | SFXXMLNode
[ public, virtual, const ] SFXXMLNodePtr GetFirstChild(Void);
Return the first child node of this node. Return null if this node has no child.
[ public, virtual, const ] SFXXMLNodePtr GetLastChild(Void);
Return the last child node of this node. Return null if this node has no child.
[ public, const ] ACharConstPtr GetLocalName(Void);
Return the local name of this node.
When the name set to this node is qualified name, it is a pair of namespace prefix and local name.
Note | |
---|---|
The name of the Attribute node is the attribute name of the XML document. |
[ public, const ] ACharConstPtr GetName(Void);
Same as the SFXXMLAttribute::GetNodeName function.
Note | |
---|---|
The name of the Attribute node is the attribute name of the XML document. |
Note | |
---|---|
When the namespace is set, the qualified name(namespace prefix and local name) is returned. |
// create Attribute node with Namespace URI and qualified name SFXXMLAttributePtr atti = document.CreateAttributeNS("book:isbn","http://www.w3.org/book"); // set value to Attribute node atti->SetValue("4-7741-1616-5"); // set Attribute node to Element node book->SetAttributeNode(atti); TRACE("Attribute's name = %s", atti->GetName()); // attribute name as qualified name = book:isbn TRACE("Attribute's value = %s", atti->GetValue()); // attribute value = 4-7741-1616-5 TRACE("Attribute's prefix = %s", atti->GetPrefix()); // prefix = book TRACE("Attribute's uri = %s", atti->GetNamespaceURI());// namespace URI = http://www.w3.org/book
[ public, const ] ACharConstPtr GetNamespaceURI(Void);
Return the namespace URI of this node if set. Otherwise, return null.
[ public, virtual, const ] ACharConstPtr GetNodeName(Void);
Same as the SFXXMLAttribute::GetName function.
Note | |
---|---|
The name of the Attribute node is the attribute name of the XML document. |
Note | |
---|---|
When the namespace is set, the qualified name(namespace prefix and local name) is returned. |
SFXXMLAttribute::GetName | SFXXMLNode::GetNodeName | SFXXMLNode
[ public, virtual, const ] NodeType GetNodeType(Void);
Return ATTRIBUTE_NODE.
[ public, virtual, const ] ACharConstPtr GetNodeValue(Void);
Same as the SFXXMLAttribute::GetValue function.
Note | |
---|---|
The value of the Attribute node is the attribute value of the XML document. |
SFXXMLAttribute::GetValue| SFXXMLNode::GetNodeValue | SFXXMLNode
[ public, const ] ACharConstPtr GetPrefix(Void);
Return the prefix of this node if set. Otherwise return null.
[ public, const ] ACharConstPtr GetValue(Void);
Same as the SFXXMLAttribute::GetNodeValue function.
Note | |
---|---|
The value of the Attribute node is the attribute value of the XML document. |
[ public, virtual, const ] Bool HasChildNodes(Void);
[ public, virtual ] SFCError InsertBefore( SFXXMLNodeConstPtr newchild // node to insert SFXXMLNodeConstPtr refchild // newchild node is inserted before refchild node );
[ public, virtual ] SFCError RemoveChild( SFXXMLNodeConstPtr oldchild // child node to remove );
[ public, virtual ] SFCError ReplaceChild( SFXXMLNodeConstPtr newchild // new child node to replace with SFXXMLNodeConstPtr oldchild // old child node to be replaced );
[ public, virtual ] Void SetNodeValue( ACharConstPtr value //new node content );
Same as the SFXXMLAttribute::SetNodeValue function.
Note | |
---|---|
The value of the Attribute node is the attribute value of the XML document. |
SFXXMLAttribute::SetValue | SFXXMLNode::SetNodeValue | SFXXMLNode
[ public ] Void SetValue( SFXAnsiStringConstRef value // attribute value );
Same as the SFXXMLAttribute::SetValue function.
Note | |
---|---|
The value of the Attribute node is the attribute value of the XML document. |
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |