pub struct ETreeNode { /* private fields */ }
Expand description

Element tree node

etree.ETreeNode stores information of a tree node.

  • namespace: value of xmlns or xmlns:XXX
  • namespace_abbrev: none or xmlns:XXX
  • tag: namespace+localname
  • name: namespace_abbrev + : + localname
  • localname: tag name
  • text: text between open tag and the next open tag or close tag
  • tail: text between close tag and the next open tag or close tag
  • attr: key-value pairs in the open tag
  • idx: id for the node for internal useage
  • route: 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/contextcomponent-scan"
  • name: "context:component-scan"
  • localname: "component-scan"
  • text: ""
  • tail: "\n "
  • attr: [("base-package", "xxx.xxx.controller"), ]

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

transform root node into a tree

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.