Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLTYPE and external DTDs with PL/SQL?

AndyHMay 6 2014 — edited May 7 2014

Sorry, Newbie questions...

My PL/SQL-based application is to transfer/share data with remote application using XML through Oracle Rest Data Service. My front-end is using Glassfish with ORDS to access the REST interfaces.

I have defined my DTDs and have them stored within XDB.

During testing, the XML that I generated referred to the DTDs within XDB through the use of DOCTYPE and 'SYSTEM'. My internal tests of the interfaces work fine (I use utl_http to call my interface and get the expected transfer of XML). For example: my XML might be

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE heartbeat SYSTEM "/DTD/heartbeat.dtd" >
<heartbeat>
<timestamp>2013-06-13T15:09:13Z</timestamp>
</heartbeat>

and the DTD

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT heartbeat (timestamp)>
<!ELEMENT timestamp (#PCDATA)>

However, when the remote application attempts to call the same interface it fails because it doesn't have access to the DTD referred to within my XML.

So, I thought that I could put the DTDs in a public location on a web server as static files and change my XML to refer to 'PUBLIC' and the location e.g. '/MyAPP/DTDS/heartbeat.dtd'. Although the DTDs are now accessible to all (I can browse to them, etc.) xmltype doesn't seem to be able to make use of them and I can now produce and consume invalid XML without raising exceptions.

As far as I can see, it's not possible to make the DTDs within XDB publicly accessible?

So, how can I achieve my aim of being able to validate XML through their DTDs locally and allow remote applications to make use of the same DTDs?

Any pointers?

--

Andy

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2014
Added on May 6 2014
0 comments
833 views