From: R. H. <ro...@lo...> - 2003-11-25 08:57:21
|
Hi, I installed exist-0.9.2 as a web application in Tomcat. I tried to use xmlrpc and jsp to do some query. when i run the jsp file, the returned XML contents lost all the tag, only the values displayed; and they are not pretty printed, every value is seperated by a space. But if i run the query as a simple java program in the commamd line, the retured XML contents are correctly formatted and pretty printed. I cannot figure it out. my jsp file: <%@ page import="org.apache.xmlrpc.*" %> <%@ page import="java.util.Vector" %> <%@ page contentType="text/html; charset=ISO-8859-1" %> <html> <head> <title>Query Result</title> </head> <body> <h1 align="center">Query Result</h1> <% String parameter = request.getParameter("parameter"); XmlRpc.setEncoding("ISO-8859-1"); XmlRpcClient xmlrpc = new XmlRpcClient("http://localhost:8080/exist/xmlrpc"); xmlrpc.setBasicAuthentication( "guest", "guest" ); // execute query and retrieve an id for the generated result set Vector params = new Vector(); params.addElement(query); //XPath params.addElement(new Integer(2000)); //how many params.addElement(new Integer(1)); //start params.addElement(new Integer(1)); //prettyPrint String result = (String) xmlrpc.execute("query", params); %> <p><%= result %></p> </body> </html> The other thing is: All my xml files are "ISO-8859-1", but every time i run the query, i got XML returned encoding "UTF-8". where can i change encoding? Thanks for any suggestion. R. H. |