⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x_out.jsp

📁 jsp入门级代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=GBK"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<html>
<head>
  <title>JSTL: XML -- Parse / Out</title>
</head>
<body>
<h3>parse和out标签的实例</h3>
<c:import var="docString" url="games.xml"/><!--引入games.xml文件-->
<x:parse var="doc" doc="${docString}"/>
<table border=1>
  <tr>
    <td valign="top"><pre><c:out value="${docString}"/></pre></td>
    <td valign="top">
      <table border=1>
        <tr>
          <th>XPath表达式</th>
          <th>查找到的元素</th>
        </tr>
        <tr>
          <td>$doc//sport</td>
          <td><pre><x:out select="$doc//sport"/></pre></td>
        </tr>
        <tr>
          <td>$doc/games/country/*</td>
          <td><pre><x:out select="$doc/games/country/*"/></pre></td>
        </tr>
        <tr>
          <td>$doc//*</td>
          <td><pre><x:out select="$doc//*"/></pre></td>
        </tr>
        <tr>
          <td>$doc/games/country</td>
          <td><pre><x:out select="$doc/games/country"/></pre></td>
        </tr>
        <tr>
          <td>$doc/games/country[last()]</td>
          <td><pre><x:out select="$doc/games/country[last()]"/></pre></td>
        </tr>
        <tr>
          <td>$doc//@id</td>
          <td><pre><x:out select="$doc//@id"/></pre></td>
        </tr>
        <tr>
          <td>$doc//country[@id='Denmark']</td>
          <td><pre><x:out select="$doc//country[@id='Denmark']"/></pre></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -