Storing Posted XML Using XSQL Servlet
We’ve seen that the general steps for inserting XML into the database are as follows:
Choose the table or view you want to use for inserting the XML information.
Create an XSL transformation that transforms the inbound document into the canonical format for this table or view.
Transform the inbound document into the canonical format for the table or view into which it will be inserted.
Insert the transformed document into your table or view with the
OracleXML
utility.
The Oracle XML SQL Utility works well for inserting XML documents you have in front of you in operating system files. However, if you need to have other computers post live XML information to your web site for insertion into your database, you’ll need to use a slight twist on this approach.
Storing Posted XML Using XSQL Pages
The Oracle XSQL Servlet supports the
<xsql:insert-request>
action element, which you can include
in any XSQL page to automate these steps:
Read a posted XML document from the HTTP request.
Transform it into the canonical format for insertion using any XSLT transformation you provide.
Insert the transformed document into the table or view of your choice.
Indicate the status of the operation by replacing the
<xsql:insert-request>
action element with an<xsql-status>
element to show how many rows were inserted or to report an error.
Behind the scenes, the
insert_request
action handler makes programmatic use of the Oracle XSLT Processor to do the transformation and ...
Get Building Oracle XML Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.