[MarkLogic Dev General] Loading an xml document referencing externally defined entities

Vidhya Parthasarathy vidhya.parthasarathy at utoronto.ca
Thu Apr 9 07:51:44 PDT 2009


David,

You are right any external references is not checked by marklogic. You have to appended the xml file with doctype declaration

try adding this to you xml file before insertion

<!DOCTYPE article PUBLIC "-//DUMMY//DTD dummy DTD//EN" [
<!ENTITY ldquo  "&#8220;" >
]>

Vidhya


From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Lee, David
Sent: Thursday, April 09, 2009 10:42
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] Loading an xml document referencing externally defined entities


I'm trying to load an XML document using the XCC library which has reference to entities defined seperately in a .ent file.
The document header has a DTD reference

--- xml doc

<!DOCTYPE TOPIC SYSTEM "lww-five-minute.dtd"[]>



Inside lww-five-minute.dtd is an external entity reference

--- dtd doc

<!ENTITY % xmlspecchars-integrated.ent      PUBLIC
"-//LWW//DTD XML Special Characters Module v4.0 20050408//EN"
"xmlspecchars-integrated.ent"                                        >
%xmlspecchars-integrated.ent;
---------

Then inside xmlspecchars-integrated.ent is entity definitions
e.g.
<!ENTITY ldquo  "&#8220;" >  <!--=double quotation mark, left, U+201C-->


When I try to load the document using Session.insertContent() I get the following error:


com.marklogic.xcc.exceptions.XQueryException: XDMP-DOCENTITYREF: Invalid entity reference "ldquo" at new5mcc.xml line 28635

in /insert



I've tried putting the dtd and ent files onto the ML server but no avail.

If I pre-parse the XML with some other XML tool which resolves the entities then put *that* file to ML it works fine.

Any suggestions on how to load an xml document which uses external entity definitions ?

thanks

 ----------------------------------------
David A. Lee
Senior member of the technical staff
Epocrates, Inc.
dlee at epocrates.com<mailto:dlee at epocrates.com>





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20090409/c6ae5d6d/attachment-0001.html


More information about the General mailing list