You are here: Reference > JavaScript > client-side > xml handling > properties > expandEntityReferences (NodeIterator, TreeWalker)

expandEntityReferences property (NodeIterator, TreeWalker)

Browser support:
9
Returns a Boolean value that indicates whether the children of entity reference nodes are visible to the NodeIterator or TreeWalker object.
Note: The TreeWalker and NodeIterator objects and their expandEntityReferences properties are supported in Internet Explorer from version 9.
You can set this property by the fourth parameter of the createNodeIterator or createTreeWalker method.

Syntax:

object.expandEntityReferences;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Boolean that indicates the expansion state.
One of the following values:
false
The children of entity reference nodes are hidden to the NodeIterator or TreeWalker object.
true
The children of entity reference nodes are visible to the NodeIterator or TreeWalker object.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the expandEntityReferences property:
<head>
    <script type="text/javascript">
        function TestExpandEntityReferences () {
            if (document.createTreeWalker) {
                var walker = document.createTreeWalker (document.body, NodeFilter.SHOW_ALL, null, true);
                if (walker.expandEntityReferences) {
                    alert ("The children of entity reference nodes are visible to the TreeWalker.");
                }
                else {
                    alert ("The children of entity reference nodes are hidden to the TreeWalker.");
                }
            }
            else {
                alert ("Your browser does not support the createTreeWalker method!");
            }
        }
    </script>
</head>
<body>
    <button onclick="TestExpandEntityReferences ()">Test expandEntityReferences property</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content