test_remove.jsp

来自「jakarta-taglibs」· JSP 代码 · 共 60 行

JSP
60
字号
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test Remove Example</title>
<link rel="stylesheet" href="examples.css" type="text/css">
</head>

<body>

<h1>Test Remove Example</h1>

<p>This demo tests the use of the &lt;xtags:remove&gt; tag to remove nodes from an XML document.</p>


<hr/>

<xtags:parse>
  <a x="1" y="1">
    <b>
      <c d="123" e="456">
        <foo>abcd</foo>
      </c>
    </b>
    <d x="33" y="99">
      <foo>whoo</foo>
      <e x="234" y="4912">
        <foo>def</foo>
      </e>
    </d>
  </a>
</xtags:parse>


<h2>Before Removals</h2>

<xtags:copyOf select="/"/>

<hr/>


<h2>After Removals</h2>

<xtags:forEach select="//c">
  <xtags:remove select="foo"/>
  <xtags:remove select="@e"/>
</xtags:forEach>

<xtags:remove select="a/d//foo"/>
<xtags:remove select="//@x"/>

<xtags:copyOf select="/"/>


<hr/>

</body>
</html>

⌨️ 快捷键说明

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