1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/// Represents the different types of nodes that can exist in an XML/XHTML document tree.
///
/// This enum defines the fundamental node types used in parsing and representing
/// XML/XHTML documents:
///
/// # Variants
///
/// * `Head` - The head node of the document tree, representing the document itself
/// * `Element` - An XML/XHTML element with a name and optional attributes
/// - `name`: Location information for the element's tag name in the source
/// - `attributes`: Range information for the element's attributes
/// * `Text` - A text node containing character data between elements
/// - Contains location information for the text content in the source
use crate;
use Debug;
/// Custom implementation of the `Debug` trait for `NodeType`.
///
/// This implementation provides human-readable debug output for the different
/// variants of `NodeType`:
///
/// - `Root`: Displays as "Root"
/// - `Element`: Displays as "Element(name: `the_name_range`, attributes: `the_attributes_range`)"
/// - `Text`: Displays as "`Text(text_content_range)`"
///
/// This is useful for debugging and logging purposes when working with the
/// node tree structure.