PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXXMLDocument
[XML] Class which represents a Document node.
#include <SFXXMLDocument.hpp>
class SFXXMLDocument : public SFXXMLNode;
SFMTYPEDEFCLASS(SFXXMLDocument)

Inheritance diagram

 Inheritance diagram of SFXXMLDocumentClass

Collaboration diagram

 Collaboration diagram of SFXXMLDocumentClass

Description

A Document node(SFXXMLDocument) contains a document of the XML document.

[Note] Note
The Document node is the root node of the DOM tree
[Note] Note
The functions for creating the DOM nodes such as SFXXMLDocument::CreateTextNode and SFXXMLDocument::CreateElement cannot be used only in the Document node(SFXXMLDocument).

Reference

SFXXMLNode | SFXXMLAttribute | SFXXMLCDATASection | SFXXMLComment | SFXXMLDocumentFragment | SFXXMLDocumentType | SFXXMLElement | SFXXMLEntity | SFXXMLEntityReference | SFXXMLNotation | SFXXMLProcessingInstruction | SFXXMLText

Member

Constructor/Destructor
SFXXMLDocument( Void )
Constructor of the SFXXMLDocument class.
~SFXXMLDocument( Void )
Destructor of the SFXXMLDocument 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.
SFXXMLAttributePtr CreateAttribute( SFXAnsiStringConstRef name , SFXAnsiStringConstRef value )
Create an Attribute node.
SFXXMLAttributePtr CreateAttributeNS( SFXAnsiStringConstRef name , SFXAnsiStringConstRef namespaceURI )
Create an Attribute node with qualified name and namespace URI.
SFXXMLCDATASectionPtr CreateCDATASection( SFXAnsiStringConstRef data )
Create a CDATASection node.
SFXXMLCommentPtr CreateComment( SFXAnsiStringConstRef data )
Create a Comment node.
SFXXMLDocumentFragmentPtr CreateDocumentFragment( Void )
Create an empty DocumentFragment node.
SFXXMLDocumentTypePtr CreateDocumentType( SFXAnsiStringConstRef name , SFXAnsiStringConstRef publicId , SFXAnsiStringConstRef systemId )
Create an empty DocumentType node.
SFXXMLElementPtr CreateElement( SFXAnsiStringConstRef name )
Create an Element node.
SFXXMLElementPtr CreateElementNS( SFXAnsiStringConstRef name , SFXAnsiStringConstRef namespaceURI )
Create an Element node with qualified name and namespace URI.
SFXXMLEntityPtr CreateEntity( SFXAnsiStringConstRef name )
Create an Entity node.
SFXXMLEntityReferencePtr CreateEntityReference( SFXAnsiStringConstRef name )
Create an EntityReference node.
SFXXMLNotationPtr CreateNotation( SFXAnsiStringConstRef name )
Create a Notation node.
SFXXMLProcessingInstructionPtr CreateProcessingInstruction( SFXAnsiStringConstRef target , SFXAnsiStringConstRef data )
Create a Processing Instruction node.
SFXXMLTextPtr CreateTextNode( SFXAnsiStringConstRef data )
Create a Text node.
DOMNodeListPtr GetChildNodes( Void )
Get all the child nodes.
SFXXMLElementPtr GetDocumentElement( Void )
Get the root node of the DOM tree.
SFXXMLDocumentTypePtr GetDocumentType( Void )
Get the DocumentType node.
DOMNodeListPtr GetElementsByTagName( SFXAnsiStringConstRef tag , SFXXMLNodeConstPtr root = null )
Get all the Element nodes that match the specified tag name.
DOMNodeListPtr GetElementsByTagNameNS( SFXAnsiStringConstRef localname , SFXAnsiStringConstRef namespaceURI , SFXXMLNodeConstPtr root = null )
Get all the Element nodes that match the specified local name and namespace URI.
ACharConstPtr GetEncoding( Void )
Get the encoding.
SFXXMLNodePtr GetFirstChild( Void )
Get the first child node.
SFXXMLNodePtr GetLastChild( Void )
Get the last child node.
DOMNodeListPtr GetListsByTypeFilter( NodeType type )
Get all the nodes that match the specified node type.
ACharConstPtr GetNodeName( Void )
Get the node name.
NodeType GetNodeType( Void )
Get the node type.
Bool GetStandalone( Void )
Check whether Standalone is set or not.
ACharConstPtr GetVersion( Void )
Get the version number.
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.
SFCError Save( SFXAnsiStringConstRef output , Bool indent = true )
Save the document to file.
SFCError Save( SFXPathConstRef output , Bool indent = true )
Save the document to file.
SFCError Save( SFXOutputStreamRef output , Bool indent = true )
Save the document to file.
Void SetDocumentType( SFXXMLDocumentTypeConstPtr doctype )
Set the DocumentType node.
Void SetEncoding( SFXAnsiStringConstRef encoding )
Set the encoding.
Void SetStandalone( Bool standalone )
Set the Standalone attribute.
Void SetVersion( SFXAnsiStringConstRef version )
Set the version number.
Bool EqualNode( SFXXMLNodeConstPtr arg ) (inherits from SFXXMLNode)
Check whether this node equals the specified node or not.
SFXXMLNodePtr GetNextSibling( Void ) (inherits from SFXXMLNode)
Get the next sibling node.
ACharConstPtr GetNodeValue( Void ) (inherits from SFXXMLNode)
Get the node value.
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.
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 )

