数据库:oracle9.2.0.1。操作系统:windows xp
使用PL/SQL处理XML,读入一个XML文件到CLOB中去,检查XML格式时总是报错:SQL> DECLARE
2 xmlclobCLOB;
3 wellformed BOOLEAN;
4 parseerror varchar2(200);
5
6BEGIN
7 -- 为特定文档选择CLOB到变量中去
8 select xmldoc into xmlclob
9 from xml_doc
10 where upper(doc_name) = upper('MARTIN-20011127121047447PST.xml');
11
12 -- 检查是否符合XML合式
13 check_xml_clob(xmlclob,wellformed,parseerror);
14
15 -- 如果不合式输出错误
16 if not wellformed then
17dbms_output.put_line('The XML has some errors, '||parseerror);
18 else
19dbms_output.put_line('The XML doc is correctly!');
20 end if;
21end;
22/
DECLARE
*
ERROR 位于第 1 行:
ORA-20100: Error occurred while parsing: Start of root element expected.
ORA-06512: 在"SYS.XMLPARSER", line 22
ORA-06512: 在"SYS.XMLPARSER", line 103
ORA-06512: 在"XMLDLP.CHECK_XML_CLOB", line 18
ORA-06512: 在line 13
我跟踪了一下,总是在xmlparser中报错,不进行格式检查直接从xml中利用Xpath找属性值时也是在xmlparser中报错,我觉得xml文件本身格式没有问题,如下,请问各位这是什么怎么回事?多谢了
-
-
-
-
Mastering XHTML
ED Tittel
|