简体   繁体   中英

How to parse “>” and “<” in Xquery in Marklogic?

I want to use > and < in my xqy pages in Marklogic Server. But Marklogic converts > to &gt; and < to &lt; In Query Console also when I write > and run the query it prints the output as &gt; but I want it to be > only and not &gt; . How can I do this ?

In QConsole you can select the Text output format. If you do so with a query that only contains ">", than only a > will be output. If you select the XML output format, it will be escaped and wrapped in a result element by the QConsole eval function to make it well-formed.

If you are checking your xqy page using a common web browser, it could be escaping properly written results too, make sure to check page source.

Note also that Marklogic returns xquery output usually as text/xml . You can set the response content type to text/plain using xdmp:set-response-content-type("text/plain")

HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM