search

Home  >  Q&A  >  body text

java - dom4j 怎样获取指定节点内部的所有内容,包含标签。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

<code>  <select id="list" resultMap="BaseResultMap">

    select

    <include refid="Base_Column_List" />

    from loginuser

 

    where

    type = #{type}

    <if test='"0".equals(examine)' >

      and (examine is null or examine='0')

    </if>

    <if test='"1".equals(examine)' >

      and examine='1'

    </if>

  </select></code>

1

2

3

4

5

<code>Element sqlElm = (Element) doc.selectSingleNode(String.format("/mapper/*[@id='%s']",sqlId));;

System.out.println(sqlElm.getData());

System.out.println(sqlElm.getText());

System.out.println(sqlElm.getDocument());

String sqlContent = sqlElm.getStringValue();</code>

获得 id=list 的时候里面的标签都没了,我需要里面的标签怎么获得,就像jquery 里的 html() 方法一样。

大家讲道理大家讲道理2893 days ago518

reply all(0)I'll reply

No reply
  • Cancelreply