我创建了一个字符串,我希望将其作为CLOB传递给Oracle数据库,然后在CLOB上运行XMLTYPE.createxml
,但是当我这样做时,它会不断给出错误LPX-00007: unexpected end-of-file encountered
。< / p>
我已经检查了所有内容,似乎看不到最新情况,字符串是无效的XML还是我错过了什么内容?
XML
<?xml version="1.0" encoding="UTF-8" ?>
<location>
<id>23451</id>
<code>2</code>
<date>20151217</date>
</location>
<location>
<id>23452</id>
<code>3</code>
<date>20151217</date>
</location>
<location>
<id>23453</id>
<code>3</code>
<date>20151217</date>
</location>
答案 0 :(得分:4)
要使XML格式良好,您需要单个根元素:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<location>
<id>23451</id>
<code>2</code>
<date>20151217</date>
</location>
<location>
<id>23452</id>
<code>3</code>
<date>20151217</date>
<location>
<location>
<id>23453</id>
<code>3</code>
<date>20151217</date>
</location>
</root>