英文:
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 &quot;1.0-ml&quot;;&#10;let $uri := &quot;/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 &quot;1.0-ml&quot;;&#10;let $uri := &quot;/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”。
"&"被解释为实体,因此:
- 要么在
<code>
的内容中包含CDATA,或者 - 转义&为
&amp;
,或者 - 将"&"的出现替换为其他内容,比如"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:
- either wrap contents of
<code>
in CDATA or - escape the & to
&amp;
or - replace the occurrences of "&" with something else, like "and"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论