apply.jsp
来自「jakarta-taglibs」· JSP 代码 · 共 67 行
JSP
67 行
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl" %>
<html>
<head>
<title>Employee List</title>
</head>
<body bgcolor="white">
<p>This page creates several versions of the same table, using the same XML
data and XSL stylesheet (so that the output should appear identically), but
using different techniques to retrieve the XML data. Display the source of
this JSP page (from the examples menu) to see how these techniques are used.
</p>
<hr>
<p>This version of the table was created by reading an external XML document
and an external XSL stylesheet.</p>
<xsl:apply xml="/xml/employees.xml" xsl="/xml/employeeList.xsl"/>
<hr>
<p>This version of the table was created by treating the nested content as
the XML document (simulating the case where the JSP page itself would be
rendering XML output), but using an external XSL stylesheet.</p>
<xsl:apply xsl="/xml/employeeList.xsl">
<?xml version="1.0" encoding="ISO-8859-1"?>
<employees>
<employee id="123">
<first-name>John</first-name>
<last-name>Doe</last-name>
<telephone>800-555-1212</telephone>
</employee>
<employee id="456">
<first-name>Jane</first-name>
<last-name>Smith</last-name>
<telephone>888-555-1212</telephone>
</employee>
<employee id="789">
<first-name>George</first-name>
<last-name>Taylor</last-name>
<telephone>555-555-1212</telephone>
</employee>
</employees>
</xsl:apply>
<hr>
<p>This version of the table was created by loading the nested content with
an <code><xsl:include></code> action (simulating asking a different
servlet or JSP page to render the desired XML data) and using the same
external XSL stylesheet.</p>
<xsl:apply xsl="/xml/employeeList.xsl">
<xsl:include page="/xml/employees.xml"/>
</xsl:apply>
<hr>
<p>This version of the table was created by importing the XML data into a
page-scope attribute, and then applying the stylesheet to it.</p>
<xsl:import id="data" page="/xml/employees.xml"/>
<xsl:apply nameXml="data" xsl="/xml/employeeList.xsl"/>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?