I have a need to convert a string that has an ampersand into xml and I can't 
get it to work. I have tried encoding the ampersand, but none of them seem to 
work. The string is coming from a system external to MarkLogic and it can be 
changed (if that will help).

xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";;

(:let $testString1 := "<root>foo & bar</root>":)
let $testString2 := "<root>foo &amp; bar</root>"
let $testString3 := "<root>foo &#38; bar</root>"
let $testString4 := "<root>foo %26 bar</root>"
let $testString5 := "&lt;root&gt;foo &amp; bar&lt;/root&gt;"
let $testString6 := "&lt;root&gt;foo &#38; bar&lt;/root&gt;"
let $testString7 := "&lt;root&gt;foo %26 bar&lt;/root&gt;"
return xdmp:unquote($testString5)


Maybe there is another way to convert the string into xml?

I'm using MarkLogic 5.0-3.3

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

Reply via email to