pub fn string_value(&self) -> String {
        match self.d().node_type {
            NodeType::Document | NodeType::Element { .. } => {
                let mut s = String::new();
                let mut it = self.descendants_or_self();
                it.next();
                for n in it {
                    match n.d().node_type {
                        NodeType::Text(idx) => {
                            s.push_str(self.document.strings[idx.get_usize()].as_str())
                        }
                        _ => {}
                    }
                }
                s
            }
            NodeType::Attribute { value, .. } => self.document.strings[value.get_usize()].clone(),
            NodeType::Text(idx) | NodeType::Comment(idx) => {
                self.document.strings[idx.get_usize()].clone()
            }
            NodeType::PI(pi) => pi.value.map_or(String::new(), |idx| {
                self.document.strings[idx.get_usize()].clone()
            }),
        }
    }
/// The string_value accessor returns the string value of a node.
///
/// # Examples
///
/// ```
/// let doc = smop_xmltree::nod::Document::parse(
///     "<r><e>Hello</e> <e><i>World</i></e><!-- nope --></r>"
/// ).unwrap();
///
/// assert_eq!(doc.root().string_value().as_str(), "Hello World");
/// ```
The string_value accessor returns the string value of a node.
The string_value accessor returns the string value of a node .
pub fn string_value(&self) -> String {
        match self.d().node_type {
            NodeType::Document | NodeType::Element { .. } => {
                let mut s = String::new();
                let mut it = self.descendants_or_self();
                it.next();
                for n in it {
                    match n.d().node_type {
                        NodeType::Text(idx) => {
                            s.push_str(self.document.strings[idx.get_usize()].as_str())
                        }
                        _ => {}
                    }
                }
                s
            }
            NodeType::Attribute { value, .. } => self.document.strings[value.get_usize()].clone(),
            NodeType::Text(idx) | NodeType::Comment(idx) => {
                self.document.strings[idx.get_usize()].clone()
            }
            NodeType::PI(pi) => pi.value.map_or(String::new(), |idx| {
                self.document.strings[idx.get_usize()].clone()
            }),
        }
    }
pub fn string_value ( & self ) -> String { match self . d ( ) . node_type { NodeType :: Document | NodeType :: Element { .. } => { let mut s = String :: new ( ) ; let mut it = self . descendants_or_self ( ) ; it . next ( ) ; for n in it { match n . d ( ) . node_type { NodeType :: Text ( idx ) => { s . push_str ( self . document . strings [ idx . get_usize ( ) ] . as_str ( ) ) } _ => { } } } s } NodeType :: Attribute { value , .. } => self . document . strings [ value . get_usize ( ) ] . clone ( ) , NodeType :: Text ( idx ) | NodeType :: Comment ( idx ) => { self . document . strings [ idx . get_usize ( ) ] . clone ( ) } NodeType :: PI ( pi ) => pi . value . map_or ( String :: new ( ) , | idx | { self . document . strings [ idx . get_usize ( ) ] . clone ( ) } ) , } }
The string_value accessor returns the string value of a node.
The string_value accessor returns the string value of a node .
&self
examples
```
let doc = smop_xmltree::nod::Document::parse(
"Hello World"
).unwrap().

assert_eq!(doc.root().string_value().as_str(), "Hello World");
```
` ` ` let doc = smop_xmltree :: nod :: Document :: parse ( " Hello World " ) . unwrap () . assert_eq! ( doc . root () . string_value () . as_str () " Hello World " ) ; ` ` `