Marklogic 不保存格式日期不正确的 XML

Marklogic don't save XML with format date incorrect

我正在尝试将一些 XML(UBL) 文档保存到 Marklogic 8 中,但日期格式不正确,如下所示:

<cbc:IssueDate>2017-06-32</cbc:IssueDate>

我正在使用 Java API 来保存它,但由于下一个异常而无法保存:

Server Message: XDMP-RANGEINDEX: Range index error: date fn:doc("/pe/sunat/document/97ed960e-a34a-4a5b-b070-fad3594445be")/:SummaryDocuments/:IssueDate: XDMP-LEXVAL: Invalid lexical value "2017-06-32"

我知道日期格式不对,但还是很想保存。可以保存这个XML吗? (我正在使用对象 com.marklogic.client.document.DocumentWriteSet 在交易中保存大量文档)

您可以将“无效值”设置从“拒绝”更改为“忽略[=19=” ]”。这将允许您摄取该文档,但不会为该无效日期值编制索引。然后,您可以使用 post-processing.

更正日期值的格式

http://docs.marklogic.com/admin-help/range-element-index

  • invalid values specifies whether server should allow insertion of documents that contain XML elements or JSON properties on which range index is configured and their contents cannot be coerced to the index data type. It can be configured to either ignore or reject. By default server rejects insertion of such documents. However, if a user configures invalid values to ignore, these documents can be inserted. This setting does not change the behavior of queries on invalid values after documents are inserted in the database. Performing an operation on an invalid value at query time can still result in an error.