在网页中嵌入经xsl编译后的xml
1.xml内容是通过程序生成,采用从数据库中获取的对话内容后拼接成xml内容,类型是一个字符串类型。
2.现在有一个xsl模板,能够对xml内容进行从新排版。
我想问的是我怎么才能在页面上显示这个xsl,框架使用了struts2
public String searchSingle()throws Exception{ //获取页面传来的参数 Long comId = SessionUtil.getLoginCompanyId(request); String companyId = comId.toString(); Long opId = (long) 68361; //Long.parseLong(request.getParameter("operatorId")); Long msgId = (long) 47436604; //Long.parseLong(request.getParameter("msgId")); ChatInfoDTO queryResult = chatInfoService.getSingleChatInfo(msgId, opId); request.setAttribute("queryResult", queryResult); ArrayList<ChatContent> chatcontent = chatContentService.getChatContentByMsgId(msgId, companyId); @SuppressWarnings("deprecation")//生成的xml内容 String xmlXslFormtContent = ChatContentUtil.getXmlXslFormtContent(chatcontent, queryResult); System.out.println(xmlXslFormtContent); return "success"; }