DBMS_XMLGEN generates XML documents from any SQL query
It returns the XML document as a CLOB or XMLType
Provides a "fetch" interface very useful for pagination requirements in Web applications
setMaxRows(): specifies the maximum of rows returned by the Web Application
SetSkipRows(): specifies the amount of rows to skip
DBMS_XMLGEN Package
"fetch" interface
setNullHandling(): if set to 1, the resulting XML document contains empty elements when a value is NULL. The becomes very handy for reports generated out of the resulting XML document
getNumRowsProcessed(): returns the number of rows processed. This count does not include the number of rows skipped before generating the XML
setConvertSpecialChars(): to replace characters such as <, > etc.. by their codes (<, > etc..)
The "fetch" interface is very performant
DBMS_XMLGEN Package
Generate HTML Output with XMLTransform
Agenda
01 – History of the framework
02 – Oracle XML overview
03 – TVD-XORA Working environment
04 – TVD-XORA Demo
05 – What’s next
Web reporting Application
This XDB based Web Reporting framework generates public reports as well as maintenance reports
The demo application is based on this technology and uses the Oracle HR schema to demonstrate the use of such an application
The reports/forms technical descriptions as well as the documentation are stored in schema-validated XML documents
Parameter Screen and Menu
Generated HTML output
HTML Maintenance Form
HTML Report with Blocks
Excel output
PDF Output
Master Detail HTML Output
HTML Output based on XMLType Views
SVG Graphs
Web reporting : concept
XDB Application : transformation
Web reporting Application
The development and maintenance of the XML reporting documents is done with XMLSpy
Each document is validated against an XML Schema (Report.xsd) inside and outside the database
The load process of the XML documents in the XMLType table is done via FTP
Note: XMLSpy version 5.0 has the option to directly read or update XML documents stored in XMLType tables
A PL/SQL package generates the reports, forms and SELECT statements based on the information contained in the XML document
Web Reporting : XML Schema
The report.xsd XML schema describes the structure, content and semantics of all Reporting XML documents
Special attributes in the XML schema are interpreted as instructions by ORACLE XML DB
Web reporting : implementation
Web reporting : Database storage
The stylesheets are stored in a relational table: TVDXORA_XSLT
Only one column of this table is of type XMLType
The tree menu is stored in a separate XMLType table: XML_MENU
The reports in an XMLType schema-validated table: XML_REPORTS
The TVD-XORA Application
Views and Instead of triggers
The select statement use to generate the XML result set is generally based on a VIEW associated with an INSTEAD OF TRIGGER.
There is still some HTML coding in theses view, but future releases will remove it.
The HTML error messages are defined in the Instead of trigger