1. <%@ taglib uri="XMLx.tld" prefix="x"%>
2. <Html>
3. <HEAD>
4. <TITLE>:: An XML bridge ::</TITLE>
5. </HEAD>
6. <BODY>
7. <%@page import="Java.sql.*"%>
8. <%@page import="Oracle.XML.sql.query.*"%>
9. <%@page import="Oracle.jdbc.*"%>
10. <%
11. String tableName = "emp";
12. int maxRows = 3;
13. Context ctx = new InitialContext ();
14. DataSource ds = (DataSource) ctx.lookup ("MyOra");
15. Connection conn = ds.getConnection ();
16. OracleXMLQuery qu = new OracleXMLQuery
(conn, "select EMPNO, ENAME from " + tableName);
17. qu.setMaxRows (maxRows);
18. qu.setRowsetTag ("EMPLOYERS");
19. qu.setRowTag ("PERSON");
20. String xmlString = qu.getXMLString ();
21. conn.close ();
22. %>
23. <x:xslt stylesheet="Html.xsl">
24. <x:XML>
25. <%=XMLString%>
26. </x:XML>
27. </x:xslt>
28. </BODY>
29. </Html>