Format class XNode toString method, make the sub label retract a 'tab'. eclipse "ctrl+shift+i" to watch the value of variable friendly.
Comment From: Dreamroute
@harawata I have add a test case.pls check.
Comment From: harawata
Thanks for the update, @Dreamroute !
There seems to be a problem with a node with 3+ levels. Try this test:
@Test
public void formatXNodeToStringDeep() {
XPathParser parser = new XPathParser("<a><b><c><d>text</d></c></b></a>");
String actual = parser.evalNode("/a").toString();
String expect = "<a>\n\t<b>\n\t\t<c>\n\t\t\t<d>text</d>\n\t\t</c>\n\t</b>\n</a>\n";
assertEquals(expect, actual);
}
Comment From: Dreamroute
@harawata I have solve the 3+ level format and add 3 test case.
Comment From: Dreamroute
@harawata your 2 suggest have done.
Comment From: harawata
Hi @Dreamroute . It's merged. I cleaned up your commits and force-pushed. Hope you don't mind. Thanks again for your work!
Comment From: harawata
HI @Dreamroute ,
I noticed that this patch is not good enough for actual mapper statements. Here is an example (a node contains both body text and a child element):
<select id="getUser" resultType="org.apache.ibatis.submitted.foreach.User">
select * from users WHERE id in (
<foreach item="friendList" index="index" collection="friendList" separator=",">
#{friendList.id}
</foreach>
)
</select>
Do you think you can fix it?