pub struct ETreeNode { /* private fields */ }Expand description
Element tree node
etree.ETreeNode stores information of a tree node.
namespace: value of xmlns or xmlns:XXXnamespace_abbrev: none or xmlns:XXXtag: {namespace}+localnamename:namespace_abbrev+:+localnamelocalname: tag nametext: text between open tag and the next open tag or close tagtail: text between close tag and the next open tag or close tagattr: key-value pairs in the open tagidx: id for the node for internal useageroute: descendant route from root to parent for internal usage (format:#root_idx#child_idx#child_child_idx#)
For the following xml file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="xxx.xxx.controller"></context:component-scan>
<context:annotation-config />
<mvc:default-servlet-handler/>
<mvc:annotation-driven/>
<mvc:resources mapping="/images/**" location="/images/" />
<bean id="xxx" class="xxx.xxx.xxx.Xxx">
<property name="xxx" value="xxxx"/>
</bean>
</beans>For node <context:component-scan base-package="xxx.xxx.controller"></context:component-scan>:
namespace:"http://www.springframework.org/schema/context"namespace_abbrev:"context"tag:"{http://www.springframework.org/schema/context}component-scan"name:"context:component-scan"localname:"component-scan"text:""tail:"\n "attr:[("base-package", "xxx.xxx.controller"), ]
Implementations
sourceimpl ETreeNode
impl ETreeNode
pub fn new(localname: &str) -> ETreeNode
pub fn get_idx(&self) -> usize
pub fn get_route(&self) -> String
pub fn get_namespace(&self) -> String
pub fn get_namespace_abbrev(&self) -> String
pub fn get_tag(&self) -> String
pub fn get_name(&self) -> String
pub fn get_localname(&self) -> String
pub fn get_text(&self) -> Option<String>
pub fn get_tail(&self) -> String
pub fn set_idx(&mut self, idx: usize)
pub fn set_route(&mut self, text: &str)
pub fn set_namespace(&mut self, text: &str)
pub fn set_namespace_abbrev(&mut self, text: &str)
pub fn set_text(&mut self, text: &str)
pub fn set_tail(&mut self, text: &str)
pub fn get_attr_count(&self) -> usize
pub fn get_attr_iter(&self) -> Iter<'_, (String, String)>
pub fn get_attr(&self, key: &str) -> Option<String>
pub fn set_attr(&mut self, key: &str, value: &str) -> usize
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ETreeNode
impl Send for ETreeNode
impl Sync for ETreeNode
impl Unpin for ETreeNode
impl UnwindSafe for ETreeNode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more