XQuery由“”实体引用引发的无效实体引用错误

huangapple go评论65阅读模式
英文:

XQuery Invalid entity reference error caused by “ ” entity reference

问题

我试图将以下代码插入到QConsole中,但不断收到下面提到的错误。

[1.0-ml] XDMP-ENTITYREF: (err:XPST0003) Invalid entity reference " "
Stack Trace
At line 4 column 6:
In xdmp:eval("xquery version "1.0-ml";
let $uri := "/mlrepo...", (), <options xmlns="xdmp:eval"><database>1979476059788016196</database>...</options>)

2. let $uri := "/mlreports/corb/arena_report.txt"
3. let $code :=
4. <code>
5. THREAD-COUNT=10
6. BATCH-SIZE=10

以下是我正在执行的查询 -

xquery version "1.0-ml";
let $uri := "/mlreports/corb/arena_report.txt"
let $code :=
<code>
THREAD-COUNT=10
BATCH-SIZE=10
URIS-MODULE=/mlreports/selector/arena_report_selector.xqy
PROCESS-MODULE=/mlreports/transform/arena_report_transform.xqy
PROCESS-TASK=com.marklogic.developer.corb.ExportBatchToFileTask
EXPORT-FILE-NAME=arena_report.csv
PRE-BATCH-TASK=com.marklogic.developer.corb.PreBatchUpdateFileTask
EXPORT-FILE-TOP-CONTENT=UNIFIED DOC ID,SEAL ID,DMS NAME,DOCUMENT ID,PRODUCT ID,Legal Entity ID,Client ID,Client Type,Party Role,Document Type ID,Document Type Name,Document Title ID,Document Title,Document Source,Creation Date,Published Date,Effective Date,Document Electronic Storage Location,Document Status,Document Classification,Document Expiration Date,Document Modification Date,Country Of Governing Law,State Of Governing Law,Collection ID,Collection Name,Image ID,Image Type,Image Format,Image Effective Date,Image Source,Image Tag Classification,Resolution & Recovery LOB,Resolution & Recovery Sub-LOB,Facility ID,Agreement Version,LIBOR_METADATA_0,LIBOR_METADATA_1,LIBOR_METADATA_2,LIBOR_METADATA_3,LIBOR_METADATA_4,LIBOR_METADATA_5,LIBOR_METADATA_6,LIBOR_MANUAL_REVIEW_0,LIBOR_MANUAL_REVIEW_1,LIBOR_MANUAL_REVIEW_2,LIBOR_MANUAL_REVIEW_3,LIBOR_MANUAL_REVIEW_5,LIBOR_MANUAL_REVIEW_6,LIBOR_MANUAL_REVIEW_7,LIBOR_MANUAL_REVIEW_8,LIBOR_MANUAL_REVIEW_10,LIBOR_MANUAL_REVIEW_11,LIBOR_MANUAL_REVIEW_15,LIBOR_MANUAL_REVIEW_19,LIBOR_MANUAL_REVIEW_23,LIBOR_MANUAL_REVIEW_27,LIBOR_MANUAL_REVIEW_31,LIBOR_MANUAL_REVIEW_35,LIBOR_MANUAL_REVIEW_39,LIBOR_MANUAL_REVIEW_43,LIBOR_MANUAL_REVIEW_47,LIBOR_MANUAL_REVIEW_51,LIBOR_MANUAL_REVIEW_55,LIBOR_MANUAL_REVIEW_59,LIBOR_MANUAL_REVIEW_63,LIBOR_MANUAL_REVIEW_67,LIBOR_MANUAL_REVIEW_71,L,BOR_MANUAL_REVIEW_75,LIBOR_MANUAL_REVIEW_79,LIBOR_MANUAL_REVIEW_83,LIBOR_MANUAL_REVIEW_87,IBOR_MANUAL_REVIEW_91,LIBOR_MANUAL_REVIEW_95,LIBOR_MANUAL_REVIEW_99,LIBOR_MANUAL_REVIEW_103,LIBOR_INSCOPE_0,LIBOR_CLUSTER_0,LIBOR_CLUSTER_1,LIBOR_CLUSTER_2,LIBOR_CLUSTER_3,LIBOR_CLUSTER_4,LIBOR_CLUSTER_5
</code>/text()

return xdmp:document-insert($uri, $code,(xdmp:permission("clientDocsReadRole", "read"),
  xdmp:permission("clientDocsWriteRole", "insert"),
  xdmp:permission("clientDocsWriteRole", "update")))

我无法理解错误背后的原因。非常感谢任何帮助。

英文:

I am trying to insert following code in QConsole but keep getting the below mentioned error.

[1.0-ml] XDMP-ENTITYREF: (err:XPST0003) Invalid entity reference " "
Stack Trace
At line 4 column 6:
In xdmp:eval("xquery version "1.0-ml";
let $uri := "/mlrepo...", (), <options xmlns="xdmp:eval"><database>1979476059788016196</database>...</options>)

