<%@ taglib uri="..." prefix="tl" %>
<html>
<tl:parse id="saleBooks" type="BookInventory"
xml="Book_Inventory_URL"/>
<head>...
<body>
<table border="0" width="50%">
<tl:iterate
id ="bk" type="Book"
collection="<%= saleBooks.getBooks()%>" >
<tr>
<td><jsp:getProperty name="bk" property="title"/></td>
</tr>
</tl:iterate>
</table>
</body>
</html>
2.4 Parse and Iterate
<%@ taglib uri="..." prefix="tl" %>
<html>
<head>...
<body>
<table border="0" width="50%">
<tl:iterateOnXMLStream
id="bk" type="Book"
xml="Book_Inventory_URL">
<tr>
<td><jsp:getProperty name="bk" property="title"/></td>
</tr>
</tl:iterateOnXMLStream>
</table>
</body>
</html>
2.5 Combining Data
(插图2)
2.6 Insert After Transformation
<%@taglib uri="http://jakarta.apache.org/taglibs/xsl/1.0"
prefix="x" %>
<html>
<head>...
<body>
<center> Welcome
<x:apply xml="Customer_URL" xsl="store.xsl"/>!
<p>
On Sale Today ...
<p>
<x:apply xml="Inventory_URL" xsl="store.xsl"/>
</center>
</body>
</html>
2.7 Producing XML
* Client may be
– Gateway
– Device (WAP, XHTML)
* XML
* XML + StyleSheet
2.8 VoiceXML and WAP Gateways
(插图3)
2.9 Generating XML
J1 @ java.sun.com
(插图4)
2.10 XSLT on XML
(插图5)
2.11 JSP and XSLT
* JSP strengths
– Template & Java
– Multiple Sources
– Open-ended Portable Abstraction
* XSLT strengths
– Recursive tree transformation
– Well defined input/output
* XPath
2.12 Generating Content for
Multiple Devices
* One back end source
* Many clients
* Minimize Total Maintenance Cost
* Desired Generation Performance
2.13 Multiple Clients
XSLT Stylesheet
(插图6)
2。14 Multiple Clients
Short Pipelines
(插图7)
2.15 Multiple Clients
Combined Approach
如果您对本文有任何疑问或者建议,请到讨论区发表您的意见:
>>
论坛入口 <<
上一篇:JSP+XML的技术纲要(2) 下一篇:.NET使XML串行化易如反掌
【文章评论】
【收藏本文】
【推荐好友】
【打印本文】
【我要投稿】 【论坛讨论】