1
votes

I am using xdmp:document-load function in MarkLogic 8 version

When inserting an XML document into MarkLogic Database I got the following Error message:

Invalid entity reference "lsquo"

How can I resolve this?

1

1 Answers

4
votes

This is not an encoding issue, but has more to do with document types and DTDs. Plain XML only supports out of the box <, >, &, ', and ". Entities like ‘ come from the HTML entity set, and also often used in other (proprietary) DTDs. You either need to provide a local DTD subset in the prolog of the file, resolve those entities to Unicode upfront, or rely on the 'repair' feature of MarkLogic.

The repair option is probably the quickest way out, but it might be worth thinking a bit harder where these entities came from, and what you want to do with them.

Here is the documentation of xdmp:document-load, that should describe the repair option:

http://docs.marklogic.com/xdmp:document-load

HTH!