VCOM:VectorWorks:Filing:IXMLFileNode::GetChildNode

From Vectorworks Developer
Jump to navigation Jump to search

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks::Filing

Member of VCOM:VectorWorks:Filing:IXMLFileNode

The non indexed funtion wil get the first found child node with specified name inside this node instance. It starts looking from the first child node on.

The indexed funtoin allow you accessing all the child nodes as if they are in array.

The indexed funtion will fail if there is no child node with this name and index.

The child nodes with the specified name are treated as sequential even though in the XML they may not appear one after another. The index is the index in that sequence. The first child is with index 0 (zero)

virtual VCOMError VCOM_CALLTYPE GetChildNode(
const TXString& name,
IXMLFileNode** ppOutNode) = 0;
virtual VCOMError VCOM_CALLTYPE GetChildNode(
const TXString& name,
size_t arrayIndex,
IXMLFileNode** ppOutNode) = 0;

Parameters

name const TXString& The name of the new child.
ppOutNode IXMLFileNode** Output parameter. Instance the found child.

Return Value

Uses standard VCOM Error Reporting.

Return value meaning:

kVCOMError_NotInitialized Bad VCOM instance used to call the fuction.
kVCOMError_Failed Routine failed.

Remarks

Note The XML allows to have may childs with the same name inside single XML node. This call will return the first found child node with the specified name.

Example

// the new child is an empty VCOM instance
// the GetChildNode call queries instance for the new child
IXMLFileNode pNewChild;
pThisNode->GetChildNode( "nodeName", & pNewChild );

// returns the same node as above
// Note using 'pNewChild' will cause 'Release' of the previous
//    instance, and query of new instance
pThisNode->GetChildNode( "nodeName", 0, & pNewChild );

// returns the second node with the "nodeName" in the child list
pThisNode->GetChildNode( "nodeName", 1, & pNewChild );

See Also

VCOM:VectorWorks:Filing:IFolderIdentifier | VCOM:VectorWorks:Filing:IFileIdentifier | VCOM:VectorWorks:Filing:IXMLFileNode | VCOM:VectorWorks:Filing:IXMLFile

[[VCOM:VectorWorks:Filing:IFolderIdentifier]] | [[VCOM:VectorWorks:Filing:IFileIdentifier]] | [[VCOM:VectorWorks:Filing:IXMLFileNode]] | [[VCOM:VectorWorks:Filing:IXMLFile]]