4
votes

Is there any method defined in marklogic function library, by which we can convert (or try to convert) a string (xs:string type) to an xml 'document' type? In my problem, I shall normally get an xml sent through request parameters. now I have to parse this xml as a document. So I have to take it as a string and parse it. What is the solution for this case?

3

3 Answers

2
votes

I think xdmp:unquote is what you are looking for.

1
votes

In XQuery 3.0 simply use the standard XPath 3.0 function parse-xml().

1
votes
xdmp:eval("<ok/>")

or

xdmp:value("<ok/>")

Both of them can be use for your problem.

Regards