Java Reference
In-Depth Information
<name>Jane Doe</name>
<diagnosis>Broken ankle</diagnosis>
</patient>
<patient id="3">
<name>Jack Brown</name>
<diagnosis>Food allergy</diagnosis>
</patient>
</patients>
The patients.xml file defines a root element called patients . It has three
nested patient elements. The patient elements contain three pieces of data:
Patient identifier, provided as the id attribute of the patient element
Patient name, provided as the name subelement
Patient diagnosis, provided as the diagnosis subelement
The transformation XSL document ( patients.xsl ) is quite small as well, and it
simply maps the patient data to a more user-readable HTML format using XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/
Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>Patients</title>
</head>
<body>
<table border="1">
<tr>
<th>Id</th>
<th>Name</th>
<th>Diagnosis</th>
</tr>
<xsl:for-each select="patients/patient">
<tr>
<td>
Search WWH ::




Custom Search