background image

XML Tag Library

<< Miscellaneous Tags | Core Tags >>
<< Miscellaneous Tags | Core Tags >>

XML Tag Library

TABLE 7­4
XML Tags
Area
Function
Tags
Prefix
XML
Core
out
parse
set
x
Flow control
choose
when
otherwise
forEach
if
Transformation
transform
param
A key aspect of dealing with XML documents is to be able to easily access their content. XPath
(see
http://java.sun.com/webservices/jaxp/
), a W3C recommendation since 1999,
provides an easy notation for specifying and selecting parts of an XML document. In the JSTL
XML tags, XPath expressions specified using the select attribute are used to select portions of
XML data streams. Note that XPath is used as a local expression language only for the select
attribute. This means that values specified for select attributes are evaluated using the XPath
expression language but that values for all other attributes are evaluated using the rules
associated with the JSP 2.0 expression language.
In addition to the standard XPath syntax, the JSTL XPath engine supports the following scopes
to access web application data within an XPath expression:
$foo
$param:
$header:
$cookie:
$initParam:
$pageScope:
$requestScope:
$sessionScope:
$applicationScope:
These scopes are defined in exactly the same way as their counterparts in the JSP expression
language discussed in
"Implicit Objects" on page 162
.
Table 7­5
shows some examples of using
the scopes.
XML Tag Library
The Java EE 5 Tutorial · September 2007
212