Home » SQL & PL/SQL » SQL & PL/SQL » LPX-00230: invalid character 0 (U+0000) found in a Name or Nmtoken (Oracle 10g)
LPX-00230: invalid character 0 (U+0000) found in a Name or Nmtoken [message #664826] Mon, 07 August 2017 07:50 Go to next message
sss111ind
Messages: 634
Registered: April 2012
Location: India
Senior Member

Dear All,

I am getting the error while parsing the xml please suggest what caused to trigger this type of error.

LPX-00230: invalid character 0 (U+0000) found in a Name or Nmtoken

Regards,
Nathan
Re: LPX-00230: invalid character 0 (U+0000) found in a Name or Nmtoken [message #664827 is a reply to message #664826] Mon, 07 August 2017 08:09 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
sss111ind wrote on Mon, 07 August 2017 05:50
Dear All,

I am getting the error while parsing the xml please suggest what caused to trigger this type of error.

LPX-00230: invalid character 0 (U+0000) found in a Name or Nmtoken

[oracle@vbgeneric ~]$ oerr lpx 230
00230, 00000, "invalid character ~1u (~2x) found in a Name or Nmtoken"
// *Cause:  An invalid character was found in a NAME or NMTOKEN.
// *Action:  Use only the characters allowed for NAMES and NMTOKENS by the XML
//           specification.
[oracle@vbgeneric ~]$ 
Re: LPX-00230: invalid character 0 (U+0000) found in a Name or Nmtoken [message #665724 is a reply to message #664827] Mon, 18 September 2017 09:11 Go to previous message
sss111ind
Messages: 634
Registered: April 2012
Location: India
Senior Member

Hi All,

We have implemented the following code and it resolved the problem.

--SAMPLE xml ampersand(&) and appstrope(') for which problem happening
 
<![CDATA[<?xml version="1.0" encoding="UTF-8"?><Record><Details><NAME>AARIF &amp; AGENCIES</NAME><INVOICE>0945005251 / 16 &amp; 17~0945005255 / 14 &amp; 15~0945005256 / 13~</INVOICE></Details><Details><NAME>G A V &amp; TRANSPORTS</NAME><INVOICE><![CDATA[0937000136 / 8-0.50SR & T~0945005264 / 8~0945005269 / 9~0945005272 / 7~0945005362 / 18~0945005376 / 4~0043013253 / FRT DEBIT-WFA~0022049721 / TRR EARTH'MOVERS~0945005385 / 3~]]></INVOICE></Details><Details><NAME>VENKATESAN M</NAME><INVOICE><![CDATA[0945005078 / 15~0945005077 / 118~0945005075 / 119~0945005069 / 97~0945005067 / 96~0945005060 / 123~0945005059 / 122~0945005036 / 121~0945005034 / 120~0937000126 / 122 & 123-2.28SR~]]></INVOICE></Details></Record>]]>


--Finding the way to handle this
PROCEDURE TEST_insert(p_salxml CLOB) IS
  
    l_input_xml    XMLTYPE;
    
  BEGIN

    BEGIN
    
      l_input_xml := XMLTYPE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(rtrim(ltrim(p_salxml,
                                                                 chr(10) || ' '),
                                                           chr(10) || ' '),
                                                     '<?xml version="1.0" encoding="UTF-8"?>',
                                                     ''),
                                             '<![CDATA[',
                                             ''),
                                     ']]>',
                                     ''),'&amp;','&'),'&apos;',''),'&','&amp;'));     
    END;

END TEST_insert;	


Thank you all,
Nathan
Previous Topic: Large volume data compare - NEED HELP
Next Topic: How to insert HINDI word in ORACLE
Goto Forum:
  


Current Time: Thu Apr 18 19:30:03 CDT 2024