0 Replies Latest reply on May 6, 2014 11:12 PM by AndyH

    XMLTYPE and external DTDs with PL/SQL?


      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" >


      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?