Parse XML With XPath Expression : XML Path « JSTL « Java Tutorial

<%@ taglib uri="" prefix="c" %>
<%@ taglib uri=""  prefix="x" %>

    <title>xml actions</title>
    This example parses XML and uses an XPath expression...

    <c:set var="someXML">
    <x:parse var="parsedDocument" xml="${someXML}" />

    Here is a list of people:
      <x:forEach select="$parsedDocument/people/person">
        <li> <x:out select="name" /> </li>
  Download: 5,143 k)

24.33.XML Path
24.33.1.Output XML with Select Statement
24.33.2.Use ForEach Loop to Select XML Path
24.33.3.Set Variable by Selecting XML Path
24.33.4.Parse XML With XPath Expression
24.33.5.Parse XML and Path Select
24.33.6.Use JSTL to output and extract XML element with XPATH