Skip to Main Content

Database Software

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!

Need help handling external parameter entities (.ent files) in a DTD

716753Aug 11 2009 — edited Aug 17 2009
Hi

I have read over mrdrake's thread about DTD and XMLDB, but it does not mention external entities. I have a DTD that I have successfully loaded into the repository. I has several external entity references in it. I cannot find a way for the DTD to link to those entities. I have tried loading them into the repository, but to no avail... My DTD is in the root of the xml db repos. My (.ent) files are in both the root of the xml db repos, as well as in the Oracle directory. Where exactly do I need to put the .ent files for them to be read?

A simple bit of code in a procedure fails on the _.parse_ function:
    p := xmlparser.newparser;
    
    vResourceLocation := vResourceDirectory || '/a399001.xml';
    xmlparser.parse(p, vResourceLocation);
    docXML := xmlparser.getDocument(p);
    xmlparser.freeParser(p);
    xml_monograph := DBMS_XMLDOM.getxmltype(docXML);
It fails with the following error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00247: invalid Document Type Declaration (DTD)
Error at line 50

Looks to me like the external parameter entities are causing problems (ie. %common.ent;). That is Line 50.

Here is the DTD that contains the entity references. I hope someone can help me out here because I have been racking my brain for the last few days on this. I should point out that these are not new files, they are solid as far as I know. thanks!
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================= 
                        CALLS TO EXTERNAL MODULES                  
     ============================================================= -->
<!--                    COMMON STRUCTURES                          -->
<!ENTITY % common.ent PUBLIC
"-//ASHP//DTD Common Structures v1.2 20030415//EN" "common.ent">
%common.ent;
<!--                    INTRODUCTORY INFORMATION                   -->
<!ENTITY % intro-info.ent PUBLIC
"-//ASHP//DTD Monograph Introductory Information v1.2 20030415//EN"
"intro-info.ent">
%intro-info.ent;
<!--                    AHFS STANDARD SECTIONS                     -->
<!ENTITY % ahfs-sects.ent PUBLIC
"-//ASHP//DTD AHFS Standard Sections v1.2 20030415//EN" "ahfs-sects.ent">
%ahfs-sects.ent;
<!--                    CLASS SECTIONS                             -->
<!ENTITY % class-list.ent PUBLIC
"-//ASHP//DTD Class List v1.2 20030415//EN" "class-list.ent">
%class-list.ent;
<!--                    REFERENCES                                 -->
<!ENTITY % refs.ent PUBLIC
"-//ASHP//DTD References v1.2 20030415//EN" "refs.ent">
%refs.ent;
<!--                    HID STANDARD SECTIONS                      -->
<!ENTITY % hid-sects.ent PUBLIC
"-//ASHP//DTD Handbook Monograph Sections v1.2 20030415//EN" "hid-sects.ent">
%hid-sects.ent;
<!-- =============================================================
                        Root Element
     ============================================================= -->
<!ELEMENT dif (ahfs?, hid?)>
<!ATTLIST dif
	extraction-date CDATA #REQUIRED
	new-or-update (new | update) #IMPLIED>
<!-- =============================================================
                     Main Container Elements
     ============================================================= -->
<!ELEMENT ahfs (ahfs-mono)+>
<!ATTLIST ahfs
	title CDATA #FIXED "AHFS Drug Information">
<!ELEMENT hid (hid-mono)+>
<!ATTLIST hid
	title CDATA #FIXED "Handbook on Injectable Drugs (HID)">
<!ELEMENT ahfs-mono (unit-num, intro-info, brand-info?, (%para-level; | intro-desc)*, 
                    (class | desc | chem-stab | chem | stab | pcol | pkin | 
                    uses | cauts | chron-tox | acute-tox | di | 
                    lab-test-interf | dosage-admin | dosage | preps | 
                    spect-resist | spect | resist | moa | 
                    advice-patient | mono-ref | gs-ref | spect-resist-gs-ptr |
                    chem-stab-gs-ptr | pcol-gs-ptr | pkin-gs-ptr | 
                    uses-gs-ptr | cauts-gs-ptr | acute-tox-gs-ptr | 
                    chron-tox-gs-ptr | di-gs-ptr | moa-gs-ptr |
                    lab-test-interf-gs-ptr | dosage-admin-gs-ptr | 
                    preps-gs-ptr | sect)*, class-fn*, copyright, refs?)>
<!ATTLIST ahfs-mono
	%top-level-attributes; 
	entity-id CDATA #IMPLIED>
<!ELEMENT hid-mono (unit-num, intro-info, (%para-level; | intro-desc)*, 
                   (products | administration | stability | class |
                   compatibility | additional-compat-info | other-info | 
                   sect)*, class-fn*, copyright, refs?)>
<!ATTLIST hid-mono
	%top-level-attributes; 
	entity-id CDATA #IMPLIED>
<!ELEMENT copyright (%para-level;)*>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2009
Added on Aug 11 2009
5 comments
2,728 views