2. let $uri := "/mlreports/corb/arena_report.txt"
3. let $code :=
4. <code>
5. THREAD-COUNT=10
6. BATCH-SIZE=10

Below is the query, I am executing -

xquery version "1.0-ml";
let $uri := "/mlreports/corb/arena_report.txt"
let $code :=
<code>
THREAD-COUNT=10
BATCH-SIZE=10
URIS-MODULE=/mlreports/selector/arena_report_selector.xqy
PROCESS-MODULE=/mlreports/transform/arena_report_transform.xqy
PROCESS-TASK=com.marklogic.developer.corb.ExportBatchToFileTask
EXPORT-FILE-NAME=arena_report.csv
PRE-BATCH-TASK=com.marklogic.developer.corb.PreBatchUpdateFileTask
EXPORT-FILE-TOP-CONTENT=UNIFIED DOC ID,SEAL ID,DMS NAME,DOCUMENT ID,PRODUCT ID,Legal Entity ID,Client ID,Client Type,Party Role,Document Type ID,Document Type Name,Document Title ID,Document Title,Document Source,Creation Date,Published Date,Effective Date,Document Electronic Storage Location,Document Status,Document Classification,Document Expiration Date,Document Modification Date,Country Of Governing Law,State Of Governing Law,Collection ID,Collection Name,Image ID,Image Type,Image Format,Image Effective Date,Image Source,Image Tag Classification,Resolution & Recovery LOB,Resolution & Recovery Sub-LOB,Facility ID,Agreement Version,LIBOR_METADATA_0,LIBOR_METADATA_1,LIBOR_METADATA_2,LIBOR_METADATA_3,LIBOR_METADATA_4,LIBOR_METADATA_5,LIBOR_METADATA_6,LIBOR_MANUAL_REVIEW_0,LIBOR_MANUAL_REVIEW_1,LIBOR_MANUAL_REVIEW_2,LIBOR_MANUAL_REVIEW_3,LIBOR_MANUAL_REVIEW_5,LIBOR_MANUAL_REVIEW_6,LIBOR_MANUAL_REVIEW_7,LIBOR_MANUAL_REVIEW_8,LIBOR_MANUAL_REVIEW_10,LIBOR_MANUAL_REVIEW_11,LIBOR_MANUAL_REVIEW_15,LIBOR_MANUAL_REVIEW_19,LIBOR_MANUAL_REVIEW_23,LIBOR_MANUAL_REVIEW_27,LIBOR_MANUAL_REVIEW_31,LIBOR_MANUAL_REVIEW_35,LIBOR_MANUAL_REVIEW_39,LIBOR_MANUAL_REVIEW_43,LIBOR_MANUAL_REVIEW_47,LIBOR_MANUAL_REVIEW_51,LIBOR_MANUAL_REVIEW_55,LIBOR_MANUAL_REVIEW_59,LIBOR_MANUAL_REVIEW_63,LIBOR_MANUAL_REVIEW_67,LIBOR_MANUAL_REVIEW_71,L,BOR_MANUAL_REVIEW_75,LIBOR_MANUAL_REVIEW_79,LIBOR_MANUAL_REVIEW_83,LIBOR_MANUAL_REVIEW_87,IBOR_MANUAL_REVIEW_91,LIBOR_MANUAL_REVIEW_95,LIBOR_MANUAL_REVIEW_99,LIBOR_MANUAL_REVIEW_103,LIBOR_INSCOPE_0,LIBOR_CLUSTER_0,LIBOR_CLUSTER_1,LIBOR_CLUSTER_2,LIBOR_CLUSTER_3,LIBOR_CLUSTER_4,LIBOR_CLUSTER_5
</code>/text()

return xdmp:document-insert($uri, $code,(xdmp:permission("clientDocsReadRole", "read"),
  xdmp:permission("clientDocsWriteRole", "insert"),
  xdmp:permission("clientDocsWriteRole", "update")))

I am unable to understand the reason behind the error. Any help is much appreciated.

答案1

得分: 7

似乎EXPORT-FILE-TOP-CONTENT中的内容是问题,特别是"&"符号。例如:“Resolution & Recovery LOB”。

"&"被解释为实体,因此:

  1. 要么在<code>的内容中包含CDATA,或者
  2. 转义&为&,或者
  3. 将"&"的出现替换为其他内容,比如"and"。
英文:

It seems that the content in the EXPORT-FILE-TOP-CONTENT is the problem, specifically the "&" sign. Example: "Resolution & Recovery LOB".

"&" is interpreted as entity so:

  1. either wrap contents of <code> in CDATA or
  2. escape the & to & or
  3. replace the occurrences of "&" with something else, like "and"

huangapple
  • 本文由 发表于 2020年1月6日 21:08:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/59612718.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定