source: Discovery_Service/trunk/exist/DIFhtml.jsp @ 122

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/Discovery_Service/trunk/exist/DIFhtml.jsp@125
Revision 122, 1.9 KB checked in by mguiterr, 15 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<%
2//Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ).
3//This software may be distributed under the terms of the
4//Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
5%>
6
7<%@ include file="header.jsp" %>
8<%@ page session="true" %>
9<%@ page import="javax.xml.transform.*"%>
10<%@ page import="javax.xml.transform.stream.*"%>
11<%@ page import="java.io.*"%>
12
13
14<%@ page import="java.util.*"%>
15
16<br>
17<table width="100%" border="0">
18  <tr>
19    <td height="26" class=tablerow>Displaying DIF html Records </td>
20  </tr>
21</table>
22
23<%
24        String FS = System.getProperty("file.separator");
25        String ctx = getServletContext().getRealPath("queries") + FS;
26        String xslFile = ctx + "difxslt.xslt";
27
28       
29        File fxsl = new File(xslFile);
30        FileInputStream fisXsl = new FileInputStream(fxsl);
31        StreamSource sxslsource = new StreamSource(fisXsl);
32        TransformerFactory tFactory = TransformerFactory.newInstance();
33        Transformer transformer = tFactory.newTransformer(sxslsource);
34
35        StringReader sxml = null;
36        StreamSource sxmlsource  = null;
37        //dif = group.getDIFAt(new Integer(request.getParameter("DIFId")).intValue());
38
39           for (int i=0; i<request.getParameterValues("DIFId").length; i++)
40            {
41
42                  dif = group.getDIFAt(new Integer(request.getParameterValues("DIFId")[i]).intValue());
43                  sxml = new StringReader(dif.getDIFContent());
44                  sxmlsource = new StreamSource (sxml);
45                  transformer.transform(sxmlsource, new StreamResult(out));
46                 
47            }
48
49
50
51       // String FS = System.getProperty("file.separator");
52        //String xslFile    = null;
53
54        // get the real path for  xsl files;
55       
56        //StringReader sxml = new StringReader(dif.getDIFContent());
57        //StreamSource sxmlsource = new StreamSource (sxml);
58       
59       
60
61
62%>
63<%@ include file="footer.jsp" %>       
64                       
65                       
66                       
67
Note: See TracBrowser for help on using the repository browser.