<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
xmlns:db="http://www.milyn.org/xsd/smooks/db-routing-1.1.xsd"
xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd"
xmlns:ds="http://www.milyn.org/xsd/smooks/datasource-1.1.xsd">
<ds:direct bindOnElement="#document" datasource="DB" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/dbase" username="root" password="praya123" autoCommit="false" />
<db:executor executeOnElement="Invoice" datasource="DB" executeBefore="true">
<db:statement>SELECT * FROM custinfo</db:statement>
<db:resultSet name="rs_custinfo" />
</db:executor>
<db:executor executeOnElement="Invoice" datasource="DB" executeBefore="true">
<db:statement>select * from callRates</db:statement>
<db:resultSet name="rs_callRates" />
</db:executor>
<db:executor executeOnElement="Invoice" datasource="DB" executeBefore="true">
<db:statement>select * from InvoiceSummary</db:statement>
<db:resultSet name="rs_InvoiceSummary" />
</db:executor>
<db:executor executeOnElement="Invoice" datasource="DB" executeBefore="true">
<db:statement>select * from InvoiceDetail</db:statement>
<db:resultSet name="rs_InvoiceDetail" />
</db:executor>
<ftl:freemarker applyOnElement="Invoice">
<ftl:template>
<!--
<#assign x=1>
<#list 1..x as i>
<DETAIL>
<DT_INV_HDR1>${rs_custinfo[i].BillingAccNo}</DT_INV_HDR1>
<DT_INV_HDR2>${rs_custinfo[i].CustNo}</DT_INV_HDR2>
<DT_INV_HDR3>${rs_custinfo[i].InvoiceNo}</DT_INV_HDR3>
<DT_INV_HDR4>${rs_custinfo[i].InvoiceDate}</DT_INV_HDR4>
<DT_INV_HDR5>${rs_custinfo[i].PaymentDueDate}</DT_INV_HDR5>
<DT_INV_HDR6/>
<DT_INV_HDR7/>
</DETAIL>
</#list>
-->
</ftl:template>
</ftl:freemarker>
</smooks-resource-list>
how to fetch data with java ? Can anyone give any specific way to do that ?
DZone has a very good, comprehensive refacrd on this you should read.
Look here: http://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/
Edit: You'll find a class to parse XML, it may be useful.
精彩评论