Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xml problem: open tag names??

843785Jul 27 2008 — edited Jul 27 2008
I have a problem with this xml that I would run to a web server. the xml file has an error like this:
http://localhost:8080/chap1/pdf/tryk.xml:4: expected tag name after `<'
at `%'.  Open tag names must immediately follow the open brace like `<foo
...>'
Here is my code:
<?xml version="1.0"?>

<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<%@ page language="java" import="java.sql.*, java.util.*, java.text.*" contentType="text/xml; charset=UTF-8"%>
<jsp:useBean id="dbase" class="PhoneDatabase" scope="session" />   


<%
Vector vc= new Vector();
Vector vc1= new Vector();

vc.clear();
vc1.clear();
try{
Connection c = dbase.getConnection();
Statement s = c.createStatement();
    ResultSet r = s.executeQuery("Select * from inventory_list");

    while (r.next()) {
	vc.add(r.getString("item_name"));
	vc1.add(r.getString("quantity"));
    }
%>
<pdf>
<head>
</head>
<body size="A4">
               <table width="637" border="1">
                <tr>
                  <th><div align="center">Equipment Status </div></th>
                </tr>
              </table>
              
              <table width="637" border="1">
                <tr>
                  <td width="72" >Item</td>
                  <td width="207">Quantity</td>
                                  </tr>
                <% for(int e="0"; e<vc.size(); e++) {%>

                <tr>
                  <td width="72"><%=vc.elementAt(e)%></td>
                  <td width="207"><%=vc1.elementAt(e)%></td>
                </tr>

                  <%}

		r.close();

        s.close();
		c.close();

	}
	catch(Exception e)
	{	
		out.println(e);
	}
%>
              </table>
<table>
<tr>
<td>Displaying the Page Number</td>
<td><pagenumber idref="pagenumbers"/></td>
</tr>
</table>
</body>
</pdf>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 24 2008
Added on Jul 27 2008
3 comments
210 views