Jim,

If a query returns text, it's text. You can set the content-type response header, if that helps.

xquery version "1.0-ml";

"do we escape text output? 1 < 2 &amp;&amp; 2 > 1"

I have to escape '&' in the XQuery string, because of language requirements. But I don't see any escaping in the output. Here's the response packet, via tcpdump -X (sorry about the line wrap, but hopefully you can still make it out).

-- Mike

11:11:56.161356 IP mblakele-lt.8000 > mblakele-lt.47069: P 2207013494:2207013734(240) ack 2207297434 win 272 <nop,nop,timestamp 27293427 27293375> 0x0000: 4500 0124 2cca 4000 4006 0f08 7f00 0001 E..$,....@.@....... 0x0010: 7f00 0001 1f40 b7dd 838c 5a76 8390 af9a [email protected].... 0x0020: 8018 0110 ff18 0000 0101 080a 01a0 76f3 ..............v. 0x0030: 01a0 76bf 4854 5450 2f31 2e31 2032 3030 ..v.HTTP/1.1.200 0x0040: 204f 4b0d 0a43 6f6e 7465 6e74 2d74 7970 .OK..Content-typ 0x0050: 653a 2074 6578 742f 706c 6169 6e3b 2063 e:.text/plain;.c 0x0060: 6861 7273 6574 3d75 7466 2d38 0d0a 436f harset=utf-8..Co 0x0070: 6e74 656e 742d 4469 7370 6f73 6974 696f ntent-Dispositio
        0x0080:  6e3a 2069 6e6c 696e 653b 2066 696c 656e  n:.inline;.filen
        0x0090:  616d 653d 6371 2e74 7874 0d0a 5365 7276  ame=cq.txt..Serv
        0x00a0:  6572 3a20 4d61 726b 4c6f 6769 630d 0a43  er:.MarkLogic..C
        0x00b0:  6f6e 7465 6e74 2d4c 656e 6774 683a 2034  ontent-Length:.4
        0x00c0:  300d 0a43 6f6e 6e65 6374 696f 6e3a 204b  0..Connection:.K
        0x00d0:  6565 702d 416c 6976 650d 0a4b 6565 702d  eep-Alive..Keep-
        0x00e0:  416c 6976 653a 2074 696d 656f 7574 3d31  Alive:.timeout=1
        0x00f0:  2c20 6d61 783d 3936 0d0a 0d0a 646f 2077  ,.max=96....do.w
        0x0100:  6520 6573 6361 7065 2074 6578 7420 6f75  e.escape.text.ou
        0x0110:  7470 7574 3f20 3120 3c20 3220 2626 2032  tput?.1.<.2.&&.2
        0x0120:  203e 2031                                .>.1


On 2009-01-22 11:06, James A. Robinson wrote:
My apologies if this is a RTFM question, I've been hunting around in the
documentation but haven't groked whether or not my question is answered
in them: In MarkLogic 3.2.x series, is it possible to output a non-XML
result from a query?

In XSLT one can set xsl:output/@method to 'text', but as far as I can
tell from the information out there any similar functionality for an
XQuery system is implementation defined (if allowed at all).

Does MarkLogic allow for direct text output (e.g., no ampersand escaping),
or is one forced to use a post processing step to convert from XML to
another format?


Jim

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       [email protected]
Stanford University HighWire Press      http://highwire.stanford.edu/
+1 650 7237294 (Work)                   +1 650 7259335 (Fax)
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

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

Reply via email to