Hi Tim,

There's a serialization option to control which entities are output: 
"output-sgml-character-entities" (see http://docs.marklogic.com/xdmp:quote).

xdmp:quote(xdmp:unquote("<x>&uuml;</x>"))
=>
<x>ü</x>

xdmp:quote(xdmp:unquote("<x>&uuml;</x>"),
  <options xmlns="xdmp:quote">
    <output-sgml-character-entities>normal</output-sgml-character-entities>
  </options>)
=>
<x>&uuml;</x>

Thanks.

-jb


From: Tim <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, September 10, 2014 at 3:49 PM
To: 'MarkLogic Developer Discussion' 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] How to export XML to ASCII text with ISO 
encodings?

FYI – I know that I ca use the full repair option upon import – the real 
challenge is adding the character encodings upon export.

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Tim
Sent: Wednesday, September 10, 2014 12:28 PM
To: 'MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] How to export XML to ASCII text with ISO 
encodings?

Hi Folks,

I am importing content from an ASCII text file into an XML record to manage 
updates in MarkLogic, but upon request I need to export an updated ASCII text 
file. The ASCII text file can include a variety of ISO encodings and upon 
export it is required that some ASCII characters (such as apostrophes and 
ampersands) be out put with their equivalent ISO encoding, i.e., “&apos;” and 
“&amp;”) and that any characters exceeding the ASCII range be output with ISO 
encodings, e.g., “&uuml;”.

First of all I need to ensure that any text content with ISO encodings can be 
adequately imported into its UTF-8 representation.  Secondly, upon export to a 
text file, I need to add back in the ISO entity encodings. Any suggestions?

Thank you!

Tim M.

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to