ORA-30951: Element or attribute at Xpath exceeds maximum length ORA-06512: at line 11 [message #583301] |
Mon, 29 April 2013 04:53 |
|
Hi there
I am getting the error when trying to run this test block, this is code is to simulate the production error we are getting...The XML is attached.. Please Help
DECLARE
g_xdoc XMLTYPE;
g_trans_type CHAR (20) := NULL;
BEGIN
SELECT xmltype(c) -- column is a clob column
INTO g_xdoc
FROM test_gil
WHERE a = '1';
SELECT EXTRACT(VALUE (tt), '//transactionType').getstringval()
INTO g_trans_type
FROM TABLE (XMLSEQUENCE (EXTRACT (g_xdoc, '/'))) tt;
DBMS_OUTPUT.put_line (g_trans_type);
END;
-
Attachment: xml.txt
(Size: 9.85KB, Downloaded 2213 times)
|
|
|
|
|
|
|
|
|
|
|
Re: ORA-30951: Element or attribute at Xpath exceeds maximum length ORA-06512: at line 11 [message #583318 is a reply to message #583316] |
Mon, 29 April 2013 07:42 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Yes, this is what I meant by "split", it was "wrap", sorry for this misuse of the word.
You can add a newline between each "><" in SQL:
select extractvalue(value(x),'//transactionType') v
into g_trans_type
from test_gil,
table(xmlsequence(extract(
xmltype(replace(c, '><', '>'||chr(10)||'<')),
'//transactionType'))) x
WHERE a = '1';
Regards
Michel
|
|
|
Re: ORA-30951: Element or attribute at Xpath exceeds maximum length ORA-06512: at line 11 [message #584544 is a reply to message #583318] |
Wed, 15 May 2013 04:54 |
|
Hi guys
As for the extract part I used a Java Stored Procedure to etract the value and its working now I am getting the same error when trying to (isSchemaValid (); and schemaValidate ();0 please check code below
set serveroutput on
DECLARE
x CLOB;
v_xdoc XMLTYPE;
g_status VARCHAR2 (50);
g_msg VARCHAR2 (2000);
v_xml_ok NUMBER;
BEGIN
SELECT c --clob column from the database
INTO x
FROM test_gil
WHERE a = '1 - insert_online_xml'
AND b = 'p_message_id :FAIL201304261415231348, UNKNOWN';
v_xdoc := xmltype (x);
-- Associate an XSD to the XML
v_xdoc := v_xdoc.createSchemaBasedXML ('NXS_CLAIM_REQ.XSD');
BEGIN
-- Validate the XML received against the XSD - 0=INVALID, 1=VALID
v_xml_ok := v_xdoc.isSchemaValid ();
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (
'XML does not correspond to schema.' || SQLERRM);
END;
-- Find out what is invalid so as to return a more meaningful message
IF v_xml_ok = 0
THEN
BEGIN
v_xdoc.schemaValidate ();
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('XML does not conform to XSD..' || SQLERRM);
END;
END IF;
mds_web_service_pack.validate_xml (x,
'NXS_CLAIM_REQ.XSD',
v_xdoc,
g_status,
g_msg);
END;
/
SQL*Plus: Release 10.1.0.4.2 - Production on Wed May 15 10:54:36 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning option
Oracle version 11.2.0.2.0 on host boa
XML does not correspond to schema.ORA-30951: Element or attribute at Xpath
exceeds maximum length
Procedure MDS_WEB_SERVICE_PACK.VALIDATE_XML.
Step 1.
XML does not correspond to schema.
Error converting input xml: XML does not correspond to schema. ORA-30951:
Element or attribute at Xpath exceeds maximum
length
PL/SQL procedure successfully completed.
pdev (assuper)>
|
|
|
|
Re: ORA-30951: Element or attribute at Xpath exceeds maximum length ORA-06512: at line 11 [message #584605 is a reply to message #584571] |
Thu, 16 May 2013 02:40 |
|
Sorry Michel man..... Really sorry been a very stressful week at work...
I tried all the solutions given but to no success, until on Metalink I was advised that this was an Oracle bug(See Below)...as below this apparently is happening at RegisterSchema level hence the extract part does not work as well...
So now I am trying to write the Java Stored Procs to do the same functionality... But I am struggling on some parts I have mentioned previously...
Again Sorry Michel, I truly appreciate your help
------------------METALINK----------------------------------------------------------------------------------
ORA-30951 from dbms_xmlschema.registerSchema [ID 1374471.1]
BUG:11724783 - ORA-30951 FROM DBMS_XMLSCHEMA.REGISTERSCHEMA --> 96 - Closed, Duplicate Bug3876657
BUG:5222023 - INVALID ORA-30951 WITH LARGE APPINFO ELEMENT --> Duplicate Bug11724783. To Filer
|
|
|