Hi Rojan,

If you precede your root element with a processing-instruction, comment or 
string, you are returning a multi-item sequence. You will have to at least add 
a + or * behind the return type. Secondly, a pi or string is not an element. 
Use item() instead.

By the way, are you sure that MarkLogic Server doesn't prepend the xml pi 
itself upon returning results? You can set the encoding of the response using 
xdmp:set-response-encoding 
(http://developer.marklogic.com/pubs/4.2/apidocs/AppServerBuiltins.html#xdmp:set-response-encoding)..

Kind regards,
Geert

Van: [email protected] 
[mailto:[email protected]] Namens Rojan K K
Verzonden: maandag 28 februari 2011 7:52
Aan: [email protected]
Onderwerp: [MarkLogic Dev General] prepend the xmlversion identifier with the 
resulted xml

Hi,

I would like to prepend the xml version identifier and encoding(<?xml 
version="1.0" encoding="UTF-8"?>) with the ouput xml which i am giving as the 
result of a method having element() return type.I tried to append it as string 
then its showing" Invalid coercion: "<?xml version=&quot;1.0&quot; 
encoding=&quot;UTF-8&quot;?>" as element() " since its not node type. Please 
help me to resolve this.


Regards,
Rojan


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

Reply via email to