Hi,
   I am trying to load all XML documents into DB using
xdmp:document-insert function. However, it gives exception if XML
documents contains character strings like "<?Pub _newline?>".
The error:
com.marklogic.xcc.exceptions.XQueryException: XDMP-UNEXPECTED:
Unexpected token syntax error, unexpected NumericLiteral_, expecting
Comma_ or Rbrace_
in /eval, on line 98
        at
com.marklogic.xcc.impl.handlers.ServerExceptionHandler.handleResponse(Se
rverExceptionHandler.java:31)
....

The usage:

String command =
"xdmp:document-insert(\"/"+file.getName()+"\","+getDocument(file).getRoo
tElement().asXML()+"," +
                                                "
xdmp:default-permissions(),\"http://xxx.net/docs\","; +
        
"10,6265532978042102580)";
                                
        
System.out.println(file.getAbsolutePath());
                                Request request = session.newAdhocQuery
(command, options);
                                
                                ResultSequence rs =
session.submitRequest (request);

Let me know if there is any otherway to achieve the same. 

Regards,
Ranjan
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to