SFXXMLDocument::SFXXMLDocument
Constructor of the SFXXMLDocument class.
[ public, explicit ]
SFXXMLDocument(Void);

SFXXMLDocument::~SFXXMLDocument
Destructor of the SFXXMLDocument class.
[ public, virtual ]
virtual ~SFXXMLDocument(Void);

SFXXMLDocument::AppendChild
Append the specified child node at the end.
[ public, virtual ]
SFCError AppendChild(
    SFXXMLNodeConstPtr newchild   // child node to append
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED

Description

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.

Reference

SFXXMLNode::AppendChild


SFXXMLDocument::CloneNode
Create a copy of this node.
[ 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
);

Argument

clonenode

Specify the target node where to copy this node.

deep

If true is set to this argument, copy the child nodes recursively.

Otherwise, copy only this node.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_FAILED

Reference

SFXXMLNode::CloneNode


SFXXMLDocument::CreateAttribute
Create an Attribute node.
[ public ]
SFXXMLAttributePtr CreateAttribute(
    SFXAnsiStringConstRef name    // attribute name
    SFXAnsiStringConstRef value   // attribute value
);

Return value

Return the Attribute node (SFXXMLAttribute), or return null.

Description

The SFXXMLDocument::CreateAttributeNS function is used to create an Attribute node with qualified name and namespace URI

The SFXXMLElement::SetAttributeNode or SFXXMLElement::SetAttribute function is used to set an Attribute node(SFXXMLAttribute) to an Element node(SFXXMLElement).

Example

// create Attribute node (set attribute value) 
SFXXMLAttributePtr atti = document.CreateAt tribute("ISBN", "4-7741-1616-5");
// set Attribute node to Element node 
book->SetAttributeNode(atti);

Reference

SFXXMLElement::SetAttributeNode | SFXXMLElement::SetAttribute | SFXXMLDocument::CreateAttributeNS | SFXXMLAttribute | SFXXMLElement | SFXXMLNode


SFXXMLDocument::CreateAttributeNS
Create an Attribute node with qualified name and namespace URI.
[ public ]
SFXXMLAttributePtr CreateAttributeNS(
    SFXAnsiStringConstRef name           // qualified name of attribute
    SFXAnsiStringConstRef namespaceURI   // namespace URI of attribute
);

Return value

Return the Attribute node ( SFXXMLAttribute ), or return null.

Example

// create Attribute node with qualified name and namespace URI 
SFXXMLAttributePtr atti = document.CreateAttributeNS("book:isbn","http://www.w3.org/book");
// set Attribute value 
atti->SetValue("4-7741-1616-5");
// set Attribute node to Element node 	
book->SetAttributeNode(atti);

Reference

SFXXMLElement::SetAttributeNode | SFXXMLElement::SetAttribute | SFXXMLDocument::CreateAttribute | SFXXMLAttribute | SFXXMLElement | SFXXMLNode


SFXXMLDocument::CreateCDATASection
Create a CDATASection node.
[ public ]
SFXXMLCDATASectionPtr CreateCDATASection(
    SFXAnsiStringConstRef data   // data of CDATASection to set
);

Return value

Return the CDATASection node(SFXXMLCDATASection), or return null.

Example

Create the CDATASection node of <![CDATA[<AUTHOR age="5">Sophia Cradle</AUTHOR>]]>.

// create CDATASection node 	
book->SetAttributeNode(atti);
SFXXMLCDATASectionPtr cdata = document.CreateCDATASection("<AUTHOR age=\"5\">Sophia Cradle</AUTHOR>");
// set CDATASection node 	
book->SetAttributeNode(atti);
boot->AppendChild(SFXXMLNodePtr(cdata));

Reference

SFXXMLCDATASection | SFXXMLNode


SFXXMLDocument::CreateComment
Create a Comment node.
[ public ]
SFXXMLCommentPtr CreateComment(
    SFXAnsiStringConstRef data   // data of comment to set
);

Return value

Return the Comment node (SFXXMLComment), or return null.

Example

Create the Comment node that contains "this a test code!".

// create Comment node 	
SFXXMLCommentPtr cdata = document.CreateComment("this a test code!");
// add Comment node 	
boot->AppendChild(SFXXMLNodePtr(cdata));

Reference

SFXXMLComment | SFXXMLNode


SFXXMLDocument::CreateDocumentFragment
Create an empty DocumentFragment node.
[ public ]
SFXXMLDocumentFragmentPtr CreateDocumentFragment(Void);

Return value

Return the DocumentFragment node (SFXXMLDocumentFragment), or return null.

Reference

SFXXMLDocumentFragment | SFXXMLNode


SFXXMLDocument::CreateDocumentType
Create an empty DocumentType node.
[ public ]
SFXXMLDocumentTypePtr CreateDocumentType(
    SFXAnsiStringConstRef name       // qualified name of the document type
    SFXAnsiStringConstRef publicId   // public identifier of external subset
    SFXAnsiStringConstRef systemId   // system identifier of external subset
);

Return value

Return the DocumentType node (SFXXMLDocumentType), or return null.

Example

Create the DocumentType node of <!DOCTYPE boot PUBLIC "public-boot.dtd">.

// create DocumentType node
SFXXMLDocumentTypePtr doctype = document.CreateDocumentType("boot","public-boot.dtd",");
// add DocumentType node
document.AppendChild(SFXXMLNodePtr(doctype));

Reference

SFXXMLDocumentType | SFXXMLNode


SFXXMLDocument::CreateElement
Create an Element node.
[ public ]
SFXXMLElementPtr CreateElement(
    SFXAnsiStringConstRef name   // name of the element
);

Return value

Return the Element node (SFXXMLElement), or return null.

Description

The SFXXMLDocument::CreateElementNS function is used to create Element node with qualified name and namespace URI.

Reference

SFXXMLDocument::CreateElementNS | SFXXMLElement | SFXXMLNode


SFXXMLDocument::CreateElementNS
Create an Element node with qualified name and namespace URI.
[ public ]
SFXXMLElementPtr CreateElementNS(
    SFXAnsiStringConstRef name           // qualified name of the element
    SFXAnsiStringConstRef namespaceURI   // namespace URI of the element
);

Return value

Return the Element node (SFXXMLElement), or return null.

Example

Create <xsd:node xmlns:xsd="http://www.w3.org/xsd">node element</xsd:node> Element node

// create Element node with qualified name and namespace URI specified ( URI = http://www.w3.org/xsd )
SFXXMLElementPtr element = document.CreateElementNS("xsd:node", "http://www.w3.org/xsd");
// set the text to Element node
element->SetText("node element");
// add Element node
boot->AppendChild(element);

Reference

SFXXMLDocument::CreateElement | SFXXMLElement | SFXXMLNode


SFXXMLDocument::CreateEntity
Create an Entity node.
[ public ]
SFXXMLEntityPtr CreateEntity(
    SFXAnsiStringConstRef name   // entity name
);

Return value

Return the Entity node (SFXXMLEntity), or return null.

Description

Add the created Entity node to the DocumentType node using the SFXXMLDocument::AppendChild function, etc.

Example

Create the Entity node of <!ENTITY copyright "Copyright 2007, Sophia. All rights reserved">.

// create Entity node
SFXXMLEntityPtr entity = document.CreateEntity("copyright \"Copyright 2007, Sophia. All rights reserved\"");
// add Entity node to DocumentType node
doctype->GetEntities()->SetNamedItem(entity);

Reference

SFXXMLDocument::CreateEntityReference | SFXXMLEntity | SFXXMLDocumentType SFXXMLNode


SFXXMLDocument::CreateEntityReference
Create an EntityReference node.
[ public ]
SFXXMLEntityReferencePtr CreateEntityReference(
    SFXAnsiStringConstRef name   // name of entity reference
);

Return value

Return the EntityReference node (SFXXMLEntityReference), or return null.

Example

Create the EntityReference node of "copyright".

// create EntityReference node
SFXXMLEntityReferencePtr entityref = document.CreateEntityReference("copyright");
// add EntityReference node
boot->AppendChild(SFXXMLNodePtr(entityref));

Reference

SFXXMLDocument::CreateEntity | SFXXMLEntityReference | SFXXMLNode


SFXXMLDocument::CreateNotation
Create a Notation node.
[ public ]
SFXXMLNotationPtr CreateNotation(
    SFXAnsiStringConstRef name   // name of the Notation node
);

Return value

Return the Notation node (SFXXMLNotation), or return null.

Description

The created Notation node is set to the DocumentType node. The SFXXMLDocument::AppendChild function cannot be used for the Notation node.

Example

Create the Notation node of <!NOTATION XLS PUBLIC "http://www.microsoft.com/office/excel/">.

// create Notation node 
SFXXMLNotationPtr notation = document.CreateNotation("XLS");
// set PUBLIC identifier 
notation->SetPublicID("http://www.microsoft.com/office/excel/");
// set Notation node 
doctype->GetNotations()->SetNamedItem(notation);

Reference

SFXXMLNotation | SFXXMLDocumentType SFXXMLNode


SFXXMLDocument::CreateProcessingInstruction
Create a Processing Instruction node.
[ public ]
SFXXMLProcessingInstructionPtr CreateProcessingInstruction(
    SFXAnsiStringConstRef target   // target of processing Instruction
    SFXAnsiStringConstRef data     // content of processing Instruction
);

Return value

Return the ProcessingInstruction node (SFXXMLProcessingInstruction), or return null.

Example

Create the ProcessingInstruction node of <?xml-stylesheet type="text/xsl" href="viewer.xsl"?>.

// create ProcessingInstruction node
SFXXMLProcessingInstructionPtr pi = document.CreateProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"viewer.xsl\");
// append ProcessingInstruction node
document.AppendChild(pi);

Reference

SFXXMLProcessingInstruction | SFXXMLNode


SFXXMLDocument::CreateTextNode
Create a Text node.
[ public ]
SFXXMLTextPtr CreateTextNode(
    SFXAnsiStringConstRef data   // text to set
);

Return value

Return the Text node (SFXXMLText), or return null.

Example

//  create Text node, and then append it
element->AppendChild(SFXXMLNodePtr(document.CreateTextNode("New text node")));

Reference

SFXXMLText | SFXXMLNode


SFXXMLDocument::GetChildNodes
Get all the child nodes.
[ public, virtual, const ]
DOMNodeListPtr GetChildNodes(Void);

Return value

Return the pointer to the SFXXMLNode::DOMNodeList instance that contains all child nodes of this node.

Description

[Note] Note
Each element of SFXXMLNode::DOMNodeList is of the "pointer to the SFXXMLNode" type.

Reference

SFXXMLNode::DOMNodeList | SFXXMLNode::GetChildNodes | SFXXMLNode


SFXXMLDocument::GetDocumentElement
Get the root node of the DOM tree.
[ public, const ]
SFXXMLElementPtr GetDocumentElement(Void);

Example

// get root node of DOM tree 
SFXXMLElementPtr root = document.GetDocumentElement();

Reference

SFXXMLDocument | SFXXMLElement | SFXXMLNode


SFXXMLDocument::GetDocumentType
Get the DocumentType node.
[ public, const ]
SFXXMLDocumentTypePtr GetDocumentType(Void);

Reference

SFXXMLDocument::SetDocumentType | SFXXMLDocumentType | SFXXMLNode


SFXXMLDocument::GetElementsByTagName
Get all the Element nodes that match the specified tag name.
[ public, const ]
DOMNodeListPtr GetElementsByTagName(
    SFXAnsiStringConstRef tag        // tag name: QName can be specified if namespace is set
    SFXXMLNodeConstPtr root = null   // root node to search from
);

Argument

tag

Specify the tag name. Capital letters and small letters are distinguished. QName can be specified if namespace is set.

root

If null is set, return a list of the Element nodes with the specified tag name for entire document.

If a node is set, return a list of the Element nodes with the specified tag name in the desendant nodes of this node.

Return value

All the Element nodes with the specified tag name are returned as the pointer to the SFXXMLNode::DOMNodeList instance.

Description

All the Element nodes with the specified tag name are stored in the SFXXMLNode::DOMNodeList instance.

[Note] Note

When namespace is set, QName(i.e., "namespace prefix:local name") can be specified as a tag name.

[Note] Note

When the local name and the namespace URI are specified, the SFXXMLDocument::GetElementsByTagNameNS function will be used.

[Note] Note

The SFXXMLElement::GetElementsByTagName function internally calls this function by specifying the root argument.

[Note] Note

To get the nodes of the specific node type, use the SFXXMLDocument::GetListsByTypeFilter function.

Reference

SFXXMLDocument::GetElementsByTagNameNS | SFXXMLElement::GetElementsByTagName | SFXXMLNode::DOMNodeList | SFXXMLDocument::GetListsByTypeFilter | SFXXMLElement | SFXXMLNode


SFXXMLDocument::GetElementsByTagNameNS
Get all the Element nodes that match the specified local name and namespace URI.
[ public, const ]
DOMNodeListPtr GetElementsByTagNameNS(
    SFXAnsiStringConstRef localname      // local name of the element
    SFXAnsiStringConstRef namespaceURI   // namespace URI of the element
    SFXXMLNodeConstPtr root = null       // root node to search from
);

Argument

localname

Specify the local name of the element. Capital letters and small letters are distinguished.

namespaceURI

Specify the namespace URI of the element.

root

If null is set, return a list of the Element nodes with the specified local name and namespace URI for entire document.

If a node is set, return a list of the Element nodes with the specified local name and namespace URI in the desendant nodes of this node.

Return value

All the Element nodes with the specified local name and namespace URI are returned as the pointer to the SFXXMLNode::DOMNodeList instance.

Description

All the Element nodes with the specified local name and namespace URI are stored in the SFXXMLNode::DOMNodeList instance.

[Note] Note

When the tag name is specified, the SFXXMLDocument::GetElementsByTagName function will be used.

[Note] Note

The SFXXMLElement::GetElementsByTagNameNS function internally calls this function by specifying the root argument.

[Note] Note

To get the nodes of the specific node type, use the SFXXMLDocument::GetListsByTypeFilter function.

Reference

SFXXMLDocument::GetElementsByTagName | SFXXMLElement::GetElementsByTagNameNS | SFXXMLNode::DOMNodeList | SFXXMLDocument::GetListsByTypeFilter | SFXXMLElement | SFXXMLNode


SFXXMLDocument::GetEncoding
Get the encoding.
[ public, const ]
ACharConstPtr GetEncoding(Void);

Return value

Return null if the encoding is not set.

Reference

SFXXMLDocument::SetEncoding


SFXXMLDocument::GetFirstChild
Get the first child node.
[ public, virtual, const ]
SFXXMLNodePtr GetFirstChild(Void);

Return value

Return the first child node of this node. Return null if this node has no child.

Example

SFXXMLDOMParser parser; // DOM Parser
    
SFXXMLDocumentPtr root = parser.GetDocument(); // get root node
SFXXMLNodePtr child = root->GetFirstChild();   // get first child of root node
    

Reference

SFXXMLNode::GetFirstChild | SFXXMLNode


SFXXMLDocument::GetLastChild
Get the last child node.
[ public, virtual, const ]
SFXXMLNodePtr GetLastChild(Void);

Return value

Return the last child node of this node. Return null if this node has no child.

Reference

SFXXMLNode::GetLastChild | SFXXMLNode


SFXXMLDocument::GetListsByTypeFilter
Get all the nodes that match the specified node type.
[ public, const ]
DOMNodeListPtr GetListsByTypeFilter(
    NodeType type   // node type
);

Return value

Return all the nodes(DOMNodeList type) that match the specified node type.

Description

All the nodes of the specified node type are stored in the SFXXMLNode::DOMNodeList instance. For example, if the "type argument" is specified with COMMENT_NODE, then all the Comment nodes are returned.

To get the Element nodes with the specific tag name, use the SFXXMLDocument::GetElementsByTagName function.

Example

// get all nodes that are ELEMENT_NODE
SFXXMLNode::DOMNodeListPtr list = root->GetListsByTypeFilter(ELEMENT_NODE);
if (list) {
    // get each node
    SFXXMLNode::DOMNodeList::Enumerator iter = list->GetFirstEnumerator();
    while (iter.HasNext()) {
 SFXXMLNodePtr child = iter.GetNext();            
        if(child->GetNodeType() == SFXXMLNode::ELEMENT_NODE);
            ...
    }
}

Reference

SFXXMLDocument::GetElementsByTagName| SFXXMLNode


SFXXMLDocument::GetNodeName
Get the node name.
[ public, virtual, const ]
ACharConstPtr GetNodeName(Void);

Return value

Return the "#document" string.

Reference

SFXXMLNode::GetNodeName| SFXXMLNode


SFXXMLDocument::GetNodeType
Get the node type.
[ public, virtual, const ]
NodeType GetNodeType(Void);

Return value

Return DOCUMENT_NODE.

Reference

SFXXMLNode::NodeType | SFXXMLNode::GetNodeType | SFXXMLNode


SFXXMLDocument::GetStandalone
Check whether Standalone is set or not.
[ public, const ]
Bool GetStandalone(Void);

Return value

  • If yes: true
  • Otherwise: false

Reference

SFXXMLDocument::SetStandalone


SFXXMLDocument::GetVersion
Get the version number.
[ public, const ]
ACharConstPtr GetVersion(Void);

Reference

SFXXMLDocument::SetVersion


SFXXMLDocument::HasChildNodes
Check whether this node has any child nodes or not.
[ public, virtual, const ]
Bool HasChildNodes(Void);

Return value

  • If yes: true
  • Otherwise: false

Reference

SFXXMLNode::HasChildNodes| SFXXMLNode


SFXXMLDocument::InsertBefore
Insert the specified node.
[ public, virtual ]
SFCError InsertBefore(
    SFXXMLNodeConstPtr newchild   // node to insert
    SFXXMLNodeConstPtr refchild   // newchild node is inserted before refchild node
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED

Reference

SFXXMLNode::InsertBefore| SFXXMLNode


SFXXMLDocument::RemoveChild
Remove the specified child node including its descendant nodes.
[ public, virtual ]
SFCError RemoveChild(
    SFXXMLNodeConstPtr oldchild   // child node to remove
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid parameter: SFERR_INVALID_PARAM
  • If failed: SFERR_FAILED

Reference

SFXXMLNode::RemoveChild| SFXXMLNode


SFXXMLDocument::ReplaceChild
Replace the specified child node.
[ public, virtual ]
SFCError ReplaceChild(
    SFXXMLNodeConstPtr newchild   // new child node to replace with
    SFXXMLNodeConstPtr oldchild   // old child node to be replaced
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid argument: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED

Reference

SFXXMLNode::ReplaceChild| SFXXMLNode


SFXXMLDocument::Save
Save the document to file.
[ public ]
SFCError Save(
    SFXAnsiStringConstRef output   // file name
    Bool indent = true             // whether indented or not
);
[ public ]
SFCError Save(
    SFXPathConstRef output   // file path
    Bool indent = true       // whether indented or not
);
[ public ]
SFCError Save(
    SFXOutputStreamRef output   // output stream
    Bool indent = true          // whether indented or not
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If file has already opened: SFERR_INVALID_STATE
  • If path is not a directory: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED

Description

By default, application home directory is set to file path.


SFXXMLDocument::SetDocumentType
Set the DocumentType node.
[ public ]
Void SetDocumentType(
    SFXXMLDocumentTypeConstPtr doctype   // DocumentType node
);

Reference

SFXXMLDocument::GetDocumentType


SFXXMLDocument::SetEncoding
Set the encoding.
[ public ]
Void SetEncoding(
    SFXAnsiStringConstRef encoding   // the encoding to set
);

Reference

SFXXMLDocument::GetEncoding


SFXXMLDocument::SetStandalone
Set the Standalone attribute.
[ public ]
Void SetStandalone(
    Bool standalone   // standalone or not
);

Reference

SFXXMLDocument::GetStandalone


SFXXMLDocument::SetVersion
Set the version number.
[ public ]
Void SetVersion(
    SFXAnsiStringConstRef version   // version number
);

Reference

SFXXMLDocument::GetVersion