nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

Microsoft XML Core Services (MSXML) 4.0 - DOM Reference

lastChild Property

Returns the last child node.

[Script]

Script Syntax

var objXMLDOMNode = oXMLDOMNode.lastChild;

Example

The following script example creates a new IXMLDOMNode (element) object, and then inserts it before the last child of the top-level node.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var root;
var newNode;
var currNode;
xmlDoc.async = false;
xmlDoc.load("books.xml");
var root = xmlDoc.documentElement;
alert(root.xml);
var newNode = xmlDoc.createNode(1, "VIDEOS", "");
currNode = root.insertBefore(newNode, root.lastChild);
alert(root.xml);
[Visual Basic]

Visual Basic Syntax

Set objXMLDOMNode = oXMLDOMNode.lastChild

Example

The following Microsoft® Visual Basic® example creates a new IXMLDOMNode (element) object, and then inserts it before the last child of the top-level node.

Dim xmlDoc As New Msxml2.DOMDocument40
Dim root As IXMLDOMElement
Dim newNode As IXMLDOMNode
Dim currNode As IXMLDOMNode
xmlDoc.async = False
xmlDoc.Load ("books.xml")
Set root = xmlDoc.documentElement
MsgBox root.xml
Set newNode = xmlDoc.createNode(NODE_ELEMENT, "VIDEOS", "")
Set currNode = root.insertBefore(newNode, root.lastChild)
MsgBox root.xml
[C/C++]

C/C++ Syntax

HRESULT get_lastChild(
    IXMLDOMNode **lastChild);

Parameters

lastChild [out, retval]
The last child node. If there are no children, it returns Null.

C/C++ Return Values

S_OK
The value returned if successful.
S_FALSE
The value returned when there are no children.
E_INVALIDARG
The value returned if lastChild is null.

Remarks

The property is read-only. If there are no children, it returns Null.

This value depends on the value of the nodeType property.

NODE_ATTRIBUTE, NODE_DOCUMENT, NODE_DOCUMENT_FRAGMENT, NODE_DOCUMENT_TYPE, NODE_ELEMENT, NODE_ENTITY, NODE_ENTITY_REFERENCE Returns the last child node. If there are no children, returns Null.
NODE_CDATA_SECTION, NODE_COMMENT, NODE_NOTATION, NODE_PROCESSING_INSTRUCTION, NODE_TEXT Returns Null. These node types cannot have children.

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

nodeType Property

Applies to: IXMLDOMAttribute | IXMLDOMCDATASection | IXMLDOMCharacterData | IXMLDOMComment | DOMDocument | IXMLDOMDocumentFragment | IXMLDOMDocumentType | IXMLDOMElement | IXMLDOMEntity | IXMLDOMEntityReference | IXMLDOMNode | IXMLDOMNotation | IXMLDOMProcessingInstruction | IXMLDOMText


Download de SDK