<?xml version="1.0" ?>
<%@ page contentType="text/xml" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%
  Properties prop=new Properties();
  FileInputStream fis = new FileInputStream(
    getServletContext().getRealPath(request.getParameter("prop")));
  prop.load(fis);
  String title=prop.getProperty("title");
  String author=prop.getProperty("author");
  int quan=Integer.parseInt(prop.getProperty("quantity"));
  boolean paper=prop.getProperty("paperback").charAt(0)=='t';
%>


<!DOCTYPE book [
  <!ELEMENT book (quantity,(paperback|hardback))>
  <!ELEMENT quantity (#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/>
<% } %>
</book>
