XML DOM - DOM NodeList Object - DOM NodeList Object Attribute Length - XML DOM

Explain the length attribute of the NodeList Object

The number of nodes in the node list is provided by the length attribute of the NodeList object.

Syntax

The syntax for using the length attribute is as follows:

Example

node.xml contents are as below -

An XML document node.xml is parsed into XML DOM objectand by using the length attribute the length information is extracted.

Execution

The file is saved as nodeattribute_length.htm on the server path and this file should be on the same path as that of node.xml in the server. The output appears as follows:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML DOM Topics