728x90
728x90
SMALL
<x:out>
- <%= ... >와 비슷하지만 XPath 표현식용입니다.
Attributes
Name | Required | Request-time | Type | Description |
select | true | false | java.lang.String | 평가할 XPath 표현식입니다. |
escapeXml | false | true | java.lang.String | 결과 문자열의 문자 <,>,&,',"를 해당 문자 엔티티 코드로 변환해야 하는지 여부를 결정합니다. 기본값은 true입니다. |
Example
<%@ 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 x:out Tags</title>
</head>
<body>
<h3>Books Info:</h3>
<c:set var = "xmltext">
<books>
<book>
<name>Padam History</name>
<author>ZARA</author>
<price>100</price>
</book>
<book>
<name>Great Mistry</name>
<author>NUHA</author>
<price>2000</price>
</book>
</books>
</c:set>
<x:parse xml = "${xmltext}" var = "output"/>
<b>The title of the first book is</b>:
<x:out select = "$output/books/book[1]/name" />
<br>
<b>The price of the second book</b>:
<x:out select = "$output/books/book[2]/price" />
</body>
</html>
Result
Books Info:
The title of the first book is: Padam History
The price of the second book: 2000
728x90
728x90
LIST
'JSP > JSTL XML' 카테고리의 다른 글
[JSP][JSTL XML] <x:otherwise> (0) | 2021.08.06 |
---|---|
[JSP][JSTL XML] <x:forEach> (0) | 2021.08.06 |
[JSP][JSTL XML] <x:if> (0) | 2021.08.06 |
[JSP][JSTL XML] <x:choose> (0) | 2021.07.30 |