Home » Developer & Programmer » JDeveloper, Java & XML » Assigning XML Element to a JSP Variable
Assigning XML Element to a JSP Variable [message #92033] Wed, 11 February 2004 10:42
terence
Messages: 5
Registered: September 2002
Junior Member
Hi all,

I am developing reports using Oracle Reports 9i (deploying as JSPs) and need to be able to display the SQL statement used in the report to the users. The sql statement itself is in a set of xml elements at the start of the report file.

What I would like to know is how to assign the specific XML element containing the query to a JSP variable so that I can then display it.

Here's an example (very simple) of a report (the query should be in red):

[<]%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %[>]

[<]%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp" session="false" %[>]

[<]%@ page contentType="text/html;charset=ISO-8859-1" %[>]

[<]!--

<rw:report id="report">

<rw:objects id="objects">

<?xml version="1.0" encoding="WINDOWS-1252" ?>

<report name="tables" DTDVersion="9.0.2.0.0">

<xmlSettings xmlTag="MODULE1" xmlPrologType="text">

<![[CDATA[[<?xml version="1.0" encoding="&Encoding"?>]]]]>

</xmlSettings>

<data>

<dataSource name="Q_1">


<select>

<![[CDATA[[SELECT table_name

FROM user_tables]]]]>

</select>


<displayInfo x="1.65002" y="1.00000" width="0.69995" height="0.19995"/>

<group name="G_table_name">

<displayInfo x="1.30408" y="1.94995" width="1.39197" height="0.43970"

/>

<dataItem name="table_name" datatype="vchar2" columnOrder="11"

width="30" defaultWidth="100000" defaultHeight="10000">

<dataDescriptor expression="table_name"

descriptiveExpression="TABLE_NAME" order="1" width="30"/>

</dataItem>

</group>

</dataSource>

</data>

<reportPrivate defaultReportType="tabular"/>

</report>

</rw:objects>

--[>]

<html>

<head>

META TAG REMOVED name="GENERATOR" content="Oracle 9i Reports Developer"/>

<title> Your Title </title>

</head>

<body>

[<]!-- Data Area Generated by Reports Developer --[>]

<rw:dataArea id="MGtablenameGRPFR">

<caption> </caption>

[<]!-- Header --[>]

-

- > Table Name -

-

[<]!-- Body --[>]

<rw:foreach id="RGtablename1" src="G_table_name">

- ><rw:field id="Ftablename" src="table_name" nullValue="[sp]"> F_table_name </rw:field> -

</rw:foreach>

</rw:dataArea> [<]!-- id="MGtablenameGRPFR" --[>]

[<]!-- End of Data Area Generated by Reports Developer --[>]

</body>

</html>

[<]!--

</rw:report>

--[>]

Thanks in advance for any help.

Regards,

T.
Previous Topic: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
Next Topic: Outer Join Syntax using Java/JDBC
Goto Forum:
  


Current Time: Mon Jul 26 11:18:48 CDT 2021