<?xml version="1.0" ?>
<%@ page contentType="text/xml" %>
<%
// fake database read
  String title="Java Network Programming Black Book";
  String author="Al Williams";
  int quan=33;
  boolean paper=true;
%>


<!DOCTYPE book [
  <!ELEMENT book (quantity,(paperback|hardback),shelving)>
  <!ELEMENT quantity (#PCDATA)>
  <!ELEMENT shelving (shelve+)>
  <!ELEMENT shelve (#PCDATA)>
  <!ELEMENT paperback EMPTY>
  <!ELEMENT hardback EMPTY>
  <!ATTLIST book title CDATA #REQUIRED >
  <!ATTLIST book author CDATA #REQUIRED >
  ]>

<book title="<%= title %>" author="<%= author %>">
    <quantity><%= quan %></quantity>
<% if (paper) { %>
    <paperback/>
<% } else { %>
    <hardback/>
<% } %>
    <shelving>
      <shelve>Computer</shelve>
      <shelve>Java</shelve>
      <shelve>Programming</shelve>
    </shelving>
</book>
