Hello,
Some pointers for the following issue would be welcome.
I have a form:
<form method="post" enctype="multipart/form-data" action="{
xqmvc:link('search', 'submit') }">
<textarea id="yellow" name="text">{$insert} </textarea>
<input type="submit" name="submit"
value="{le:text("sea.answer")}"/>
</form>
The $insert variable is xhtml text.
The submit functions is as follows:
declare function submit()
as item()*
{
xdmp:set-response-encoding("utf-8"),
xdmp:set-response-content-type("application/xml"),
let $text := xdmp:url-decode(xdmp:get-request-field("text"))
let $fileId := fn:concat("test-", (fn:count(fn:collection("test"))+1))
let $doc := <document>
<text>{$text}</text>
</document>
let $uri := fn:concat("/test/", $fileId , ".xml")
let $create := xdmp:document-insert($uri, $doc,
xdmp:default-permissions(), "test", (), ())
return
xdmp:redirect-response(xqmvc:link('search', 'view', ('fileId', $fileId)))
};
When the document is inserted in the database it inserts the $text (i.e. xhtml)
as follows:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<fileId>test-19</fileId>
<text><p>Choose an example</p></text>
</document>
What is the solution, as obviously if the document is viewed, the <p> and
</p> will be viewed in html as < and >. That is not wat we want.
I am on ML7
Thanks,
Frank
________________________________________
DISCLAIMER -The content of this email is confidential and it is intended for
the addressee(s) only. The person who receives this email and who is not the
addressee is warned that he is not allowed to copy or distribute its content.
If you received this email by mistake, please notify us immediately by
telephoning +32 (2) 736 59 90.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general