Character maps apply to serializations. What gets stored in the database isn't serialized: it is a data model instance, that isn't serialized unless it is (a) rendered as output from a query (b) saved to disk or (c) explicitly serialized as a string via xdmp:quote.
There is a special pass-through that when a document is returned from XSLT and returned as a result of the query, the XSLT serialization options will be applied, but that only works within the context of a single query. Try this: force a serialization using xdmp:quote and saving the reparse of that, e.g. xdmp:document-insert("/my.xml", xdmp:unquote(xdmp:quote($doc)) ) I think that should work. Round-tripping a serialization/parse to/from disk should also work, e.g. xdmp:document-insert("/my.xml", xdmp:document-get("/tmp/my.xml", xdmp:save("/tmp/my.xml",$doc))) Failing that, you'll need to do a manual sweep-replace yourself so that the data model instance you save has the characters in it that you want. //Mary On Tue, 07 Nov 2017 15:22:41 -0800, Mark Donoghue <m.donog...@ieee.org> wrote: > Hi, > > > I am running a query in the query console that retrieves a document from > the > database, invokes an XSLT and stores the result over the same document > URI. > > > The purpose of the XSLT is to unescape double-escaped character entities > (i.e.: > &amp;). Following what I thought was standard practice, the XSLT > replaces &'s > with &xE0000; and uses a character map to swap the private character > with an > ampersand on output (using the use-character-maps on the xsl:output > element). > > > This works fine in oXygen and even in the query console tests where I > output the > result document to the output pane. > > > The problem occurs when I retrieve the document from the database. The > private > character &xE0000; is still in the result document I stored, and hasn't > been > replaced with an ampersand. > > > Does document-insert (or something) ignore the xsl:output directives in > the > stylesheet? > > > Am I running into some some query console behavior I'm not aware of (I'm > still > rather new at using MarkLogic). > > > Any pointers in the right direction will he much appreciated. > > > Best, > > Mark > > > - -- --- ----- -------- ------------- > Mark Donoghue > > IEEE > > (732) 562-6045 > > m.donog...@ieee.org > > > IEEE - Advancing Technology for Humanity -- Using Opera's revolutionary email client: http://www.opera.com/mail/ _______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general