2

I have inserted following XML content with "&#x2019" in the content to the MarkLogic server using XQuery.

XML content

<?xml version="1.0" encoding="ISO-8859-1"?>
<A>debtor&#x2019;s</A>

Insert XQuery used

 xdmp:document-load("C:/a.xml",
   <options xmlns="xdmp:document-load">
     <uri>a.xml</uri>
     <encoding>ISO-8859-1</encoding>
   </options>)

And I am using the following XQuery for exporting the same document.

Export XQuery used

let $xml := doc("/a.xml")
return
  xdmp:save("c:\export\a.xml", $xml,
    <options xmlns="xdmp:save">
      <output-encoding>ISO-8859-1</output-encoding>
    </options>) 

And the export output XML looks same as source document:

<?xml version="1.0" encoding="ISO-8859-1"?>
<A>debtor&#x2019;s</A>

Similarly I have inserted the source XML using MLCP and if I exported that file, it looks like below:

<?xml version="1.0" encoding="ISO-8859-1"?>
<A>debtor's</A>

But my need is to have same output as like source (i.e. it should be "debtor& #x2019;s" instead of "debtor's") though inserted using MLCP.

Are there any options or work-arounds to export as like source document for the documents inserted through MLCP?

I also tried -content_encoding ISO-8859-1 but I got same answer.

Dave Cassel
  • 8,352
  • 20
  • 38
Antony
  • 966
  • 8
  • 19
  • have you tried changing `-content_encoding` value? [MLCP Command Line Options](https://docs.marklogic.com/guide/mlcp/export#id_67189) – Mike Gardner Mar 09 '16 at 14:30
  • @MichaelGardner yes I tried this but the result was "debtor?s" instead of "debtor& #x2019;s" – Antony Mar 09 '16 at 14:36
  • That would be good information to include in your original question, along with the specific encoding string you used. – Mike Gardner Mar 09 '16 at 14:40
  • @MichaelGardner I was tried this -content_encoding ISO-8859-1 but i got same answer. – Antony Mar 09 '16 at 14:59

1 Answers1

1

What about this

<A><![CDATA[debtor&#x2019;s]]></A>
pythonician_plus_plus
  • 1,244
  • 3
  • 15
  • 38