ZVON > References > DOM2 Reference

whatToShow (attribute )

Owning interface and usage:  
TreeWalker.whatToShow

Member of these other interfaces:  
none

Readonly:   yes

Type:   unsigned

Description:  
This attribute determines which node types are presented via the TreeWalker. The available set of constants is defined in the NodeFilter interface. Nodes not accepted by whatToShow will be skipped, but their children may still be considered. Note that this skip takes precedence over the filter, if any.

Available values for the whatToShow attribute:
These are the available values for the whatToShow parameter used in TreeWalkers and NodeIterators. They are the same as the set of possible types for Node, and their values are derived by using a bit position corresponding to the value of nodeType for the equivalent node type. If a bit in whatToShow is set false, that will be taken as a request to skip over this type of node; the behavior in that case is similar to that of FILTER_SKIP.
Note that if node types greater than 32 are ever introduced, they may not be individually testable via whatToShow. If that need should arise, it can be handled by selecting SHOW_ALL together with an appropriate NodeFilter.
0xFFFFFFFF = SHOW_ALL (of type unsigned long)
Show all Nodes.
0x00000001 = SHOW_ELEMENT (of type unsigned long)
Show Element nodes.
0x00000002 = SHOW_ATTRIBUTE (of type unsigned long)
Show Attr nodes. This is meaningful only when creating an iterator or tree-walker with an attribute node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. Since attributes are never children of other nodes, they do not appear when traversing over the document tree.
0x00000004 = SHOW_TEXT (of type unsigned long)
Show Text nodes.
0x00000008 = SHOW_CDATA_SECTION (of type unsigned long)
Show CDATASection nodes.
0x00000010 = SHOW_ENTITY_REFERENCE (of type unsigned long)
Show EntityReference nodes.
0x00000020 = SHOW_ENTITY (of type unsigned long)
Show Entity nodes. This is meaningful only when creating an iterator or tree-walker with an Entity node as its root; in this case, it means that the Entity node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.
0x00000040 = SHOW_PROCESSING_INSTRUCTION (of type unsigned long)
Show ProcessingInstruction nodes.
0x00000080 = SHOW_COMMENT (of type unsigned long)
Show Comment nodes.
0x00000100 = SHOW_DOCUMENT (of type unsigned long)
Show Document nodes.
0x00000200 = SHOW_DOCUMENT_TYPE (of type unsigned long)
Show DocumentType nodes.
0x00000400 = SHOW_DOCUMENT_FRAGMENT (of type unsigned long)
Show DocumentFragment nodes.
0x00000800 = SHOW_NOTATION (of type unsigned long)
Show Notation nodes. This is meaningful only when creating an iterator or tree-walker with a Notation node as its root; in this case, it means that the Notation node will appear in the first position of the traversal. Since notations are not part of the document tree, they do not appear when traversing over the document tree.