It might be better to use a servlet to output your XML rather than a JSP as you don't need HTML tags, just XML.
In the servlet set the content type to XML
response.setContentType("text/xml; charset=windows-1252");
Write the headers
out.print("<?xml version = '1.0'?>");
out.print("<page>");
out.print("<ROWSET>");
And then iterate through your elements
while ((rs.next()) && (resultNum<maxResults))
{
resultNum++;
out.print("<ROW>");
for (int x=1;x<=columnCount;x++)
{
String columnName=metaData.getColumnName(x);
String columnType=metaData.getColumnTypeName(x);
out.print("<"+columnName+">");
if (columnType.indexOf("NUMBER")>-1)
{
tempInt=rs.getInt(x);
// out.print(tempInt);
Integer tempInteger=new Integer(tempInt);
tempString=tempInteger.toString();
// tempString=XMLEncoder.encode(tempString);
out.print(tempString);
}
out.print("</"+columnName+">");
}
out.print("</ROW>");
Hope this helps
Andy
Sebastien RODRIGUES wrote on 10/30/2003, 3:02 AM:
---Hi,
I want to transfert xml files by jsp.
Server => Client:
All is ok my jsp generate the xml code and the client read the stream and optain the xml file.
Client => Server:
I don't know how can i upload the xml file
Someone can help me?
Thanks and regards
--- You are currently subscribed to jdjlist as: [EMAIL PROTECTED]. To unsubscribe send a blank email to [EMAIL PROTECTED] http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click: http://sys-con.com/[EMAIL PROTECTED]
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk To unsubscribe from all mailing lists, click:
http://sys-con.com/[EMAIL PROTECTED]
