ParseClob

When I try and use parseclob on a clob held within an object type I get
Error occurred while parsing: ORA-00942: table or view does not exist
Any ideas how to cure this or what the table is that it is looking for

I had a similar problem, which seems to have been cured by reloading the parser. I think that deep within your db something is invalid.
Steve

Similar Messages

  • XMLPARSER.parseCLOB Error

    Hi all, i'm having a little trouble working with XML in pl SQL could somebody please help me? I'm the biggest noob
    here is a sample of what i'm doing:
    FUNCTION getXML(IdSP IN NUMBER) RETURN CLOB
    is
    p xmlparser.parser;
    dadosAvaria dbms_xmlgen.ctxHandle;
    result CLOB;
    begin
    dadosAvaria := dbms_xmlgen.newContext('SELECT
    Id_Avaria,
    num_posto,
    ps,
    CCO_1,
    CCO_2,
    Operacao,
    Sub_Operacao,
    AEL_A,
    Servico,
    def_distr,
    sub_esp from r_avari1 where id_equipa = ' || IdSP);
    DBMS_XMLGen.setRowTag(dadosAvaria, 'R_Acti_API_SP');
    DBMS_XMLGen.SETROWSETTAG(dadosAvaria, 'ListagemAvarias');
    result := DBMS_XMLgen.getXML(dadosAvaria);
    p := xmlparser.newparser;
    xmlparser.parseclob(p, result);
    the error is what follows:
    ORA-20103: Null input is not allowed
    ORA-06512: at "SYS.XMLPARSER", line 33
    ORA-06512: at "SYS.XMLPARSER", line 99
    ORA-06512: at "PSINGLRP.PK_BD_SS_XML_SP", line 93 <---- This the line that has the PARSECLOB Statement
    ORA-06512: at line 4
    why does this happens, it should work right?
    I'm using Oracle 9i does anybody knows where can i get more information? Pleasy it is very important and i can't seem to make a correct XML document from a query...
    Thank You
    Best Regards
    João Lopes
    Edited by: Joao Lopes on 2/Jul/2009 6:21

    Hi again, sorry about the absence.
    if result is not null then
    xmlparser.parseclob(parserXML, result);
    doc := xmlparser.getdocument(parserXML);
    xmlparser.freeparser(parserXML);
    nl := xmldom.getElementsByTagName(doc, 'ListagemAvarias');
    numeroOcorrencias := xmldom.getLength(nl);
    end if;
    I added this code to my procedure, it seams that he detects result is null. But in the end of my procedure i added a print clob statement wich is
    xmlstr := dbms_lob.SUBSTR(result,32767);
    loop
    exit when xmlstr is null;
    line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
    dbms_output.put_line('| '||line);
    xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
    end loop;
    The strangest thing is that it prints the value o result in the above statement, but it detects null on the xmlparser
    :S

  • XMLPARSER.parseClob(v_parser, w2_data_clob); returns ORA-20100: Error

    I have a script that calls an output file and reads it into a clob. this portion seems to work fine. I next try to do a XMLPARSER.parseClob(v_parser, w2_data_clob);, but I get the following error:
    ORA-20100: Error occurred while parsing: Expected 'EOF'.
    I am attaching script and output file data. Any and all help is greatly appreciated:
    SET SERVEROUTPUT ON SIZE 100000;
    SET LINESIZE 1000;
    SET DEFINE OFF;
    DECLARE
    file_handle utl_file.FILE_TYPE;
    eof boolean := FALSE;
    retrieved_buffer VARCHAR2(2000);
    dir_name VARCHAR2(240) := cfa_lookup.meaning('APP_BASEPATH','APPLCSF') || '/out';
    file_name VARCHAR2(40) := 'o36841443.xml';
    w2_data_clob CLOB;
    w2_data_clob_out CLOB;
    v_loop_counter INTEGER := 0;
    v_parser xmlparser.parser;
    v_document xmldom.DOMDocument;
    v_length INTEGER := 0;
    v_clob_length INTEGER := 0;
    v_nodelist xmldom.DOMNodeList;
    v_node xmldom.DOMNode;
    v_new_node xmldom.DOMNode;
    v_parent_node xmldom.DOMNode;
    v_record_node XMLDOM.DOMNode;
    avalue xmldom.DOMNode;
    v_new_element xmldom.DOMElement;
    v_new_element_node xmldom.DOMNode;
    v_new_text xmldom.DOMText;
    v_new_text_node xmldom.DOMNode;
    v_employee_id INTEGER;
    v_employer_name hr_organization_units.name%TYPE;
    v_address_line_1 hr_locations.address_line_1%TYPE;
    v_address_line_2 hr_locations.address_line_2%TYPE;
    v_address_line_3 hr_locations.address_line_3%TYPE;
    v_town_or_city hr_locations.town_or_city%TYPE;
    v_region_2 hr_locations.region_2%TYPE;
    v_postal_code hr_locations.postal_code%TYPE;
    v_status INTEGER;
    v_bytes_remaining INTEGER;
    v_current_offset INTEGER;
    v_next_lf_offset INTEGER;
    v_X_offset INTEGER DEFAULT 1;
    v_bytes_to_read INTEGER;
    v_end_of_clob BOOLEAN;
    v_line_number INTEGER;
    v_line VARCHAR2(2000);
    v_bytes_remaining_g_emp INTEGER;
    v_current_offset_g_emp INTEGER;
    v_next_offset_g_emp INTEGER;
    v_bytes_to_read_g_emp INTEGER;
    v_end_of_g_emp BOOLEAN;
    v_amount NUMBER DEFAULT 32000;
    x VARCHAR2(32760);
    v_lf INTEGER;
    e_line_too_long EXCEPTION;
    BEGIN
    DBMS_OUTPUT.PUT_LINE ('Begin process');
    file_handle := utl_file.fopen(dir_name, file_name, 'r');
    IF utl_file.is_open(file_handle) THEN
    DBMS_OUTPUT.PUT_LINE ('File is open');
    END IF;
    BEGIN
    -- Copy w2 xml data file to CLOB
    dbms_lob.createtemporary(w2_data_clob,true,dbms_lob.session);
    DBMS_LOB.OPEN(w2_data_clob, DBMS_LOB.LOB_READWRITE);
    v_clob_length := DBMS_LOB.GETLENGTH(w2_data_clob);
    BEGIN
    LOOP
    utl_file.get_line(file_handle, retrieved_buffer);
    IF NVL(lENGTH(retrieved_buffer),-1) <> -1 THEN
    v_loop_counter := v_loop_counter + 1;
    -- retrieved_buffer := retrieved_buffer || chr(10);
    DBMS_OUTPUT.put_line(v_loop_counter||' '||NVL(LENGTH(RTRIM(retrieved_buffer)),-1)||' ' ||ASCII(SUBSTR(RTRIM(retrieved_buffer),-1,1))||' '||rtrim(retrieved_buffer));
    DBMS_LOB.WRITEAPPEND(w2_data_clob, LENGTH(RTRIM(retrieved_buffer)), RTRIM(retrieved_buffer) );
    ELSE
    DBMS_OUTPUT.put_line('retrieved_buffer IS NULL');
    -- DBMS_LOB.WRITEAPPEND(w2_data_clob, LENGTH(1), ASCII(CHR(13)) );
    END if;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE ('last line read: '||retrieved_buffer);
    DBMS_OUTPUT.PUT_LINE ('no more data in loop: '||SQLERRM);
    -- DBMS_LOB.WRITEAPPEN(w2_data_clob, 1,CHR(10));
    -- DBMS_OUTPUT.put_line(chr(13));
    DBMS_LOB.CLOSE(w2_data_clob);
    WHEN OTHERS THEN
    NULL;
    DBMS_OUTPUT.PUT_LINE ('ERROR in loop: '||SQLERRM);
    END;
    v_clob_length := DBMS_LOB.GETLENGTH(w2_data_clob);
    DBMS_OUTPUT.PUT_LINE ('v_clob_length: '||v_clob_length);
    UTL_FILE.FCLOSE (file_handle);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('ERROR...'||SQLERRM);
    END;
    DBMS_OUTPUT.PUT_LINE ('last line read: '||retrieved_buffer);
    DBMS_OUTPUT.PUT_LINE ('Number of lines written to CLOB: '|| v_loop_counter);
    v_parser := XMLPARSER.newParser;
    XMLPARSER.setValidationMode(v_parser, FALSE);
    DBMS_OUTPUT.PUT_LINE ('10');
    XMLPARSER.parseClob(v_parser, w2_data_clob);
    DBMS_OUTPUT.PUT_LINE ('20');
    v_document := XMLPARSER.getDocument(v_parser);
    DBMS_OUTPUT.PUT_LINE ('30');
    utl_file.fclose(file_handle);
    DBMS_OUTPUT.PUT_LINE('Process Complete');
    EXCEPTION
    WHEN UTL_FILE.INVALID_PATH
    THEN DBMS_OUTPUT.PUT_LINE ('invalid_path');
    WHEN UTL_FILE.INVALID_MODE
    THEN DBMS_OUTPUT.PUT_LINE ('invalid_mode');
    WHEN UTL_FILE.INVALID_FILEHANDLE
    THEN DBMS_OUTPUT.PUT_LINE ('invalid_filehandle');
    WHEN UTL_FILE.INVALID_OPERATION
    THEN DBMS_OUTPUT.PUT_LINE('invalid_operation');
    WHEN UTL_FILE.READ_ERROR
    THEN DBMS_OUTPUT.PUT_LINE('read_error');
    WHEN UTL_FILE.WRITE_ERROR
    THEN DBMS_OUTPUT.PUT_LINE ('write_error');
    WHEN UTL_FILE.INTERNAL_ERROR
    THEN DBMS_OUTPUT.PUT_LINE ('internal_error');
    WHEN OTHERS
    THEN dbms_output.put_line(SQLERRM);
    END;
    <Version_Number> Version 1.1
    </Version_Number>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
    <xapi:request>
    <xapi:delivery>
    <xapi:filesystem output="/u100/applcsf/dcfap/log/o0285647.tmp" />
    </xapi:delivery>
    <xapi:document output-type="pdf">
    <xapi:template type="pdf" location="${templateName1}">
    <xapi:data>
    <w2>
    <control_number>993536284</control_number>
    <federal_ein>54-1234567</federal_ein>
    <employer_name>Charles D Guf</employer_name>
    <employer_address>Chicken House/Rutherford Crossing FSU
    176 Monket St
    Winchester VA 22603</employer_address>
    <ssn>213-99-9999</ssn>
    <emp_name>Darnell </emp_name>
    <last_name>Simpson</last_name>
    <emp_suffix></emp_suffix>
    <employee_address>3981 Water Lane
    Winchester VA 22602</employee_address>
    <wages_tips_compensation>14299.41</wages_tips_compensation>
    <fit_withheld>464.93</fit_withheld>
    <ss_wages>14949.41</ss_wages>
    <ss_withheld>926.87</ss_withheld>
    <med_wages>14949.41</med_wages>
    <med_withheld>216.75</med_withheld>
    <ss_tips></ss_tips>
    <allocated_tips></allocated_tips>
    <eic_payment></eic_payment>
    <dependent_care></dependent_care>
    <non_qual_plan></non_qual_plan>
    <stat_employee>N</stat_employee>
    <retirement_plan>Y</retirement_plan>
    <sick_pay>N</sick_pay>
    <box14_codea></box14_codea>
    <box14_meaninga></box14_meaninga>
    <box14_codeb></box14_codeb>
    <box14_meaningb></box14_meaningb>
    <box14_codec></box14_codec>
    <box14_meaningc></box14_meaningc>
    <box12_codea>D</box12_codea>
    <box12_meaninga>650</box12_meaninga>
    <box12_codeb></box12_codeb>
    <box12_meaningb></box12_meaningb>
    <box12_codec></box12_codec>
    <box12_meaningc></box12_meaningc>
    <box12_coded></box12_coded>
    <box12_meaningd></box12_meaningd>
    <state1_code>VA</state1_code>
    <state1_ein>30-541252257F-001</state1_ein>
    <state1_wages> 14299.41</state1_wages>
    <state1_tax> 388.49</state1_tax>
    <local1_wages></local1_wages>
    <local1_tax></local1_tax>
    <locality1></locality1>
    <state2_code></state2_code>
    <state2_ein></state2_ein>
    <state2_wages></state2_wages>
    <state2_tax></state2_tax>
    <local2_wages></local2_wages>
    <local2_tax></local2_tax>
    <locality2></locality2>
    <year>2008</year>
    <amended></amended>
    <amended_date></amended_date>
    <print_instruction>N</print_instruction>
    </w2>
    </xapi:data>
    </xapi:template>
    <xapi:template type="pdf" location="${templateName2}">
    <xapi:data />
    </xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>

    Well thats the problem - the parser is parsng the clob and is not finding valid XML. It will succeed with
    <Version_Number> Version 1.1
    </Version_Number>
    because, although small its valid XML.
    Im surprised that is the seeded XML from the HRMS team. Have you tried something like SQLDeveloper to look at the contents of the CLOB? Just to ensure your plsql is pulling all of the data out?
    If everything else checks out, I would get an SR logged with Payroll (HRMS) - this is not a BIP issue per se but invalid XML from the HR dev team.
    Regards
    tim

  • Limits to parseCLOB ????

    !!! LIMITS TO PARSECLOB ??? !!!
    This message is ment for the oracle team.
    When using pl/sql i tried to parse (with xmlparser.parseCLOB) a xml that had the same structure as this example:
    <?xml version="1.0"?>
    <TestThis>
    <header>
    <time>12:23:22</time>
    </header>
    <body>
    <product>
    <name>prod1</name>
    </product>
    <product>
    <name>prod2</name>
    </product>
    <product>
    <name>prod3</name>
    </product>
    </body>
    </TestThis>
    I don't really have a question, but want a verification. Is it true that parseCLOB can't handle multiple tags with the SAME NAME and SAME PARENT ?? Is this a known limitation to parseCLOB or a bug?
    I need this information really bad. Whether I'm searching in the wrong direction or have stumbled upon a limitation, I must know if i'm wrong here or just discovered a bug before i can continue...
    thanks...

    The question can be ignored...
    there is no limitation to parseCLOB concerning multiple tags with the same name...
    i made an error that was pretty hard to trace...
    so don't bother replying...
    sorry
    bye

  • How can I take the part that parses the .XML file and make it a procedure.

    CREATE OR REPLACE PACKAGE BODY XMLSTUD6 AS
    Author: Jimmy Harris
    Created: 5/25/2006
    Purpose: 1.This package has an XML file initialized to a variable called DOC .
              2.It will then take the values from the XML file and insert them into a PL/SQL table.
              3.From the PL/SQL table it will insert values into the STUDENTS table.
              4.After step four above, the STUDLOAD procedure will insert (Sequence,Status, .XML file, USER, SYSDATE, ERROR_Message
                             into the AUDIT_XMLSTUD table regardless if insert status was successfull or not status is indicated by either an Y or
              NO and the original XML filed that was currently processed, the date and user who executed the procedure.
              If the status was NO then it will insert the Oracle SQLERRM massage, into the REASON_FOR_ERROR column.
                             If status is Y then REASOK_FOR_ERROR IS NULL.
                             5,Make sure you embed the xml file with an inner and outer ' ' ie: ' the whole .xml file string ' as the input
                             parameter into the STUDLOAD procedure.
    This package excepts the whole .XML file as a CLOB as an input parameter, so that the end-user will not have
                                  modify the code.      
    Modification History:     1.6/09/2006 JImmy Harris Modified code, added the Function "WORD_CONVERTER1" to accept the requested text data and
    return a coded value back to our Welligent system.     
                                  2. Was advised that a front end type of functionality was not neccesary for this issue so I removed the INSERT_XML_FILE,
                                  UPDATE_XML_FILE and the INSERT_XML_file.
    FUNCTION WORD_CONVERTER1 (v_domain IN VARCHAR2 := null,
    v_incoming IN VARCHAR2 := null) RETURN VARCHAR2 IS
    v_well VARCHAR2(32);
    v_editdd BOOLEAN;
    v_code VARCHAR2(32);
    CURSOR C_conv_wrd IS
    SELECT WELL
    INTO v_code
    FROM CONVERSION_TABLE
    WHERE DOMAIN = UPPER(TRIM(v_domain))
    AND INCOMING = UPPER(TRIM(v_incoming));
    BEGIN
    OPEN c_conv_wrd;
    LOOP
    FETCH c_conv_wrd INTO v_code;
    EXIT WHEN c_conv_wrd%NOTFOUND;
    END LOOP;
    CLOSE c_conv_wrd;
    RETURN v_code;
    END WORD_CONVERTER1;
    PROCEDURE STUDLOAD (DOC CLOB) IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    v_mm NUMBER;
    v_dd NUMBER;
    v_yyyy NUMBER;
    v_DATE DATE;
    v_race VARCHAR2(1);
    v_eth VARCHAR2(1);
    v_prim_lang VARCHAR2(1);
    v_house_lang VARCHAR2(1);
    v_gender VARCHAR2(1);
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    v_success VARCHAR2(200);
    v_failure VARCHAR2(200);
    l_error_code varchar2(200);
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent');
    -- Loop through the list and create a new record in a table collection for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/LastName');
         s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/FirstName');
         s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/MiddleName');
         v_dd := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Day');
         v_mm := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Month');
    v_yyyy := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Year');
         v_DATE := TO_DATE(v_mm||' '||v_dd||' '||v_yyyy,'MMDDYYYY');
         s_tab(s_tab.last).STUDENT_DOB := v_date;
         s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/Street');
         s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/ApartmentNumber');
         s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/County');
         s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/State');
         s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/ZipCode');
    v_race := WORD_CONVERTER1('RACE',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Race')));
         v_eth := WORD_CONVERTER1('EHTNICITY',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Ethnicity')));
         v_prim_lang:= WORD_CONVERTER1('PRIMARY_LANG',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/PrimaryLanguage')));
         v_house_lang:= WORD_CONVERTER1('SECONDARY_LANG',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/HouseholdLanguage')));
         v_gender := WORD_CONVERTER1('GENDER',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Gender')));
    s_tab(s_tab.last).STUDENT_RACE := v_race;
         s_tab(s_tab.last).STUDENT_ETHNIC := v_eth;
         s_tab(s_tab.last).STUDENT_PRI_LANG :=v_prim_lang;
         s_tab(s_tab.last).STUDENT_SEC_LANG := v_house_lang;
         s_tab(s_tab.last).STUDENT_GENDER :=v_gender;
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
    INSERT INTO STUDENTS (SHISID, SSN, DOE_SCHOOL_NUMBER,PATIENT_TYPE, TEACHER, HOMEROOM,STUDENT_LAST_NAME, STUDENT_FIRST_NAME, STUDENT_MI,STUDENT_DOB,
    STUDENT_BIRTH_CERT, STUDENT_COMM,STUDENT_MUSA, STUDENT_FAMSIZE, STUDENT_FAMINCOME,STUDENT_UNINSURED, STUDENT_LUNCH, STUDENT_ZIP,STUDENT_STATE,
    STUDENT_COUNTY, STUDENT_STREET,STUDENT_APART_NO, STUDENT_PHONE, STUDENT_H2O_TYPE,STUDENT_WASTE_TRT, STUDENT_HOME_SET, STUDENT_NONHOME_SET,
    STUDENT_GENDER, STUDENT_RACE, STUDENT_ETHNIC,STUDENT_PRI_LANG, STUDENT_SEC_LANG, STUDENT_ATRISK,EMER_COND_MEMO, ASSIST_DEVICE_TYPE,
    SCHOOL_ENTER_AGE,STUDENT_CURR_GRADE, S504_ELIG_DATE, S504_DEV_DATE,S504_REV_DATE, STUDENT_504, STUDENT_IEP,IEP_EXP_DATE, GRAD_CLASS, TYPE_DIPLOMA,
    GRADE_RETAIN, LIT_PASS_TEST_MATH, LIT_PASS_DATE_MATH,LIT_PASS_TEST_WRITE, LIT_PASS_DATE_WRITE, LIT_PASS_TEST_READ,LIT_PASS_DATE_READ, SPEC_ED_ELIG,
    SPEC_ED_CODE,TRANSPORT_CODE, TRANSPORT_NO, PRIME_HANDICAP,PRIME_HANDICAP_PERCENT, PRIME_HANDI_MANAGER, FIRST_ADD_HANDI,FIRST_ADD_HANDICAP_PERCENT,
    FIRST_ADD_HANDI_504, FIRST_ADD_HANDI_504_DATE, SECOND_ADD_HANDI, SECOND_ADD_HANDICAP_PERCENT, MED_EXTERNAL_NAME, INS_TYPE, INS_PRI, INS_NAME,
    INS_MEDICAID_NO, ELIGDATE, INS_PRIV_INSURANCE, INS_APPR_BILL, INS_APPR_DATE, INS_PARENT_APPR,INS_POL_NAME, INS_POL_NO, INS_CARRIER_NO,
    INS_CARRIER_NAME, INS_CARRIER_RELATE, INS_AFFECT_DATE, INS_COPAY_OV, INS_COPAY_RX, INS_COPAY_AMBUL,INS_COPAY_EMER, INS_COPAY_OUTPAT,STUDENT_INACTIVE,
    PHYS_ID, ENCOUNTERNUM,USERID,MODDATE, STUDENT_ID, S504_DISABILITY,CHAPTER1, WELLNESS_ENROLL, SCHOOL_OF_RESIDENCE,INITIAL_IEP_DATE, CALENDAR_TRACK,
    USA_BORN,ALT_ID, FUTURE_SCHOOL, IEP_LAST_MEETING,IEP_LAST_SETTING, IEP_LAST_REFER_EVAL, THIRD_ADD_HANDI,LEP, GIFTED, IEP_EXIT_REASON,
    CASE_MANAGER_ID, INTAKE_NOTES, CALLER_PHONE,CALL_DATE, CALLER_RELATIONSHIP, CALLER_NAME,BUSINESS_PHONE, FAX, EMAIL,HIGHEST_EDUCATION, INTAKE_DATE,
    SERVICE_COORDINATOR, DISCHARGE_DATE, DISCHARGE_REASON, DISCHARGE_NOTES,INTAKE_BY, INTAKE_STATUS, IEP_LAST_SERVED_DATE,IEP_APC_DATE, IEP_EXIT_DATE,
    ADDRESS2, LEGAL_STATUS, RELIGION, EMPLOYMENT_STATUS, TARG_POP_GROUP1, TARG_POP_GROUP2, MARITAL_STATUS,THIRD_ADD_HANDI_PERCENT, LAST_INTERFACE_DATE,
    SERVICE_PLAN_TYPE,CURRENT_JURISDICTION, FIPS, BIRTH_PLACE_JURISDICTION,BIRTH_PLACE_HOSPITAL, BIRTH_PLACE_STATE, BIRTH_PLACE_COUNTRY,
    OTHER_CLIENT_NAME, SIBLINGS_WITH_SERVICES, PERM_SHARE_INFORMATION,PERM_VERIFY_INSURANCE, REFERRING_AGENCY, REFERRING_INDIVIDUAL,AUTOMATIC_ELIGIBILITY,
    INTAKE_IEP_ID, FUTURE_SCHOOL2,FUTURE_SCHOOL3, TRANSLATOR_NEEDED, TOTAL_CHILDREN_IN_HOME,REFERRED_BY, FAMILY_ID, SCREENING_CONSENT_FLAG,PICTURE_FILE,
    DUAL_ENROLLED, DOE_SCHOOL_NUMBER2)
    VALUES (123456789025, null,null ,null,null,null ,s_tab(stud).STUDENT_LAST_NAME,s_tab(stud).STUDENT_FIRST_NAME,s_tab(stud).STUDENT_MI,
    s_tab(stud).STUDENT_DOB,null ,null,null ,null,null,null,null,s_tab(stud).STUDENT_ZIP,s_tab(stud).STUDENT_STATE ,s_tab(stud).STUDENT_COUNTY,
    s_tab(stud).STUDENT_STREET,s_tab(stud).STUDENT_APART_NO,null,null,null ,null , null,
    s_tab(stud).STUDENT_GENDER ,s_tab(stud).STUDENT_RACE , s_tab(stud).STUDENT_ETHNIC,
    s_tab(stud).STUDENT_PRI_LANG ,s_tab(stud).STUDENT_SEC_LANG, null, null ,null , null,
    null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null,
    null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null,
    null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null,
    null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null,
    null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null,
    null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null ,null , null, null, null,null );
    END LOOP;
    INSERT INTO AUDIT_XMLSTUD1(XMLSTUDPK,USERID,XMLFILE,STATUS,REASON_FOR_ERROR,DATE_MODIFIED)
    VALUES(SEQ_XMLSTUD1.NEXTVAL,USER,DOC,'Y',NULL,SYSDATE);
    HTP.HTMLOPEN;
    v_success:= 'The values from the .XML file have been successfully inserted into the STUDENTS table in the Oracle Database.';
    htp.bold(v_success);
    HTP.HTMLCLOSE;
    COMMIT;
    -- Free any resources associated with the document now it that it is no longer needed.
    xmldom.freeDocument(v_doc);
    EXCEPTION
    WHEN OTHERS THEN
    l_error_code := SQLERRM;
    INSERT INTO AUDIT_XMLSTUD1(XMLSTUDPK,USERID,XMLFILE,STATUS,REASON_FOR_ERROR,DATE_MODIFIED)
    VALUES(SEQ_XMLSTUD1.NEXTVAL,USER,nvl(DOC,TO_CLOB('No .XML file entered, user pressed button without entering correct information.')),'NO',l_error_code,SYSDATE);
    HTP.HTMLOPEN;
    v_failure:= 'The attempt made to insert files to the Student table has failed because,'||l_error_code;
    htp.bold(v_failure);
    HTP.HTMLCLOSE;
    COMMIT;
    END STUDLOAD;
    PROCEDURE UPDSTUDLOAD (DOC CLOB) IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    v_mm NUMBER;
    v_dd NUMBER;
    v_yyyy NUMBER;
    v_DATE DATE;
    v_race VARCHAR2(1);
    v_eth VARCHAR2(1);
    v_prim_lang VARCHAR2(1);
    v_house_lang VARCHAR2(1);
    v_gender VARCHAR2(1);
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    v_success VARCHAR2(200);
    v_failure VARCHAR2(200);
    l_error_code varchar2(200);
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent');
    -- Loop through the list and create a new record in a table collection for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/LastName');
         s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/FirstName');
         s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/MiddleName');
         v_dd := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Day');
         v_mm := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Month');
    v_yyyy := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Year');
         v_DATE := TO_DATE(v_mm||' '||v_dd||' '||v_yyyy,'MMDDYYYY');
         s_tab(s_tab.last).STUDENT_DOB := v_date;
         s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/Street');
         s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/ApartmentNumber');
         s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/County');
         s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/State');
         s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/ZipCode');
    v_race := WORD_CONVERTER1('RACE',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Race')));
         v_eth := WORD_CONVERTER1('EHTNICITY',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Ethnicity')));
         v_prim_lang:= WORD_CONVERTER1('PRIMARY_LANG',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/PrimaryLanguage')));
         v_house_lang:= WORD_CONVERTER1('SECONDARY_LANG',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/HouseholdLanguage')));
         v_gender := WORD_CONVERTER1('GENDER',UPPER(xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Gender')));
    s_tab(s_tab.last).STUDENT_RACE := v_race;
         s_tab(s_tab.last).STUDENT_ETHNIC := v_eth;
         s_tab(s_tab.last).STUDENT_PRI_LANG :=v_prim_lang;
         s_tab(s_tab.last).STUDENT_SEC_LANG := v_house_lang;
         s_tab(s_tab.last).STUDENT_GENDER :=v_gender;
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
         UPDATE STUDENTS
         SET
         STUDENT_LAST_NAME = s_tab(stud).STUDENT_LAST_NAME,
         STUDENT_FIRST_NAME = s_tab(stud).STUDENT_FIRST_NAME,
         STUDENT_MI = s_tab(stud).STUDENT_MI,
         STUDENT_DOB = s_tab(stud).STUDENT_DOB,
         STUDENT_ZIP = s_tab(stud).STUDENT_ZIP,
         STUDENT_STATE = s_tab(stud).STUDENT_STATE,
         STUDENT_COUNTY = s_tab(stud).STUDENT_COUNTY,
         STUDENT_STREET = s_tab(stud).STUDENT_STREET,
         STUDENT_APART_NO = s_tab(stud).STUDENT_APART_NO
         WHERE SHISID = 123456789025;
    END LOOP;
    INSERT INTO AUDIT_XMLSTUD1(XMLSTUDPK,USERID,XMLFILE,STATUS,REASON_FOR_ERROR,DATE_MODIFIED)
    VALUES(SEQ_XMLSTUD1.NEXTVAL,USER,DOC,'Y',NULL,SYSDATE);
    HTP.HTMLOPEN;
    v_success:= 'The updated .XML file has been successfully saved to the STUDENTS table in the Oracle Database.';
    htp.bold(v_success);
    HTP.HTMLCLOSE;
    COMMIT;
    -- Free any resources associated with the document now it that it is no longer needed.
    xmldom.freeDocument(v_doc);
    EXCEPTION
    WHEN OTHERS THEN
    l_error_code := SQLERRM;
    INSERT INTO AUDIT_XMLSTUD1(XMLSTUDPK,USERID,XMLFILE,STATUS,REASON_FOR_ERROR,DATE_MODIFIED)
    VALUES(SEQ_XMLSTUD1.NEXTVAL,USER,nvl(DOC,TO_CLOB('No .XML file entered, user pressed button without entering correct information.')),'NO',l_error_code,SYSDATE);
    HTP.HTMLOPEN;
    v_failure:= 'The attempt made to insert files to the Student table has failed because,'||l_error_code;
    htp.bold(v_failure);
    HTP.HTMLCLOSE;
    COMMIT;
    END UPDSTUDLOAD;
    PROCEDURE DELSTUDLOAD (DOC CLOB) IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    v_mm NUMBER;
    v_dd NUMBER;
    v_yyyy NUMBER;
    v_DATE DATE;
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    v_success VARCHAR2(200);
    v_failure VARCHAR2(200);
    l_error_code varchar2(200);
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent');
    -- Loop through the list and create a new record in a table collection for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/LastName');
         s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/FirstName');
         s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Name/MiddleName');
         v_dd := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Day');
         v_mm := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Month');
    v_yyyy := xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/BirthDate/Year');
         v_DATE := TO_DATE(v_mm||' '||v_dd||' '||v_yyyy,'MMDDYYYY');
         s_tab(s_tab.last).STUDENT_DOB := v_date;
         s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/Street');
         s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/ApartmentNumber');
         s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/County');
         s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/State');
         s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address/ZipCode');
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
         DELETE FROM STUDENTS
         WHERE SHISID = 123456789025;
    END LOOP;
    INSERT INTO AUDIT_XMLSTUD1(XMLSTUDPK,USERID,XMLFILE,STATUS,REASON_FOR_ERROR,DATE_MODIFIED)
    VALUES(SEQ_XMLSTUD1.NEXTVAL,USER,DOC,'Y',NULL,SYSDATE);
    HTP.HTMLOPEN;
    v_success:= 'The .XML file has been successfully deleted from the STUDENTS table in the Oracle Database.';
    htp.bold(v_success);
    HTP.HTMLCLOSE;
    COMMIT;
    -- Free any resources associated with the document now it that it is no longer needed.
    xmldom.freeDocument(v_doc);
    EXCEPTION
    WHEN OTHERS THEN
    l_error_code := SQLERRM;
    INSERT INTO AUDIT_XMLSTUD1(XMLSTUDPK,USERID,XMLFILE,STATUS,REASON_FOR_ERROR,DATE_MODIFIED)
    VALUES(SEQ_XMLSTUD1.NEXTVAL,USER,nvl(DOC,TO_CLOB('No .XML file entered, user pressed button without entering correct information.')),'NO',l_error_code,SYSDATE);
    HTP.HTMLOPEN;
    v_failure:= 'The attempt made to insert files to the Student table has failed because,'||l_error_code;
    htp.bold(v_failure);
    HTP.HTMLCLOSE;
    COMMIT;
    END DELSTUDLOAD;
    END XMLSTUD6;

    Try opening the problem files using a text editor or file viewer to see what the first few bytes contain. All valid FM binary files for FM 11 will contain <MakerFile 11.0> in the first bytes of the file.
    When updating books, it's sometimes better to just to create a new book file and add the files to that.
    When renaming files in a book, changes at the system level will break any links/cross-references between files, so it's always best to use the Rename option in the Book file to change FM file names. This will maintain the correct linkages.

  • How to retrieveText Node value

    I am generating an xml doc containing two set of data (one from ord table corresponding to orderId passed to the stored proc from calling app) and then appending child nodes for the values coming as In parameter. When I try to get the value of text node of the child element which has been appended through code, I am getting no values (I could only get to the first child value by (<xsl:value-of select="/EQUITYCONNECT//text()"/>). If I have to get the values of ORD_ID,EXECSIDE and SECURITY node in /EQUITYCONNECT/EXECRPT, how will the XPATH expression coded. (<xsl:value-of select="/EQUITYCONNECT/EXECRPT/EXECSIDE/text()"/> returns null value.
    Here is the code segment
    PROCEDURE xmlRules(orderID NUMBER,execSide NUMBER,security VARCHAR2) IS
    p xmlparser.Parser;
    xmldoc xmldom.DOMDocument;
    docnode xmldom.DOMNode;
    newele xmldom.DOMElement;
    newele1 xmldom.DOMElement;
    newelenode xmldom.DOMNode;
    newelenode1 xmldom.DOMNode;
    textele xmldom.DOMText;
    newtextelenode xmldom.DOMNode;
    compnode xmldom.DOMNode;
    nl xmldom.DOMNodeList;
    n xmldom.DOMNode;
    len number;
    rootnode xmldom.DOMNode;
    vbuffer varchar2(32767);
    line varchar2(4000);
    ordQueryCtx DBMS_XMLGen.ctxHandle;
    execRpt CLOB;
    result CLOB;
    result1 CLOB;
    xmlout VARCHAR2(4000);
    strResult VARCHAR2(4000);
    strResult1 VARCHAR2(4000);
    prtOut VARCHAR2(255);
    begin
    -- new parser
    p := xmlparser.newParser;
    -- set some characteristics
    xmlparser.setValidationMode(p, FALSE);
    -- xmlparser.setErrorLog(p, dir || '/' || errfile);
    xmlparser.setPreserveWhiteSpace(p, TRUE);
    -- set up the query context...!
    ordQueryCtx := DBMS_XMLGen.newContext('select * from ord where ord_id ='|| orderID);
    dbms_xmlgen.setrowsettag(ordQueryCtx,'EQUITYCONNECT');
    dbms_xmlgen.setrowtag(ordQueryCtx,'ORDER');
    -- get the result..!
    result := DBMS_XMLGen.getXML(ordQueryCtx);
    -- Turn into string (test purposes only)
    strResult := dbms_lob.SUBSTR(result);
    -- parse xml file
    xmlparser.parseclob(p,result);
    -- get document
    xmldoc := xmlparser.getDocument(p);
    -- get all elements of document
    nl := xmldom.getElementsByTagName(xmldoc, '*');
    len := xmldom.getLength(nl);
    -- check if number of element nodes are atleast 2
    if len > 1 then
    dbms_output.put_line('Document has more than two elements including Root');
    -- get root element of document
    rootnode := xmldom.item(nl,0);
    -- get the element next to the root element
    n := xmldom.item(nl, 1);
    -- make node for dom document
    docnode := xmldom.makeNode(xmldoc);
    -- create a new element node
    newele := xmldom.createElement(xmldoc, 'EXECRPT');
    newelenode := xmldom.makeNode(newele);
    newele1 := xmldom.createElement(xmldoc, 'ORD_ID');
    newelenode1 := xmldom.makeNode(newele1);
    compnode := xmldom.appendChild(newelenode, newelenode1);
    -- create a new text node
    textele := xmldom.createTextNode(xmldoc, orderID);
    newtextelenode := xmldom.makeNode(textele);
    -- append text node to element node
    compnode := xmldom.appendChild(newelenode1, newtextelenode);
    newele1 := xmldom.createElement(xmldoc, 'EXECSIDE');
    newelenode1 := xmldom.makeNode(newele1);
    compnode := xmldom.appendChild(newelenode, newelenode1);
    -- create a new text node
    textele := xmldom.createTextNode(xmldoc, execSide);
    newtextelenode := xmldom.makeNode(textele);
    -- append text node to element node
    compnode := xmldom.appendChild(newelenode1, newtextelenode);
    newele1 := xmldom.createElement(xmldoc, 'SECURITY');
    newelenode1 := xmldom.makeNode(newele1);
    compnode := xmldom.appendChild(newelenode, newelenode1);
    -- create a new text node
    textele := xmldom.createTextNode(xmldoc, security);
    newtextelenode := xmldom.makeNode(textele);
    -- append text node to element node
    compnode := xmldom.appendChild(newelenode1, newtextelenode);
    -- insert the node just after the parent node
    newelenode := xmldom.insertBefore(rootnode, newelenode, n);
    -- Perform these two operations to avoid ORA-20000 (cannot write to NULL CLOB)
    dbms_lob.createtemporary(result1, true, dbms_lob.session);
    dbms_lob.open(result1, dbms_lob.lob_readwrite);
    xmldom.writetoclob(docnode,result1);
    strResult1 := dbms_lob.substr(result1);
    xmldom.writeToBuffer(docnode, vbuffer);
    -- print the output stored in buffer
    loop
    exit when vbuffer is null;
    line := substr(vbuffer,1,instr(vbuffer,chr(10))-1);
    dbms_output.put_line('| '||line);
    vbuffer := substr(vbuffer,instr(vbuffer,chr(10))+1);
    end loop;
    -- Call Java function which takes (varchar2, varchar2) as args
    xmlout := transform_xml(strResult1, '<html xsl:version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    lang="en">
    <head>
         <title>Order Report</title>
    </head>
    <body>
         <table border="1">
         <tr>
              <th>Row Number</th>
              <th>Order ID</th>
              <th>Order ID</th>
              <th>Txn</th>
              <th>Security</th>
              <th>Quantity</th>
         </tr>
         <xsl:for-each select="EQUITYCONNECT">
              <!-- order the result by revenue -->
              <xsl:sort select="ORD_ID"
                   data-type="number"
                   order="ascending"/>
              <tr>
              <td>
                   <xsl:value-of select="ORDER/ORD_ID"/>
              </td>
              <td>
    <xsl:value-of select="/EQUITYCONNECT//text()"/>          </td>
         </tr>
         </xsl:for-each>
         </table>
    </body>
    </html>');
    -- Close the query context
    DBMS_XMLGen.closeContext(ordQueryCtx);
    end if;
    exception
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    when others then
    dbms_output.put_line('exception occured' || sqlcode || substr(sqlerrm, 1, 100));
    end xmlRules;
    function xml_transform is taking the xml and xsl file as string and returning me xml as string after processing. Basiccally I have to do some comparison on the value of /EQUITYCONNECT/ORDER elements and /EQUITYCONNECT/EXECRPT element.
    Any help will be appreciated.

    Here you go:
           Node nameNode =
                    (Node) XPathFactory.newInstance().newXPath().evaluate(
                            "/root/name", doc, XPathConstants.NODE);
            nameNode.setTextContent("bob");

  • Memory leak using xslprocessor.valueof in 11.1.0.6.0 - 64bit ??

    My company has made the decision to do all of our internal inter-system communication using XML. Often we may need to transfer thousands of records from one system to another and due to this (and the 32K limit in prior versions) we're implementing it in 11g. Currently we have Oracle 11g Enterprise Edition Release 11.1.0.6.0 on 64 bit Linux.
    This is a completely network/memory setup - the XML data comes in using UTL_HTTP and is stored in a CLOB in memory and then converted to a DOMDocument variable and finally the relevant data is extracted using xslprocessor.valueof calls.
    While this is working fine for smaller datasets, I've discovered that repeated calls with very large documents cause the xslprocessor to run out of memory with the following message:
    ERROR at line 1:
    ORA-04030: out of process memory when trying to allocate 21256 bytes
    (qmxdContextEnc,)
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1010
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1036
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1044
    ORA-06512: at "SCOTT.UTL_INTERFACE_PKG", line 206
    ORA-06512: at line 28
    Elapsed: 00:03:32.45
    SQL>
    From further testing, it appears that the failure occurs after approximately 161,500 calls to xslprocessor.valueof however I'm sure this is dependent on the amount of server memory available (6 GB in my case).
    I expect that we will try and log a TAR on this, but my DBA is on vacation right now. Has anyone else tried calling the xslprocessor 200,000 times in a single session?
    I've tried to make my test code as simple as possible in order to track down the problem. This first block simply iterates through all of our offices asking for all of the employees at that office (there are 140 offices in the table).
    DECLARE
    CURSOR c_offices IS
    SELECT office_id
    FROM offices
    ORDER BY office_id;
    r_offices C_OFFICES%ROWTYPE;
    BEGIN
    OPEN c_offices;
    LOOP
    FETCH c_offices INTO r_offices;
    EXIT WHEN c_offices%NOTFOUND;
    utl_interface_pkg.get_employees(r_offices.office_id);
    END LOOP;
    CLOSE c_offices;
    END;
    Normally I'd be returning a collection of result data from this procedure, however I'm trying to make things as simple as possible and make sure I'm not causing the memory leak myself.
    Below is what makes the SOAP calls (using the widely circulated UTL_SOAP_API) to get our data and then extracts the relevant parts. Each office (call) should return between 200 and 1200 employee records.
    PROCEDURE get_employees (p_office_id IN VARCHAR2)
    l_request utl_soap_api.t_request;
    l_response utl_soap_api.t_response;
    l_data_clob CLOB;
    l_xml_namespace VARCHAR2(100) := 'xmlns="' || G_XMLNS_PREFIX || 'EMP.wsGetEmployees"';
    l_xml_doc xmldom.DOMDocument;
    l_node_list xmldom.DOMNodeList;
    l_node xmldom.DOMNode;
    parser xmlparser.Parser;
    l_emp_id NUMBER;
    l_emp_first_name VARCHAR2(100);
    l_emp_last_name VARCHAR2(100);
    BEGIN
    --Set our authentication information.
    utl_soap_api.set_proxy_authentication(p_username => G_AUTH_USER, p_password => G_AUTH_PASS);
    l_request := utl_soap_api.new_request(p_method => 'wsGetEmployees',
    p_namespace => l_xml_namespace);
    utl_soap_api.add_parameter(p_request => l_request,
    p_name => 'officeId',
    p_type => 'xsd:string',
    p_value => p_office_id);
    l_response := utl_soap_api.invoke(p_request => l_request,
    p_url => G_SOAP_URL,
    p_action => 'wsGetEmployees');
    dbms_lob.createtemporary(l_data_clob, cache=>FALSE);
    l_data_clob := utl_soap_api.get_return_clob_value(p_response => l_response,
    p_name => '*',
    p_namespace => l_xml_namespace);
    l_data_clob := DBMS_XMLGEN.CONVERT(l_data_clob, 1); --Storing in CLOB converted symbols (<">) into escaped values (&lt;, &qt;, &gt;).  We need to CONVERT them back.
    parser := xmlparser.newParser;
    xmlparser.parseClob(parser, l_data_clob);
    dbms_lob.freetemporary(l_data_clob);
    l_xml_doc := xmlparser.getDocument(parser);
    xmlparser.freeparser(parser);
    l_node_list := xslprocessor.selectNodes(xmldom.makeNode(l_xml_doc),'/employees/employee');
    FOR i_emp IN 0 .. (xmldom.getLength(l_node_list) - 1)
    LOOP
    l_node := xmldom.item(l_node_list, i_emp);
    l_emp_id := dbms_xslprocessor.valueOf(l_node, 'EMPLOYEEID');
    l_emp_first_name := dbms_xslprocessor.valueOf(l_node, 'FIRSTNAME');
    l_emp_last_name := dbms_xslprocessor.valueOf(l_node, 'LASTNAME');
    END LOOP;
    xmldom.freeDocument(l_xml_doc);
    END get_employees;
    All of this works just fine for smaller result sets, or fewer iterations (only the first two or three offices). Even up to the point of failure the data is being extracted correctly - it just eventually runs out of memory. Is there any way to free up the xslprocessor? I've even tried issuing DBMS_SESSION.FREE_UNUSED_USER_MEMORY but it makes no difference.

    Replying to both of you -
    Line 206 is the first call to xslprocessor.valueof:
    LINE TEXT
    206 l_emp_id := dbms_xslprocessor.valueOf(l_node, 'EMPLOYEEID');
    This is one function inside of a larger package (the UTL_INTERFACE_PKG). The package is just a grouping of these functions - one for each type of SOAP interface we're using. None of the others exhibited this problem, but then none of them return anywhere near this much data either.
    Here is the contents of V$TEMPORARY_LOBS immediately after the crash:
    SID CACHE_LOBS NOCACHE_LOBS ABSTRACT_LOBS
    132 0 0 0
    148 19 1 0
    SID 132 is a SYS session and SID 148 is mine.
    I've discovered with further testing that if I comment out all of the xslprocessor.valueof calls except for the first one the code will complete successfully. It executes the valueof call 99,463 times. If I then uncomment one of those additional calls, we double the number of executions to a theoretical 198,926 (which is greater than the 161,500 point where it usually crashes) and it runs out of memory again.

  • To Get the value of a node in a XML file which is outside the envelope

    Hi Everyone,
    I am uploading data in a XML file into Oracle tables. I am using oracle 9i release 2. How to get a value of a node outside the envelope.
    Here is my xml file.
    <Response>
    <TaskNo>14</TaskNor>
    <ZoneResponse>
    <GetServiceStatusResponse xmlns="http://mws.zonemws.com/Shipment/2010-10-01/">
    <GetServiceStatusResult>
    <Status>GREEN</Status>
    <Date>2011-06-03</Date>
    </GetServiceStatusResult>
    <Metadata>
    <Id>c9488a06</Id>
    </Metadata>
    </GetServiceStatusResponse>
    </ZoneResponse>
    </Response>
    This is the response xml we are getting from the supplier. I do want to store all the values in an oracle table, including TaskNo(14). TaskNo is the main value
    here. I am using dbms_xmlparser and dbms_xmldom in PL/SQL. I am able to get the values inside the envelope, but not the outside(taskno). It is not showing any errors. It is processing all
    other values. I Posted this in the XML DB section also. Please help me to solve this issue. Any help,tips and suggesstion will be highly appreciated. Thanks in advance
    --Vimal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    I am providing some additional info like procedure, table structure and sample xml file so that you can get a clear idea about my problem and help me.
    My Procedure
    PROCEDURE xml_upload (
    p_directory IN VARCHAR2,
    p_server_directory IN VARCHAR2,
    p_filename IN VARCHAR2
    AS
    l_bfile BFILE;
    l_clob CLOB;
    l_parser DBMS_XMLPARSER.parser;
    l_doc DBMS_XMLDOM.domdocument;
    l_noderowset DBMS_XMLDOM.domnode;
    l_noderow DBMS_XMLDOM.domnode;
    l_nodecount NUMBER;
    l_Resultlist DBMS_XMLDOM.domnodelist;
    l_request_id VARCHAR2 (300);
    l_task_number NUMBER;
    l_tasknum_list DBMS_XMLDOM.domnodelist;
    l_service_list DBMS_XMLDOM.domnodelist;
    l_time_list     DBMS_XMLDOM.domnodelist;
    l_tasknode DBMS_XMLDOM.domnode;
    l_servicenode DBMS_XMLDOM.domnode;
    l_temp VARCHAR2 (1000);
    l_table_name VARCHAR2 (100);
    l_cmd_execution VARCHAR2 (1000);
    l_orig_file_with_path VARCHAR2 (1000);
    l_dest_file_with_path VARCHAR2 (1000);
    l_status custom.task_status.status%TYPE;
    l_time custom.task_status.timestamps%TYPE;
    l_rows NUMBER;
    l_message SYS.XMLTYPE;
    l_return_status NUMBER;
    TYPE tab_type IS TABLE OF custom.task_status%ROWTYPE;
    t_tab tab_type := tab_type ();
    PROCEDURE write_exception (
    p1_filename VARCHAR2,
    p_comments VARCHAR2,
    p_rows_created NUMBER
    IS
    BEGIN
    read_xml_file (p_directory, p_filename, l_message, l_return_status);
    -- Convert the xml to a clob
    l_clob := l_message.getclobval();
    -- Create a parser.
    l_parser := DBMS_XMLPARSER.newparser;
    -- Parse the document and create a new DOM document.
    DBMS_XMLPARSER.parseclob (l_parser, l_clob);
    l_doc := DBMS_XMLPARSER.getdocument (l_parser);
    -- Free any resources associated with the CLOB and Parser
    -- dbms_lob.freetemporary(v_clob);
    DBMS_XMLPARSER.freeparser (l_parser);
    l_noderowset :=
    DBMS_XMLDOM.item
    (DBMS_XMLDOM.getchildnodes (DBMS_XMLDOM.makenode (l_doc)),
    0
    l_nodecount :=
    DBMS_XMLDOM.getlength (DBMS_XMLDOM.getchildnodes (l_noderowset))
    - 1;
    t_tab.EXTEND;
    FOR i IN 0 .. l_nodecount
    LOOP
    l_noderow :=
    DBMS_XMLDOM.item (DBMS_XMLDOM.getchildnodes (l_noderowset), i);
    l_Resultlist :=
    DBMS_XMLDOM.getelementsbytagname
    (DBMS_XMLDOM.makeelement (l_noderow),
    'RequestId'
    l_request_id :=
    DBMS_XMLDOM.getnodevalue
    (DBMS_XMLDOM.getfirstchild
    (DBMS_XMLDOM.item (l_Resultlist,
    0
    END LOOP;
    FOR i IN 0 .. l_nodecount
    LOOP
    l_noderow :=
    DBMS_XMLDOM.item (DBMS_XMLDOM.getchildnodes (l_noderowset), i);
    l_service_list:=
    DBMS_XMLDOM.getelementsbytagname
    (DBMS_XMLDOM.makeelement (l_noderow),
    'Status'
    l_status:=
    DBMS_XMLDOM.getnodevalue
    (DBMS_XMLDOM.getfirstchild
    (DBMS_XMLDOM.item (l_service_list,
    0
    l_time_list:=
    DBMS_XMLDOM.getelementsbytagname
    (DBMS_XMLDOM.makeelement (l_noderow),
    'Timestamp'
    l_time:=
    DBMS_XMLDOM.getnodevalue
    (DBMS_XMLDOM.getlastchild
    (DBMS_XMLDOM.item (l_time_list,
    0
    END LOOP;
    select
    extractvalue(column_value,'/Response/TaskNumber') into l_task_number
    from
    table(xmlsequence(xmltype('<Response>
    <TaskNumber>14</TaskNumber>
    <ZoneResponse>
    <GetServiceStatusResponse xmlns="http://mws.zoneaws.com/InboundShipment/2010-10-01/">
    <GetServiceStatusResult>
    <Status>GREEN</Status>
    <Timestamp>2011-06-03T22:17:17.313Z</Timestamp>
    </GetServiceStatusResult>
    <Metadata>
    <RequestId>c9488a06-73c6-474e-b356-51d5f8feec00</RequestId>
    </Metadata>
    </GetServiceStatusResponse>
    </ZoneResponse>
    </Response>
    t_tab (t_tab.LAST).status:= l_status;
    t_tab (t_tab.LAST).timestamps:= l_time;
    t_tab (t_tab.LAST).amz_request_id:= l_request_id;
    t_tab (t_tab.LAST).tasknumber:= l_task_number;
    -- Insert data into the real Staging table from the table collection.
    FORALL i IN t_tab.first .. t_tab.last
    INSERT INTO custom.task_status VALUES t_tab(i);
    COMMIT;
    DBMS_XMLDOM.freedocument (l_doc);
    DBMS_LOB.freetemporary (l_clob);
    DBMS_XMLPARSER.freeparser (l_parser);
    DBMS_XMLDOM.freedocument (l_doc);
    DBMS_LOB.freetemporary (l_clob);
    DBMS_XMLPARSER.freeparser (l_parser);
    DBMS_XMLDOM.freedocument (l_doc);
    END rrs_xml_upload;
    Sample File:
    <Response>
    <TaskNumber>14</TaskNumber>
    <ZoneResponse>
    <GetServiceStatusResponse xmlns="http://mws.zoneaws.com/InboundShipment/2010-10-01/">
    <GetServiceStatusResult>
    <Status>GREEN</Status>
    <Timestamp>2011-06-03T22:17:17.313Z</Timestamp>
    </GetServiceStatusResult>
    <Metadata>
    <RequestId>c9488a06-73c6-474e-b356-51d5f8feec00</RequestId>
    </Metadata>
    </GetServiceStatusResponse>
    </ZoneResponse>
    </Response>
    Table: task_status
    tasknumber number,
    status varchar2(100),
    timestamps varchar2(100),
    requestid varchar2(100)
    all I want is to populate the data from xml file to the particulare table. I can do that with the above procedure.
    But In this below mentioned part of my procedure , I want to pass the file name instead of giving the entire content.
    select
    extractvalue(column_value,'/Response/TaskNumber') into l_task_number
    from
    table(xmlsequence(xmltype('<Response>
    <TaskNumber>14</TaskNumber>
    <ZoneResponse>
    <GetServiceStatusResponse xmlns="http://mws.zoneaws.com/InboundShipment/2010-10-01/">
    <GetServiceStatusResult>
    <Status>GREEN</Status>
    <Timestamp>2011-06-03T22:17:17.313Z</Timestamp>
    </GetServiceStatusResult>
    <Metadata>
    <RequestId>c9488a06-73c6-474e-b356-51d5f8feec00</RequestId>
    </Metadata>
    </GetServiceStatusResponse>
    </ZoneResponse>
    </Response>
    Alex or any other oracle pl/sql experts please help me to solve this issue.
    FYI : I am using Oracle 9.2.0.8.0
    Thanks,
    Vimal..
    Edited by: Vimal on Jun 13, 2011 4:10 PM

  • Creating a PL/SQL table based on XML file.

    I have created two procedures to try and achieve the problem at hand.
    It retrieves and displays the record from a DBMS_OUTPUT.PUT_LINE prospective as indicated in (1&2), but I am having difficulty loading these values into a PL/SQL table from the package labeled as (3).
    All code compiles. (1&2) work together, (3) works by itself but will not populate the table, and I get no errors.
    1.The first being the one that retrieves the XML file and parses it.
    CREATE OR REPLACE procedure xml_main is
    P XMLPARSER.Parser;
    DOC CLOB;
    v_xmldoc xmldom.DOMDocument;
    v_out CLOB;
    BEGIN
    P := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    --v_out  := DOC;
    SYS.XMLPARSER.PARSECLOB ( P, DOC );
    v_xmldoc := SYS.XMLPARSER.getDocument(P);
    --DBMS_LOB.createtemporary(v_out,FALSE,DBMS_LOB.SESSION);
    --v_out := SYS.XMLPARSER.PARSECLOB ( P, DOC );
    --SYS.XMLDOM.writetoCLOB(v_xmldoc, v_out);
    --INSERT INTO TEST (TEST_COLUMN)
    --VALUES(V_OUT);
    --printElements(v_xmldoc);
    printElementAttributes(v_xmldoc);
    exception
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    END;
    2. The second which displays the values from the .xml file I initialized above.
    CREATE OR REPLACE procedure printElementAttributes(doc xmldom.DOMDocument) is
    nl XMLDOM.DOMNODELIST;
    len1           NUMBER;
    len2 NUMBER;
    n      XMLDOM.DOMNODE;
    e      XMLDOM.DOMELEMENT;
    nnm      XMLDOM.DOMNAMEDNODEMAP;
    attrname VARCHAR2(100);
    attrval VARCHAR2(100);
    text_value VARCHAR2(100):=NULL;
    n_child XMLDOM.DOMNODE;
    BEGIN
    -- get all elements
    nl := XMLDOM.getElementsByTagName(doc, '*');
    len1 := XMLDOM.getLength(nl);
    -- loop through elements
    FOR j in 0..len1-1 LOOP
    n := XMLDOM.item(nl, j);
    e := XMLDOM.makeElement(n);
    DBMS_OUTPUT.PUT_LINE(xmldom.getTagName(e) || ':');
    -- get all attributes of element
    nnm := xmldom.getAttributes(n);
         n_child:=xmldom.getFirstChild(n);
    text_value:=xmldom.getNodeValue(n_child);
    dbms_output.put_line('val='||text_value);
    IF (xmldom.isNull(nnm) = FALSE) THEN
    len2 := xmldom.getLength(nnm);
              dbms_output.put_line('length='||len2);
    -- loop through attributes
    FOR i IN 0..len2-1 LOOP
    n := xmldom.item(nnm, i);
    attrname := xmldom.getNodeName(n);
    attrval := xmldom.getNodeValue(n);
    dbms_output.put(' ' || attrname || ' = ' || attrval);
    END LOOP;
    dbms_output.put_line('');
    END IF;
    END LOOP;
    END printElementAttributes;
    3. The package trying to insert into a PL/SQL table.
    CREATE OR REPLACE PACKAGE BODY XMLSTUD2 AS
    PROCEDURE STUDLOAD
    IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    DOC CLOB;
    v_out CLOB;
    n2 XMLDOM.DOMNODELIST;
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    --l_sturec students%rowtype;
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address');
    dbms_output.put_line( 'New Stud processed on '||to_char(sysdate, 'YYYY-MON-DD'));
    -- Loop through the list and create a new record in a tble collection
    -- for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
         --s_tab(s_tab.last).STUDENT_ID :=xslprocessor.valueOf(v_n,'StudentNumber');
         --s_tab(s_tab.last).SSN :=xslprocessor.valueOf(v_n,'ExternalIdNumber');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'StateIdNumber');
         s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'LastName');
         --dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
         s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'FirstName');
         --s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'MiddleName');
         --s_tab(s_tab.last).STUDENT_GENDER :=xslprocessor.valueOf(v_n,'Gender');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Month');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Day');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Year');
         --s_tab(s_tab.last).STUDENT_RACE :=xslprocessor.valueOf(v_n,'Race');
         --s_tab(s_tab.last).STUDENT_ETHNIC :=xslprocessor.valueOf(v_n,'Ethnicity');
         --s_tab(s_tab.last).STUDENT_PRI_LANG :=xslprocessor.valueOf(v_n,'PrimaryLanguage');
         --s_tab(s_tab.last).STUDENT_SEC_LANG :=xslprocessor.valueOf(v_n,'HouseholdLanguage');
         --s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'Street');
         --s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'ApartmentNumber');
         --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'City'); 
         --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'County');
         --s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'State');
         --s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'ZipCode');
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
    dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    INSERT INTO STUDENTS (
    SHISID, SSN, DOE_SCHOOL_NUMBER,
    PATIENT_TYPE, TEACHER, HOMEROOM,
    STUDENT_LAST_NAME, STUDENT_FIRST_NAME, STUDENT_MI,
    STUDENT_DOB, STUDENT_BIRTH_CERT, STUDENT_COMM,
    STUDENT_MUSA, STUDENT_FAMSIZE, STUDENT_FAMINCOME,
    STUDENT_UNINSURED, STUDENT_LUNCH, STUDENT_ZIP,
    STUDENT_STATE, STUDENT_COUNTY, STUDENT_STREET,
    STUDENT_APART_NO, STUDENT_PHONE, STUDENT_H2O_TYPE,
    STUDENT_WASTE_TRT, STUDENT_HOME_SET, STUDENT_NONHOME_SET,
    STUDENT_GENDER, STUDENT_RACE, STUDENT_ETHNIC,
    STUDENT_PRI_LANG, STUDENT_SEC_LANG, STUDENT_ATRISK,
    EMER_COND_MEMO, ASSIST_DEVICE_TYPE, SCHOOL_ENTER_AGE,
    STUDENT_CURR_GRADE, S504_ELIG_DATE, S504_DEV_DATE,
    S504_REV_DATE, STUDENT_504, STUDENT_IEP,
    IEP_EXP_DATE, GRAD_CLASS, TYPE_DIPLOMA,
    GRADE_RETAIN, LIT_PASS_TEST_MATH, LIT_PASS_DATE_MATH,
    LIT_PASS_TEST_WRITE, LIT_PASS_DATE_WRITE, LIT_PASS_TEST_READ,
    LIT_PASS_DATE_READ, SPEC_ED_ELIG, SPEC_ED_CODE,
    TRANSPORT_CODE, TRANSPORT_NO, PRIME_HANDICAP,
    PRIME_HANDICAP_PERCENT, PRIME_HANDI_MANAGER, FIRST_ADD_HANDI,
    FIRST_ADD_HANDICAP_PERCENT, FIRST_ADD_HANDI_504, FIRST_ADD_HANDI_504_DATE,
    SECOND_ADD_HANDI, SECOND_ADD_HANDICAP_PERCENT, MED_EXTERNAL_NAME,
    INS_TYPE, INS_PRI, INS_NAME,
    INS_MEDICAID_NO, ELIGDATE, INS_PRIV_INSURANCE,
    INS_APPR_BILL, INS_APPR_DATE, INS_PARENT_APPR,
    INS_POL_NAME, INS_POL_NO, INS_CARRIER_NO,
    INS_CARRIER_NAME, INS_CARRIER_RELATE, INS_AFFECT_DATE,
    INS_COPAY_OV, INS_COPAY_RX, INS_COPAY_AMBUL,
    INS_COPAY_EMER, INS_COPAY_OUTPAT, STUDENT_INACTIVE,
    PHYS_ID, ENCOUNTERNUM, USERID,
    MODDATE, STUDENT_ID, S504_DISABILITY,
    CHAPTER1, WELLNESS_ENROLL, SCHOOL_OF_RESIDENCE,
    INITIAL_IEP_DATE, CALENDAR_TRACK, USA_BORN,
    ALT_ID, FUTURE_SCHOOL, IEP_LAST_MEETING,
    IEP_LAST_SETTING, IEP_LAST_REFER_EVAL, THIRD_ADD_HANDI,
    LEP, GIFTED, IEP_EXIT_REASON,
    CASE_MANAGER_ID, INTAKE_NOTES, CALLER_PHONE,
    CALL_DATE, CALLER_RELATIONSHIP, CALLER_NAME,
    BUSINESS_PHONE, FAX, EMAIL,
    HIGHEST_EDUCATION, INTAKE_DATE, SERVICE_COORDINATOR,
    DISCHARGE_DATE, DISCHARGE_REASON, DISCHARGE_NOTES,
    INTAKE_BY, INTAKE_STATUS, IEP_LAST_SERVED_DATE,
    IEP_APC_DATE, IEP_EXIT_DATE, ADDRESS2,
    LEGAL_STATUS, RELIGION, EMPLOYMENT_STATUS,
    TARG_POP_GROUP1, TARG_POP_GROUP2, MARITAL_STATUS,
    THIRD_ADD_HANDI_PERCENT, LAST_INTERFACE_DATE, SERVICE_PLAN_TYPE,
    CURRENT_JURISDICTION, FIPS, BIRTH_PLACE_JURISDICTION,
    BIRTH_PLACE_HOSPITAL, BIRTH_PLACE_STATE, BIRTH_PLACE_COUNTRY,
    OTHER_CLIENT_NAME, SIBLINGS_WITH_SERVICES, PERM_SHARE_INFORMATION,
    PERM_VERIFY_INSURANCE, REFERRING_AGENCY, REFERRING_INDIVIDUAL,
    AUTOMATIC_ELIGIBILITY, INTAKE_IEP_ID, FUTURE_SCHOOL2,
    FUTURE_SCHOOL3, TRANSLATOR_NEEDED, TOTAL_CHILDREN_IN_HOME,
    REFERRED_BY, FAMILY_ID, SCREENING_CONSENT_FLAG,
    PICTURE_FILE, DUAL_ENROLLED, DOE_SCHOOL_NUMBER2)
    VALUES (123456789012, null,null ,
    null,null,null ,s_tab(stud).STUDENT_LAST_NAME
    , s_tab(stud).STUDENT_LAST_NAME,null ,
    null ,null ,null ,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null, null,null );
    END LOOP;
    COMMIT;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    xmldom.freeDocument(v_doc);
    END STUDLOAD;
    END XMLSTUD2;
    /

    Hi
    I have created a PLSQL package based Oracle Portal
    form. This is created a s a databse provider. I have
    following questions to check :
    1. How to capture return values from the package and
    display different messages on success or failure ?
    - http://download.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_portletbuilder.htm#BABBAFGI
    Step 16
    2. How to return to blank form by intializing already
    entered values after successfuly process of the form
    data.
    - http://download.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_portletbuilder.htm#BABGBCHH
    thanks
    Manjith

  • Problem retrieving Data from a CDATA-Section using XMLDOM

    Hello,
    Ware: Oracle 8.1.7.4 64bit, XDK for PL/SQL Version 9.2.0.3, Solaris8 64bit
    I can't retrieve Data from the CDATA-Section of an XML-String, neither with
    getData(DOMCharacterData) or substringData. Also getLength fails. I get always
    the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ClassCastException
    ORA-06512: at "XML_SCHEMA.XMLCHARDATACOVER", line 0
    ORA-06512: at "XML_SCHEMA.XMLDOM", line 853
    ORA-06512: at "SCHWABE.XML_TEST", line 47
    ORA-06512: at line 1
    I can successfully cast the DOMNode to a CharacterData with makeCharacterData
    and check with isNull (DOMCharacterData) (returns FALSE).
    My Testcase:
    1) A Function which build a XML-Document:
    CREATE OR REPLACE FUNCTION XML_ResponseCalc RETURN VARCHAR2 IS
    doc VARCHAR2(32767);
    BEGIN
    doc :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <RSDecEng>
    <Version>1.00</Version>
    <ResponseCalc>
    <ID>00000000000000000014</ID>
    <Burst>
    <Definition>
    <Count>1</Count>
    <ID>
    <Start>1</Start>
    <Length>4</Length>
    </ID>
    <Var>
    <Name>Risiko_1</Name>
    <Start>5</Start>
    <Length>5</Length>
    </Var>
    </Definition>
    <Data>
    <Length>9</Length>
    <Count>5</Count>
    <![CDATA[
    1 0.001
    2 0.002
    3 0.003
    4 0.004
    5 0.005
    6 0.006
    7 0.007
    8 0.008
    9 0.009
    10 0.010
    ]]>
    </Data>
    </Burst>
    </ResponseCalc>
    </RSDecEng>
    2) The Procedure which parses the XML-Document (no Exception-Handling):
    CREATE OR REPLACE PROCEDURE XML_TEST IS
    Parser XML_SCHEMA.XMLParser.Parser;
    DOMDocument XML_SCHEMA.XMLDOM.DOMDocument;
    DOMNode XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeItem XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeList XML_SCHEMA.XMLDOM.DOMNodeList;
    DOMCharacterData XML_SCHEMA.XMLDOM.DOMCharacterData;
    TheDocument CLOB;
    ID VARCHAR2(100);
    Data VARCHAR2(200);
    BEGIN
    -- LOB
    DBMS_LOB.CREATETEMPORARY(TheDocument, TRUE);
    DBMS_LOB.WRITEAPPEND(TheDocument, LENGTH(XML_ResponseCalc), XML_ResponseCalc);
    -- Parse
    Parser := XML_SCHEMA.XMLParser.NewParser;
    XML_SCHEMA.XMLParser.ParseCLOB(Parser, TheDocument);
    DOMDocument := XML_SCHEMA.XMLParser.GetDocument(Parser);
    XML_SCHEMA.XMLParser.FreeParser(Parser);
    -- Node
    DOMNode := XML_SCHEMA.XMLDOM.MakeNode(DOMDocument);
    -- Get ID
    DOMNodeList := XML_SCHEMA.XSLProcessor.SelectNodes
    (DOMNode,'/RSDecEng/ResponseCalc/ID/text()');
    IF XML_SCHEMA.XMLDOM.GetLength(DOMNodeList) > 0 THEN
    DOMNodeItem := XML_SCHEMA.XMLDOM.Item(DOMNodeList, 0);
    XML_SCHEMA.XMLDOM.WriteToBuffer(DOMNodeItem, ID);
    SYS.DBMS_OUTPUT.PUT_LINE ('ID: '||ID);
    END IF;
    -- Get CDATA
    DOMCharacterData := XML_SCHEMA.XMLDOM.MakeCharacterData(DomNode); -- <-- ok here...
    IF NOT XML_SCHEMA.XMLDOM.isNull (DOMCharacterData) THEN -- <-- ...and here
    Data := XML_SCHEMA.XMLDOM.GETDATA(DOMCharacterData); -- <-- ...but here Exception raise
    END IF;
    END;
    I hope you can help me.
    Thank you in advance
    Markus Schwabe

    You need to notice the definitions for makecharacterdata:
    FUNCTION makeCharacterData(n DOMNode) RETURN DOMCharacterData;
    PURPOSE
    Casts given DOMNode to a DOMCharacterData
    It only do the casting.

  • Script for parsing xml data and inserting in DB

    Thank you for reading.
    I have the following example XML in an XML file. I need to write a script that can insert this data into an Oracle table. The table does not have primary keys. The data just needs to be inserted.
    I do not have xsd file in this scenario. Please suggest how to modify Method 1 https://community.oracle.com/thread/1115266?tstart=0 mentioned so that I can call the XML mentioned below and insert into a table
    Method 1
    Create or replace procedure parse_xml is 
      l_bfile   BFILE; 
      l_clob    CLOB; 
      l_parser  dbms_xmlparser.Parser; 
      l_doc     dbms_xmldom.DOMDocument; 
      l_nl      dbms_xmldom.DOMNodeList; 
      l_n       dbms_xmldom.DOMNode; 
      l_file      dbms_xmldom.DOMNodeList; 
      l_filen       dbms_xmldom.DOMNode; 
      lv_value VARCHAR2(1000); 
       l_ch      dbms_xmldom.DOMNode; 
    l_partname varchar2(100); 
    l_filename varchar2(1000); 
      l_temp    VARCHAR2(1000); 
      TYPE tab_type IS TABLE OF tab_software_parts%ROWTYPE; 
      t_tab  tab_type := tab_type(); 
    BEGIN 
      l_bfile := BFileName('DIR1', 'SoftwareParts.xml'); 
      dbms_lob.createtemporary(l_clob, cache=>FALSE); 
      dbms_lob.open(l_bfile, dbms_lob.lob_readonly); 
      dbms_lob.loadFromFile(dest_lob => l_clob,    src_lob  => l_bfile,    amount   => dbms_lob.getLength(l_bfile)); 
      dbms_lob.close(l_bfile);  
      dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY'''); 
      l_parser := dbms_xmlparser.newParser; 
      dbms_xmlparser.parseClob(l_parser, l_clob); 
      l_doc := dbms_xmlparser.getDocument(l_parser); 
        dbms_lob.freetemporary(l_clob); 
      dbms_xmlparser.freeParser(l_parser); 
      l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/PartDetails/Part'); 
        FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP 
        l_n := dbms_xmldom.item(l_nl, cur_emp); 
        t_tab.extend; 
        dbms_xslprocessor.valueOf(l_n,'Name/text()',l_partname); 
        t_tab(t_tab.last).partname := l_partname; 
        l_file := dbms_xslprocessor.selectNodes(l_n,'Files/FileName'); 
        FOR cur_ch IN 0 .. dbms_xmldom.getLength(l_file) - 1 LOOP 
          l_ch := dbms_xmldom.item(l_file, cur_ch); 
          lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_ch)); 
          if t_tab(t_tab.last).partname is null then t_tab(t_tab.last).partname := l_partname; end if; 
          t_tab(t_tab.last).filename := lv_value; 
        t_tab.extend; 
       END LOOP; 
       END LOOP; 
        t_tab.delete(t_tab.last); 
      FOR cur_emp IN t_tab.first .. t_tab.last LOOP 
      if t_tab(cur_emp).partname is not null and  t_tab(cur_emp).filename is not null then 
        INSERT INTO tab_software_parts 
        VALUES 
        (t_tab(cur_emp).partname, t_tab(cur_emp).filename); 
        end if; 
      END LOOP; 
      COMMIT; 
      dbms_xmldom.freeDocument(l_doc); 
    EXCEPTION 
      WHEN OTHERS THEN 
        dbms_lob.freetemporary(l_clob); 
        dbms_xmlparser.freeParser(l_parser); 
        dbms_xmldom.freeDocument(l_doc); 
    END; 
    <TWObject className="TWObject">
      <array size="240">
        <item>
          <variable type="QuestionDetail">
            <questionId type="String"><![CDATA[30]]></questionId>
            <questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
            <country type="String"><![CDATA[GB]]></country>
            <questionText type="String"><![CDATA[Please indicate]]></questionText>
            <optionType type="String"><![CDATA[RadioButton]]></optionType>
            <answerOptions type="String[]">
              <item><![CDATA[Yes]]></item>
              <item><![CDATA[No]]></item>
            </answerOptions>
            <ruleId type="String"><![CDATA[CRP_GB001]]></ruleId>
            <parentQuestionId type="String"></parentQuestionId>
            <parentQuestionResp type="String"></parentQuestionResp>
          </variable>
        </item>
        <item>
          <variable type="QuestionDetail">
            <questionId type="String"><![CDATA[40]]></questionId>
            <questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
            <country type="String"><![CDATA[DE]]></country>
            <questionText type="String"><![CDATA[Please indicate]]></questionText>
            <optionType type="String"><![CDATA[RadioButton]]></optionType>
            <answerOptions type="String[]">
              <item><![CDATA[Yes]]></item>
              <item><![CDATA[No]]></item>
            </answerOptions>
            <ruleId type="String"><![CDATA[CRP_Q0001]]></ruleId>
            <parentQuestionId type="String"></parentQuestionId>
            <parentQuestionResp type="String"></parentQuestionResp>
          </variable>
        </item>
      </array>
    </TWObject>

    Reposted as
    Script to parse XML data into Oracle DB

  • Loading datafrom a PL/SQL table into the Database table

    I have created two procedures to try and achieve the problem at hand.
    It retrieves and displays the record from a DBMS_OUTPUT.PUT_LINE prospective as indicated in (1&2), but I am having difficulty loading these values into a PL/SQL table from the package labeled as (3). I read your book and all but I do not see a solution to my problem
    All code compiles. (1&2) work together, (3) works by itself but will not populate the table, and I get no errors.
    1.The first being the one that retrieves the XML file and parses it.
    CREATE OR REPLACE procedure xml_main is
    P XMLPARSER.Parser;
    DOC CLOB;
    v_xmldoc xmldom.DOMDocument;
    v_out CLOB;
    BEGIN
    P := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    --v_out := DOC;
    SYS.XMLPARSER.PARSECLOB ( P, DOC );
    v_xmldoc := SYS.XMLPARSER.getDocument(P);
    --DBMS_LOB.createtemporary(v_out,FALSE,DBMS_LOB.SESSION);
    --v_out := SYS.XMLPARSER.PARSECLOB ( P, DOC );
    --SYS.XMLDOM.writetoCLOB(v_xmldoc, v_out);
    --INSERT INTO TEST (TEST_COLUMN)
    --VALUES(V_OUT);
    --printElements(v_xmldoc);
    printElementAttributes(v_xmldoc);
    exception
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    END;
    2. The second which displays the values from the .xml file I initialized above.
    CREATE OR REPLACE procedure printElementAttributes(doc xmldom.DOMDocument) is
    nl XMLDOM.DOMNODELIST;
    len1 NUMBER;
    len2 NUMBER;
    n XMLDOM.DOMNODE;
    e XMLDOM.DOMELEMENT;
    nnm XMLDOM.DOMNAMEDNODEMAP;
    attrname VARCHAR2(100);
    attrval VARCHAR2(100);
    text_value VARCHAR2(100):=NULL;
    n_child XMLDOM.DOMNODE;
    BEGIN
    -- get all elements
    nl := XMLDOM.getElementsByTagName(doc, '*');
    len1 := XMLDOM.getLength(nl);
    -- loop through elements
    FOR j in 0..len1-1 LOOP
    n := XMLDOM.item(nl, j);
    e := XMLDOM.makeElement(n);
    DBMS_OUTPUT.PUT_LINE(xmldom.getTagName(e) || ':');
    -- get all attributes of element
    nnm := xmldom.getAttributes(n);
    n_child:=xmldom.getFirstChild(n);
    text_value:=xmldom.getNodeValue(n_child);
    dbms_output.put_line('val='||text_value);
    IF (xmldom.isNull(nnm) = FALSE) THEN
    len2 := xmldom.getLength(nnm);
    dbms_output.put_line('length='||len2);
    -- loop through attributes
    FOR i IN 0..len2-1 LOOP
    n := xmldom.item(nnm, i);
    attrname := xmldom.getNodeName(n);
    attrval := xmldom.getNodeValue(n);
    dbms_output.put(' ' || attrname || ' = ' || attrval);
    END LOOP;
    dbms_output.put_line('');
    END IF;
    END LOOP;
    END printElementAttributes;
    3. The package trying to insert into a PL/SQL table.
    CREATE OR REPLACE PACKAGE BODY XMLSTUD2 AS
    PROCEDURE STUDLOAD
    IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    DOC CLOB;
    v_out CLOB;
    n2 XMLDOM.DOMNODELIST;
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    --l_sturec students%rowtype;
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address');
    dbms_output.put_line( 'New Stud processed on '||to_char(sysdate, 'YYYY-MON-DD'));
    -- Loop through the list and create a new record in a tble collection
    -- for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    --s_tab(s_tab.last).STUDENT_ID :=xslprocessor.valueOf(v_n,'StudentNumber');
    --s_tab(s_tab.last).SSN :=xslprocessor.valueOf(v_n,'ExternalIdNumber');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'StateIdNumber');
    s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'LastName');
    --dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'FirstName');
    --s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'MiddleName');
    --s_tab(s_tab.last).STUDENT_GENDER :=xslprocessor.valueOf(v_n,'Gender');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Month');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Day');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Year');
    --s_tab(s_tab.last).STUDENT_RACE :=xslprocessor.valueOf(v_n,'Race');
    --s_tab(s_tab.last).STUDENT_ETHNIC :=xslprocessor.valueOf(v_n,'Ethnicity');
    --s_tab(s_tab.last).STUDENT_PRI_LANG :=xslprocessor.valueOf(v_n,'PrimaryLanguage');
    --s_tab(s_tab.last).STUDENT_SEC_LANG :=xslprocessor.valueOf(v_n,'HouseholdLanguage');
    --s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'Street');
    --s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'ApartmentNumber');
    --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'City');
    --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'County');
    --s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'State');
    --s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'ZipCode');
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
    dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    INSERT INTO STUDENTS (
    SHISID, SSN, DOE_SCHOOL_NUMBER,
    PATIENT_TYPE, TEACHER, HOMEROOM,
    STUDENT_LAST_NAME, STUDENT_FIRST_NAME, STUDENT_MI,
    STUDENT_DOB, STUDENT_BIRTH_CERT, STUDENT_COMM,
    STUDENT_MUSA, STUDENT_FAMSIZE, STUDENT_FAMINCOME,
    STUDENT_UNINSURED, STUDENT_LUNCH, STUDENT_ZIP,
    STUDENT_STATE, STUDENT_COUNTY, STUDENT_STREET,
    STUDENT_APART_NO, STUDENT_PHONE, STUDENT_H2O_TYPE,
    STUDENT_WASTE_TRT, STUDENT_HOME_SET, STUDENT_NONHOME_SET,
    STUDENT_GENDER, STUDENT_RACE, STUDENT_ETHNIC,
    STUDENT_PRI_LANG, STUDENT_SEC_LANG, STUDENT_ATRISK,
    EMER_COND_MEMO, ASSIST_DEVICE_TYPE, SCHOOL_ENTER_AGE,
    STUDENT_CURR_GRADE, S504_ELIG_DATE, S504_DEV_DATE,
    S504_REV_DATE, STUDENT_504, STUDENT_IEP,
    IEP_EXP_DATE, GRAD_CLASS, TYPE_DIPLOMA,
    GRADE_RETAIN, LIT_PASS_TEST_MATH, LIT_PASS_DATE_MATH,
    LIT_PASS_TEST_WRITE, LIT_PASS_DATE_WRITE, LIT_PASS_TEST_READ,
    LIT_PASS_DATE_READ, SPEC_ED_ELIG, SPEC_ED_CODE,
    TRANSPORT_CODE, TRANSPORT_NO, PRIME_HANDICAP,
    PRIME_HANDICAP_PERCENT, PRIME_HANDI_MANAGER, FIRST_ADD_HANDI,
    FIRST_ADD_HANDICAP_PERCENT, FIRST_ADD_HANDI_504, FIRST_ADD_HANDI_504_DATE,
    SECOND_ADD_HANDI, SECOND_ADD_HANDICAP_PERCENT, MED_EXTERNAL_NAME,
    INS_TYPE, INS_PRI, INS_NAME,
    INS_MEDICAID_NO, ELIGDATE, INS_PRIV_INSURANCE,
    INS_APPR_BILL, INS_APPR_DATE, INS_PARENT_APPR,
    INS_POL_NAME, INS_POL_NO, INS_CARRIER_NO,
    INS_CARRIER_NAME, INS_CARRIER_RELATE, INS_AFFECT_DATE,
    INS_COPAY_OV, INS_COPAY_RX, INS_COPAY_AMBUL,
    INS_COPAY_EMER, INS_COPAY_OUTPAT, STUDENT_INACTIVE,
    PHYS_ID, ENCOUNTERNUM, USERID,
    MODDATE, STUDENT_ID, S504_DISABILITY,
    CHAPTER1, WELLNESS_ENROLL, SCHOOL_OF_RESIDENCE,
    INITIAL_IEP_DATE, CALENDAR_TRACK, USA_BORN,
    ALT_ID, FUTURE_SCHOOL, IEP_LAST_MEETING,
    IEP_LAST_SETTING, IEP_LAST_REFER_EVAL, THIRD_ADD_HANDI,
    LEP, GIFTED, IEP_EXIT_REASON,
    CASE_MANAGER_ID, INTAKE_NOTES, CALLER_PHONE,
    CALL_DATE, CALLER_RELATIONSHIP, CALLER_NAME,
    BUSINESS_PHONE, FAX, EMAIL,
    HIGHEST_EDUCATION, INTAKE_DATE, SERVICE_COORDINATOR,
    DISCHARGE_DATE, DISCHARGE_REASON, DISCHARGE_NOTES,
    INTAKE_BY, INTAKE_STATUS, IEP_LAST_SERVED_DATE,
    IEP_APC_DATE, IEP_EXIT_DATE, ADDRESS2,
    LEGAL_STATUS, RELIGION, EMPLOYMENT_STATUS,
    TARG_POP_GROUP1, TARG_POP_GROUP2, MARITAL_STATUS,
    THIRD_ADD_HANDI_PERCENT, LAST_INTERFACE_DATE, SERVICE_PLAN_TYPE,
    CURRENT_JURISDICTION, FIPS, BIRTH_PLACE_JURISDICTION,
    BIRTH_PLACE_HOSPITAL, BIRTH_PLACE_STATE, BIRTH_PLACE_COUNTRY,
    OTHER_CLIENT_NAME, SIBLINGS_WITH_SERVICES, PERM_SHARE_INFORMATION,
    PERM_VERIFY_INSURANCE, REFERRING_AGENCY, REFERRING_INDIVIDUAL,
    AUTOMATIC_ELIGIBILITY, INTAKE_IEP_ID, FUTURE_SCHOOL2,
    FUTURE_SCHOOL3, TRANSLATOR_NEEDED, TOTAL_CHILDREN_IN_HOME,
    REFERRED_BY, FAMILY_ID, SCREENING_CONSENT_FLAG,
    PICTURE_FILE, DUAL_ENROLLED, DOE_SCHOOL_NUMBER2)
    VALUES (123456789012, null,null ,
    null,null,null ,s_tab(stud).STUDENT_LAST_NAME
    , s_tab(stud).STUDENT_LAST_NAME,null ,
    null ,null ,null ,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null, null,null );
    END LOOP;
    COMMIT;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    xmldom.freeDocument(v_doc);
    END STUDLOAD;
    END XMLSTUD2;
    /

    Here's a first cut for you. Note that I've added some annotations to the XML Schema
    SQL>
    SQL>
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'http://xmlns.welligent.com/xsd/Student.xsd';
      3    :schemaPath := '/public/Student.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
      2  /
    Call completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      5     <xs:element name="Address" xdb:defaultTable="">
      6             <xs:complexType>
      7                     <xs:sequence>
      8                             <xs:element ref="Street"/>
      9                             <xs:element ref="ApartmentNumber"/>
    10                             <xs:element ref="City"/>
    11                             <xs:element ref="County"/>
    12                             <xs:element ref="State"/>
    13                             <xs:element ref="ZipCode"/>
    14                     </xs:sequence>
    15             </xs:complexType>
    16     </xs:element>
    17     <xs:element name="ApartmentNumber" xdb:defaultTable="">
    18             <xs:simpleType>
    19                     <xs:restriction base="xs:string">
    20                             <xs:enumeration value="12-D"/>
    21                     </xs:restriction>
    22             </xs:simpleType>
    23     </xs:element>
    24     <xs:element name="AuthUserId" xdb:defaultTable="">
    25             <xs:simpleType>
    26                     <xs:restriction base="xs:string">
    27                             <xs:enumeration value="Router"/>
    28                     </xs:restriction>
    29             </xs:simpleType>
    30     </xs:element>
    31     <xs:element name="Authentication" xdb:defaultTable="">
    32             <xs:complexType>
    33                     <xs:sequence>
    34                             <xs:element ref="AuthUserId"/>
    35                     </xs:sequence>
    36             </xs:complexType>
    37     </xs:element>
    38     <xs:element name="BasicStudent" xdb:defaultTable="">
    39             <xs:complexType>
    40                     <xs:sequence>
    41                             <xs:element ref="StudentNumber"/>
    42                             <xs:element ref="ExternalIdNumber"/>
    43                             <xs:element ref="StateIdNumber"/>
    44                             <xs:element ref="Name"/>
    45                             <xs:element ref="Gender"/>
    46                             <xs:element ref="BirthDate"/>
    47                             <xs:element ref="Race"/>
    48                             <xs:element ref="Ethnicity"/>
    49                             <xs:element ref="PrimaryLanguage"/>
    50                             <xs:element ref="HouseholdLanguage"/>
    51                             <xs:element ref="Address"/>
    52                     </xs:sequence>
    53                     <xs:attribute name="mealCode" type="xs:string" use="required"/>
    54                     <xs:attribute name="usBorn" use="required">
    55                             <xs:simpleType>
    56                                     <xs:restriction base="xs:string">
    57                                             <xs:enumeration value="Yes"/>
    58                                     </xs:restriction>
    59                             </xs:simpleType>
    60                     </xs:attribute>
    61                     <xs:attribute name="migrant" use="required">
    62                             <xs:simpleType>
    63                                     <xs:restriction base="xs:string">
    64                                             <xs:enumeration value="No"/>
    65                                     </xs:restriction>
    66                             </xs:simpleType>
    67                     </xs:attribute>
    68                     <xs:attribute name="workAbility" use="required">
    69                             <xs:simpleType>
    70                                     <xs:restriction base="xs:string">
    71                                             <xs:enumeration value="No"/>
    72                                     </xs:restriction>
    73                             </xs:simpleType>
    74                     </xs:attribute>
    75                     <xs:attribute name="ellStatus" type="xs:string" use="required"/>
    76             </xs:complexType>
    77     </xs:element>
    78     <xs:element name="BirthDate" xdb:defaultTable="">
    79             <xs:complexType>
    80                     <xs:sequence>
    81                             <xs:element ref="Month"/>
    82                             <xs:element ref="Day"/>
    83                             <xs:element ref="Year"/>
    84                     </xs:sequence>
    85             </xs:complexType>
    86     </xs:element>
    87     <xs:element name="City" xdb:defaultTable="">
    88             <xs:simpleType>
    89                     <xs:restriction base="xs:string">
    90                             <xs:enumeration value="Los Angeles"/>
    91                     </xs:restriction>
    92             </xs:simpleType>
    93     </xs:element>
    94     <xs:element name="ControlAreaSync" xdb:defaultTable="">
    95             <xs:complexType>
    96                     <xs:sequence>
    97                             <xs:element ref="Sender"/>
    98                             <xs:element ref="Datetime"/>
    99                     </xs:sequence>
    100                     <xs:attribute name="messageCategory" use="required">
    101                             <xs:simpleType>
    102                                     <xs:restriction base="xs:string">
    103                                             <xs:enumeration value="com.welligent.Student"/>
    104                                     </xs:restriction>
    105                             </xs:simpleType>
    106                     </xs:attribute>
    107                     <xs:attribute name="messageObject" use="required">
    108                             <xs:simpleType>
    109                                     <xs:restriction base="xs:string">
    110                                             <xs:enumeration value="BasicStudent"/>
    111                                     </xs:restriction>
    112                             </xs:simpleType>
    113                     </xs:attribute>
    114                     <xs:attribute name="messageAction" use="required">
    115                             <xs:simpleType>
    116                                     <xs:restriction base="xs:string">
    117                                             <xs:enumeration value="Create"/>
    118                                     </xs:restriction>
    119                             </xs:simpleType>
    120                     </xs:attribute>
    121                     <xs:attribute name="messageRelease" use="required">
    122                             <xs:simpleType>
    123                                     <xs:restriction base="xs:decimal">
    124                                             <xs:enumeration value="1.0"/>
    125                                     </xs:restriction>
    126                             </xs:simpleType>
    127                     </xs:attribute>
    128                     <xs:attribute name="messagePriority" use="required">
    129                             <xs:simpleType>
    130                                     <xs:restriction base="xs:byte">
    131                                             <xs:enumeration value="1"/>
    132                                     </xs:restriction>
    133                             </xs:simpleType>
    134                     </xs:attribute>
    135                     <xs:attribute name="messageType" use="required">
    136                             <xs:simpleType>
    137                                     <xs:restriction base="xs:string">
    138                                             <xs:enumeration value="Sync"/>
    139                                     </xs:restriction>
    140                             </xs:simpleType>
    141                     </xs:attribute>
    142             </xs:complexType>
    143     </xs:element>
    144     <xs:element name="County" xdb:defaultTable="">
    145             <xs:simpleType>
    146                     <xs:restriction base="xs:string">
    147                             <xs:enumeration value="Los Angeles"/>
    148                     </xs:restriction>
    149             </xs:simpleType>
    150     </xs:element>
    151     <xs:element name="DataArea" xdb:defaultTable="">
    152             <xs:complexType>
    153                     <xs:sequence>
    154                             <xs:element ref="NewData"/>
    155                     </xs:sequence>
    156             </xs:complexType>
    157     </xs:element>
    158     <xs:element name="Datetime">
    159             <xs:complexType>
    160                     <xs:sequence>
    161                             <xs:element ref="Year"/>
    162                             <xs:element ref="Month"/>
    163                             <xs:element ref="Day"/>
    164                             <xs:element ref="Hour"/>
    165                             <xs:element ref="Minute"/>
    166                             <xs:element ref="Second"/>
    167                             <xs:element ref="SubSecond"/>
    168                             <xs:element ref="Timezone"/>
    169                     </xs:sequence>
    170             </xs:complexType>
    171     </xs:element>
    172     <xs:element name="Day" xdb:defaultTable="">
    173             <xs:simpleType>
    174                     <xs:restriction base="xs:byte">
    175                             <xs:enumeration value="1"/>
    176                             <xs:enumeration value="23"/>
    177                     </xs:restriction>
    178             </xs:simpleType>
    179     </xs:element>
    180     <xs:element name="Ethnicity" xdb:defaultTable="">
    181             <xs:simpleType>
    182                     <xs:restriction base="xs:string">
    183                             <xs:enumeration value="Hispanic"/>
    184                     </xs:restriction>
    185             </xs:simpleType>
    186     </xs:element>
    187     <xs:element name="ExternalIdNumber" xdb:defaultTable="">
    188             <xs:simpleType>
    189                     <xs:restriction base="xs:int">
    190                             <xs:enumeration value="1234567890"/>
    191                     </xs:restriction>
    192             </xs:simpleType>
    193     </xs:element>
    194     <xs:element name="FirstName" xdb:defaultTable="">
    195             <xs:simpleType>
    196                     <xs:restriction base="xs:string">
    197                             <xs:enumeration value="Maria"/>
    198                     </xs:restriction>
    199             </xs:simpleType>
    200     </xs:element>
    201     <xs:element name="Gender" xdb:defaultTable="">
    202             <xs:simpleType>
    203                     <xs:restriction base="xs:string">
    204                             <xs:enumeration value="Female"/>
    205                     </xs:restriction>
    206             </xs:simpleType>
    207     </xs:element>
    208     <xs:element name="Hour" xdb:defaultTable="">
    209             <xs:simpleType>
    210                     <xs:restriction base="xs:byte">
    211                             <xs:enumeration value="13"/>
    212                     </xs:restriction>
    213             </xs:simpleType>
    214     </xs:element>
    215     <xs:element name="HouseholdLanguage" xdb:defaultTable="">
    216             <xs:simpleType>
    217                     <xs:restriction base="xs:string">
    218                             <xs:enumeration value="Spanish"/>
    219                     </xs:restriction>
    220             </xs:simpleType>
    221     </xs:element>
    222     <xs:element name="LastName" xdb:defaultTable="">
    223             <xs:simpleType>
    224                     <xs:restriction base="xs:string">
    225                             <xs:enumeration value="Lopez"/>
    226                     </xs:restriction>
    227             </xs:simpleType>
    228     </xs:element>
    229     <xs:element name="MessageId" xdb:defaultTable="">
    230             <xs:complexType>
    231                     <xs:sequence>
    232                             <xs:element ref="SenderAppId"/>
    233                             <xs:element ref="ProducerId"/>
    234                             <xs:element ref="MessageSeq"/>
    235                     </xs:sequence>
    236             </xs:complexType>
    237     </xs:element>
    238     <xs:element name="MessageSeq" xdb:defaultTable="">
    239             <xs:simpleType>
    240                     <xs:restriction base="xs:byte">
    241                             <xs:enumeration value="53"/>
    242                     </xs:restriction>
    243             </xs:simpleType>
    244     </xs:element>
    245     <xs:element name="MiddleName" xdb:defaultTable="">
    246             <xs:simpleType>
    247                     <xs:restriction base="xs:string">
    248                             <xs:enumeration value="S"/>
    249                     </xs:restriction>
    250             </xs:simpleType>
    251     </xs:element>
    252     <xs:element name="Minute" xdb:defaultTable="">
    253             <xs:simpleType>
    254                     <xs:restriction base="xs:byte">
    255                             <xs:enumeration value="47"/>
    256                     </xs:restriction>
    257             </xs:simpleType>
    258     </xs:element>
    259     <xs:element name="Month" xdb:defaultTable="">
    260             <xs:simpleType>
    261                     <xs:restriction base="xs:byte">
    262                             <xs:enumeration value="1"/>
    263                             <xs:enumeration value="3"/>
    264                     </xs:restriction>
    265             </xs:simpleType>
    266     </xs:element>
    267     <xs:element name="Name" xdb:defaultTable="">
    268             <xs:complexType>
    269                     <xs:sequence>
    270                             <xs:element ref="LastName"/>
    271                             <xs:element ref="FirstName"/>
    272                             <xs:element ref="MiddleName"/>
    273                     </xs:sequence>
    274             </xs:complexType>
    275     </xs:element>
    276     <xs:element name="NewData" xdb:defaultTable="">
    277             <xs:complexType>
    278                     <xs:sequence>
    279                             <xs:element ref="BasicStudent"/>
    280                     </xs:sequence>
    281             </xs:complexType>
    282     </xs:element>
    283     <xs:element name="PrimaryLanguage" xdb:defaultTable="">
    284             <xs:simpleType>
    285                     <xs:restriction base="xs:string">
    286                             <xs:enumeration value="English"/>
    287                     </xs:restriction>
    288             </xs:simpleType>
    289     </xs:element>
    290     <xs:element name="ProducerId" xdb:defaultTable="">
    291             <xs:simpleType>
    292                     <xs:restriction base="xs:string">
    293                             <xs:enumeration value="a72af712-90ea-43be-b958-077a87a29bfb"/>
    294                     </xs:restriction>
    295             </xs:simpleType>
    296     </xs:element>
    297     <xs:element name="Race" xdb:defaultTable="">
    298             <xs:simpleType>
    299                     <xs:restriction base="xs:string">
    300                             <xs:enumeration value="Hispanic"/>
    301                     </xs:restriction>
    302             </xs:simpleType>
    303     </xs:element>
    304     <xs:element name="Second" xdb:defaultTable="">
    305             <xs:simpleType>
    306                     <xs:restriction base="xs:byte">
    307                             <xs:enumeration value="30"/>
    308                     </xs:restriction>
    309             </xs:simpleType>
    310     </xs:element>
    311     <xs:element name="Sender" xdb:defaultTable="">
    312             <xs:complexType>
    313                     <xs:sequence>
    314                             <xs:element ref="MessageId"/>
    315                             <xs:element ref="Authentication"/>
    316                     </xs:sequence>
    317             </xs:complexType>
    318     </xs:element>
    319     <xs:element name="SenderAppId" xdb:defaultTable="">
    320             <xs:simpleType>
    321                     <xs:restriction base="xs:string">
    322                             <xs:enumeration value="com.openii.SyncRouter"/>
    323                     </xs:restriction>
    324             </xs:simpleType>
    325     </xs:element>
    326     <xs:element name="State" xdb:defaultTable="">
    327             <xs:simpleType>
    328                     <xs:restriction base="xs:string">
    329                             <xs:enumeration value="CA"/>
    330                     </xs:restriction>
    331             </xs:simpleType>
    332     </xs:element>
    333     <xs:element name="StateIdNumber" xdb:defaultTable="">
    334             <xs:simpleType>
    335                     <xs:restriction base="xs:int">
    336                             <xs:enumeration value="123456"/>
    337                     </xs:restriction>
    338             </xs:simpleType>
    339     </xs:element>
    340     <xs:element name="Street" xdb:defaultTable="">
    341             <xs:simpleType>
    342                     <xs:restriction base="xs:string">
    343                             <xs:enumeration value="123 Any Street"/>
    344                     </xs:restriction>
    345             </xs:simpleType>
    346     </xs:element>
    347     <xs:element name="StudentNumber" xdb:defaultTable="">
    348             <xs:simpleType>
    349                     <xs:restriction base="xs:hexBinary">
    350                             <xs:enumeration value="052589F201"/>
    351                     </xs:restriction>
    352             </xs:simpleType>
    353     </xs:element>
    354     <xs:element name="SubSecond" xdb:defaultTable="">
    355             <xs:simpleType>
    356                     <xs:restriction base="xs:short">
    357                             <xs:enumeration value="223"/>
    358                     </xs:restriction>
    359             </xs:simpleType>
    360     </xs:element>
    361     <xs:element name="Timezone" xdb:defaultTable="">
    362             <xs:simpleType>
    363                     <xs:restriction base="xs:string">
    364                             <xs:enumeration value="6:00-GMT"/>
    365                     </xs:restriction>
    366             </xs:simpleType>
    367     </xs:element>
    368     <xs:element name="Year" xdb:defaultTable="">
    369             <xs:simpleType>
    370                     <xs:restriction base="xs:short">
    371                             <xs:enumeration value="1995"/>
    372                             <xs:enumeration value="2001"/>
    373                     </xs:restriction>
    374             </xs:simpleType>
    375     </xs:element>
    376     <xs:element name="ZipCode" xdb:defaultTable="">
    377             <xs:simpleType>
    378                     <xs:restriction base="xs:int">
    379                             <xs:enumeration value="90071"/>
    380                     </xs:restriction>
    381             </xs:simpleType>
    382     </xs:element>
    383     <xs:element name="com.welligent.Student.BasicStudent.Create" xdb:defaultTable="STUDENT_TABLE">
    384             <xs:complexType>
    385                     <xs:sequence>
    386                             <xs:element ref="ControlAreaSync"/>
    387                             <xs:element ref="DataArea"/>
    388                     </xs:sequence>
    389             </xs:complexType>
    390     </xs:element>
    391  </xs:schema>');
    392  begin
    393    if (dbms_xdb.existsResource(:schemaPath)) then
    394      dbms_xdb.deleteResource(:schemaPath);
    395    end if;
    396    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    397  end;
    398  /
    PL/SQL procedure successfully completed.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> insert into STUDENT_TABLE values (xmltype(
      2  '<com.welligent.Student.BasicStudent.Create>
      3     <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" me
    ssagePriority="1" messageType="Sync">
      4             <Sender>
      5                     <MessageId>
      6                             <SenderAppId>com.openii.SyncRouter</SenderAppId>
      7                             <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
      8                             <MessageSeq>53</MessageSeq>
      9                     </MessageId>
    10                     <Authentication>
    11                             <AuthUserId>Router</AuthUserId>
    12                     </Authentication>
    13             </Sender>
    14             <Datetime>
    15                     <Year>2001</Year>
    16                     <Month>3</Month>
    17                     <Day>23</Day>
    18                     <Hour>13</Hour>
    19                     <Minute>47</Minute>
    20                     <Second>30</Second>
    21                     <SubSecond>223</SubSecond>
    22                     <Timezone>6:00-GMT</Timezone>
    23             </Datetime>
    24     </ControlAreaSync>
    25     <DataArea>
    26             <NewData>
    27                     <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    28                             <StudentNumber>052589F201</StudentNumber>
    29                             <ExternalIdNumber>1234567890</ExternalIdNumber>
    30                             <StateIdNumber>123456</StateIdNumber>
    31                             <Name>
    32                                     <LastName>Lopez</LastName>
    33                                     <FirstName>Maria</FirstName>
    34                                     <MiddleName>S</MiddleName>
    35                             </Name>
    36                             <Gender>Female</Gender>
    37                             <BirthDate>
    38                                     <Month>1</Month>
    39                                     <Day>1</Day>
    40                                     <Year>1995</Year>
    41                             </BirthDate>
    42                             <Race>Hispanic</Race>
    43                             <Ethnicity>Hispanic</Ethnicity>
    44                             <PrimaryLanguage>English</PrimaryLanguage>
    45                             <HouseholdLanguage>Spanish</HouseholdLanguage>
    46                             <Address>
    47                                     <Street>123 Any Street</Street>
    48                                     <ApartmentNumber>12-D</ApartmentNumber>
    49                                     <City>Los Angeles</City>
    50                                     <County>Los Angeles</County>
    51                                     <State>CA</State>
    52                                     <ZipCode>90071</ZipCode>
    53                             </Address>
    54                     </BasicStudent>
    55             </NewData>
    56     </DataArea>
    57  </com.welligent.Student.BasicStudent.Create>'))
    58  /
    1 row created.
    SQL>
    SQL>
    SQL>

  • LPX-00601: Invalid token in: err while trying to read data from xml

    Hey ,
    While trying to read data from xml i got err:
    LPX-00601: Invalid token in: 'path'
    the proc. i'm using to read data from the xml is:
    procedure read_xml_file_test (in_filename in varchar2)
    is
    my_dir  varchar2(20) := 'XML_DIR;
      cur_emp2 number:=0;
      l_bfile   BFILE;
      l_clob    CLOB;
      l_parser  dbms_xmlparser.Parser;
      l_doc     dbms_xmldom.DOMDocument;
      l_nl      dbms_xmldom.DOMNodeList;
      l_nl2    dbms_xmldom.DOMNodeList;
      l_n       dbms_xmldom.DOMNode; 
      l_n2     dbms_xmldom.DOMNode;
      l_temp    VARCHAR2(1000);
    v_errors        internet_clients.errors%type; 
    src_csid       NUMBER := NLS_CHARSET_ID('UTF8'); 
    dest_offset    INTEGER := 1;
    src_offset     INTEGER := 1;
    lang_context   INTEGER := dbms_lob.default_lang_ctx;
    warning        INTEGER;
    v_count       number := 0;   --total records
    v_count_s      number := 0;   -- sucsess record
    v_count_f      number := 0;   -- failed record
    v_flag varchar2(1);
    v_char2 varchar2(1);
    v_l1 VARCHAR2(255);
    v_l2 VARCHAR2(255);
    v_l3 VARCHAR2(255);
    v_l4 VARCHAR2(255);
    v_l6 VARCHAR2(255);
    BEGIN
      l_bfile := BFileName(my_dir, in_filename);
      dbms_lob.createtemporary(l_clob, cache=>FALSE);
      dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
      dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile), dest_offset,src_offset, src_csid, lang_context, warning);                        
      dbms_lob.close(l_bfile);
      -- make sure implicit date conversions are performed correctly
      dbms_session.set_nls('NLS_DATE_FORMAT','''DD/MM/RR HH24:MI:SS''');   
      -- Create a parser.
      l_parser := dbms_xmlparser.newParser;
      -- Parse the document and create a new DOM document.
        dbms_xmlparser.parseClob(l_parser, l_clob);
        l_doc := dbms_xmlparser.getDocument(l_parser);
      -- Free resources associated with the CLOB and Parser now they are no longer needed.
      dbms_lob.freetemporary(l_clob);
      dbms_xmlparser.freeParser(l_parser);  
      -- Get a list of all the  nodes in the document using the XPATH syntax.
      l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'soap:Envelope/soap:Body/GetFieldsNameResponse/GetFieldsNameResult/diffgr:diffgram/DataSet_FRM_GANERIC_PROP/FRM_GANERIC_PROP');
      -- Loop through the list and create a new record in a tble collection
      -- for each  record.
      FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
       l_n := dbms_xmldom.item(l_nl, cur_emp);
       cur_emp2:=0;
       loop
         v_count := v_count + 1;
         begin
        -- Use XPATH syntax to assign values to he elements of the collection.
        dbms_xslprocessor.valueOf(l_n,'L1/text()',v_l1);
        dbms_xslprocessor.valueOf(l_n,'L2/text()',v_l2);
        dbms_xslprocessor.valueOf(l_n,'L3/text()',v_l3);
        dbms_xslprocessor.valueOf(l_n,'L4/text()',v_l4);
        dbms_xslprocessor.valueOf(l_n,'L6/text()',v_l6);
            exception
      when others then 
      null;
      end;
    exit when cur_emp2=dbms_xmldom.getLength(l_nl2);
      END LOOP;
      end loop;
      -- Free any resources associated with the document now it
      -- is no longer needed.
      dbms_xmldom.freeDocument(l_doc);
      --remove file to another directory   
          --COMMIT;  -- do not use the commit if you want to run this proc. from within the search_dir_list proc , because it execute a select from tmp table dir_list which contain a "on commit delete rows"  clause.    
      /*EXCEPTION
      /*WHEN OTHERS THEN
       dbms_lob.freetemporary(l_clob);
        dbms_xmlparser.freeParser(l_parser);
       dbms_xmldom.freeDocument(l_doc);
        null;
        ROLLBACK; */
    END;While trying to execute this i got:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: 'soap:Envelope/soap:Body/GetFieldsNameResponse/GetFieldsNameResult/diffgr:diffgram/DataSet_FRM_GANERIC_PROP/FRM_GANERIC_PROP'
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 939
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 967
    ORA-06512: at "MARKET.READ_XML_FILE_TEST", line 51
    ORA-06512: at line 1
    i guess i mised somthing at the line
    l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'soap:Envelope/soap:Body/GetFieldsNameResponse/GetFieldsNameResult/diffgr:diffgram/DataSet_FRM_GANERIC_PROP/FRM_GANERIC_PROP');i attached here part of my xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <soap:Body>
    - <GetFieldsNameResponse xmlns="http://tempuri.org/">
    - <GetFieldsNameResult>
    - <xs:schema id="DataSet_FRM_GANERIC_PROP" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    - <xs:element name="DataSet_FRM_GANERIC_PROP" msdata:IsDataSet="true" msdata:Locale="he-IL">
    - <xs:complexType>
    - <xs:choice minOccurs="0" maxOccurs="unbounded">
    - <xs:element name="FRM_GANERIC_PROP">
    - <xs:complexType>
    - <xs:sequence>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:choice>
      </xs:complexType>
      </xs:element>
      </xs:schema>
    - <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
    - <DataSet_FRM_GANERIC_PROP xmlns="">
    - <FRM_GANERIC_PROP diffgr:id="FRM_GANERIC_PROP1" msdata:rowOrder="0">
      <L1>val1</L1>
      <L2>val2</L2>
      <L3>val3</L3>
      <L4>val4</L4>
      <L6>val6</L6>
      </FRM_GANERIC_PROP>
      </DataSet_FRM_GANERIC_PROP>
      </diffgr:diffgram>
      </GetFieldsNameResult>
      </GetFieldsNameResponse>
      </soap:Body>
      </soap:Envelope>I Guess it somthing that have to do with node definition ,
    but i have tried so many combinations and none ot those worked for me.
    i'm deeply stuck here.
    What do i miss here?
    THANKS yair
    Edited by: yair_k on 02:30 14/10/2010

    Hey , after got a lot of success with the xml reading part , i wonder if you
    can help me with a problem while trying to reading that xml from a web service.
    i use a procedure as followes:
    FUNCTION read_from_web_service(in_username in varchar2 , in_password in varchar2)
      RETURN CHAR
    AS
      l_service          UTL_DBWS.service;
      l_call             UTL_DBWS.call;
      l_a_ns                     VARCHAR2(32767);
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in       SYS.XMLTYPE;
      l_xmltype_out      SYS.XMLTYPE;
      l_return           VARCHAR2(32767);
    BEGIN
      l_wsdl_url        := 'http://www.company.com/publisherService/ServiceGetpublisherTable.asmx?wsdl';
      l_namespace       := 'http://tempuri.org/';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'ServiceGetpublisherTable');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'ServiceGetpublisherTableSoap');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'GetFieldsName');
      l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
      l_xmltype_in := SYS.XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <GetFieldsName xmlns="' || l_namespace || '">
        <user>' || in_username || '</user>
        <password>'|| in_password || '</password>
        </GetFieldsName>');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
                                       request     => l_xmltype_in);
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
      l_return := l_xmltype_out.extract('//GetFieldsName/text()').getstringVal();
       dbms_output.put_line(l_return);     
      RETURN l_return;
    END;but when i run it i got message:
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: Server did not recognize the value of HTTP Header SOAPAction: .
    regarding the line:
    l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
    request => l_xmltype_in);
    So , i deeply stuck here!
    my web service description is:
      <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
    - <s:element name="GetFieldsName">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetFieldsNameResponse">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="GetFieldsNameResult">
    - <s:complexType>
    - <s:sequence>
      <s:element ref="s:schema" />
      <s:any />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetMSG_ByUser_Not_Readed">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetMSG_ByUser_Not_ReadedResponse">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="GetMSG_ByUser_Not_ReadedResult">
    - <s:complexType>
    - <s:sequence>
      <s:element ref="s:schema" />
      <s:any />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="SetMSG_ByUser_Not_Readed_As_Readed">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Rec_Id" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="SetMSG_ByUser_Not_Readed_As_ReadedResponse">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="1" maxOccurs="1" name="SetMSG_ByUser_Not_Readed_As_ReadedResult" type="s:boolean" />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:schema>
      </wsdl:types>
    - <wsdl:message name="GetFieldsNameSoapIn">
      <wsdl:part name="parameters" element="tns:GetFieldsName" />
      </wsdl:message>
    - <wsdl:message name="GetFieldsNameSoapOut">
      <wsdl:part name="parameters" element="tns:GetFieldsNameResponse" />
      </wsdl:message>
    - <wsdl:message name="GetMSG_ByUser_Not_ReadedSoapIn">
      <wsdl:part name="parameters" element="tns:GetMSG_ByUser_Not_Readed" />
      </wsdl:message>
    - <wsdl:message name="GetMSG_ByUser_Not_ReadedSoapOut">
      <wsdl:part name="parameters" element="tns:GetMSG_ByUser_Not_ReadedResponse" />
      </wsdl:message>
    - <wsdl:message name="SetMSG_ByUser_Not_Readed_As_ReadedSoapIn">
      <wsdl:part name="parameters" element="tns:SetMSG_ByUser_Not_Readed_As_Readed" />
      </wsdl:message>
    - <wsdl:message name="SetMSG_ByUser_Not_Readed_As_ReadedSoapOut">
      <wsdl:part name="parameters" element="tns:SetMSG_ByUser_Not_Readed_As_ReadedResponse" />
      </wsdl:message>
    - <wsdl:portType name="ServiceGetpublisherTableSoap">
    - <wsdl:operation name="GetFieldsName">
      <wsdl:input message="tns:GetFieldsNameSoapIn" />
      <wsdl:output message="tns:GetFieldsNameSoapOut" />
      </wsdl:operation>
    - <wsdl:operation name="GetMSG_ByUser_Not_Readed">
      <wsdl:input message="tns:GetMSG_ByUser_Not_ReadedSoapIn" />
      <wsdl:output message="tns:GetMSG_ByUser_Not_ReadedSoapOut" />
      </wsdl:operation>
    - <wsdl:operation name="SetMSG_ByUser_Not_Readed_As_Readed">
      <wsdl:input message="tns:SetMSG_ByUser_Not_Readed_As_ReadedSoapIn" />
      <wsdl:output message="tns:SetMSG_ByUser_Not_Readed_As_ReadedSoapOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="ServiceGetpublisherTableSoap" type="tns:ServiceGetpublisherTableSoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="GetFieldsName">
      <soap:operation soapAction="http://tempuri.org/GetFieldsName" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="GetMSG_ByUser_Not_Readed">
      <soap:operation soapAction="http://tempuri.org/GetMSG_ByUser_Not_Readed" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="SetMSG_ByUser_Not_Readed_As_Readed">
      <soap:operation soapAction="http://tempuri.org/SetMSG_ByUser_Not_Readed_As_Readed" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:binding name="ServiceGetpublisherTableSoap12" type="tns:ServiceGetpublisherTableSoap">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="GetFieldsName">
      <soap12:operation soapAction="http://tempuri.org/GetFieldsName" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="GetMSG_ByUser_Not_Readed">
      <soap12:operation soapAction="http://tempuri.org/GetMSG_ByUser_Not_Readed" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="SetMSG_ByUser_Not_Readed_As_Readed">
      <soap12:operation soapAction="http://tempuri.org/SetMSG_ByUser_Not_Readed_As_Readed" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="ServiceGetpublisherTable">
    - <wsdl:port name="ServiceGetpublisherTableSoap" binding="tns:ServiceGetpublisherTableSoap">
      <soap:address location="http://www.company.com/publisherService/ServiceGetpublisherTable.asmx" />
      </wsdl:port>
    - <wsdl:port name="ServiceGetpublisherTableSoap12" binding="tns:ServiceGetpublisherTableSoap12">
      <soap12:address location="http://www.company.com/publisherService/ServiceGetpublisherTable.asmx" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>also i have to mention that i have changed publisher references inside the code , and i also canot
    supply username and password , so i guess you canot test it. still i not shure if my definitions (namespace est.) inside my code defined correctly.
    hope you can help me with this.
    regards
    yair

  • Problem in XML Parsing via oracle procedure...

    Hi,
    I wrote one oracle procedure for xml parsing.
    I have one valid xml file which has "encode UTF-8". The XML file contains some comments also. While we are parsing the xml file at that time it is not parse successfully and also it is not giving any error. After the following line it is skip rest of the codes(lines).
    dbms_xmlparser.parseclob(l_parser, l_clob);
    At the end of the xml file there are some comments which is like "<!-- abc --> ".
    When I am changing the "encode UTF-8 to ISO-88596-1" & removing the comments which wrote on bottom of the file then its working fine, but the files which we are getting from the system is contains the encode UTF-8 and we don't want to preprocess on that xml files. Even if we will do that via shell script or perl script then it will be overhead to the system and in a single stroke our system will parse more than 5k xml files, so if we will do some preprocess on it, it will take some more time approx 1-2 minutes extra.
    So, If someone knows any solution of this problem, then please guide & help me on this.
    My xml file structure is as follows:-
    <?xml version="1.0" encoding="UTF-8"?>
    <mcd xmlns:HTML="http://www.w3.org/TR/REC-xml">
         <child>
              <child1>32.401 V5.5</child1>
              <child2>ZoneGate</child2>
         </child>
         <mc>
              <newid>
                   <id>12</id>
              </newid>
              <mindex>
                   <date>20111102180000</date>
                   <mt>abc1</mt>
                   <mt>abc2</mt>
                   <mvalue>
                        <r>val_1</r>
                        <r>val_2</r>
                   </mvalue>
              </mindex>
         </mc>
    </mcd>
    <!--
    ALARM STATUS
    morning 10
    afternoon 14
    evening 18
    night 22
    -->
    <!--
    PARAM:EID = 1
    PARAM:GId = 3
    PARAM:GSId = 0
    --!>
    And my oracle procedure is as follows:-
    create or replace procedure loadXMLtotable(dir_name IN varchar2, xmlfile IN varchar2) AS
    -- Defining the variables
    ecode               NUMBER;
    emesg           VARCHAR2(200);
    l_bfile      BFILE;
    l_clob      CLOB;
    l_dest_offset      INTEGER:=1;
    l_src_offset      INTEGER:=1;
    l_Char_set_id      NUMBER := NLS_CHARSET_ID('UTF8');
    l_lang_context      INTEGER := dbms_lob.default_lang_ctx;
    l_warning           INTEGER;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    l_nl1 dbms_xmldom.DOMNodeList;
    l_nl2 dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    node1 dbms_xmldom.DOMNode;
    colid integer ; -- column id used for identifying which column it belongs.
    l_xmltype XMLTYPE;
    sub_xmltype XMLTYPE;
    num_nodes number;
    l_index PLS_INTEGER;
    l_subIndex           PLS_INTEGER;
    starttime Date;
         temp_datatime VARCHAR(25);
    columnname varchar2(300);
    columnvalue varchar2(300);
    -- creating a Type which is a type of "test_hem" table RowType, which I created in SVN server
    TYPE tab_type IS TABLE OF test_hem%ROWTYPE;
    t_tab tab_type := tab_type();
    BEGIN
    -- Passing the xmlfile and virtual directory name which we gave at the time of directory creation
    l_bfile := BFileName('MY_FILES', xmlfile);
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
    --dbms_lob.loadFromFile(dest_lob => l_clob,
    -- src_lob => l_bfile,
    -- amount => dbms_lob.getLength(l_bfile));
    dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile),
    l_dest_offset, l_src_offset, l_Char_set_id, l_lang_context, l_warning);
    dbms_lob.close(l_bfile);
    -- make sure implicit date conversions are performed correctly
    dbms_session.set_nls('NLS_DATE_FORMAT','''YYYY-MON-DD HH24:MI:SS''');
    dbms_output.put_line('Date format set');
    -- Create a parser.
    l_parser := dbms_xmlparser.newParser;
    dbms_output.put_line('output 1');
    -- Parse the document and create a new DOM document.
    dbms_xmlparser.parseclob(l_parser, l_clob);
    dbms_output.put_line(' passed parsing');
    l_doc := dbms_xmlparser.getDocument(l_parser);
    dbms_output.put_line(' passed getdocument');
    -- Free resources associated with the CLOB and Parser now they are no longer needed.
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    -- Get a list of all the EMP nodes in the document using the XPATH syntax.
    l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/child');
    -- Loop through the list and create a new record in a tble collection
    FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl1, cur_sel);
    t_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    dbms_xslprocessor.valueOf(l_n,'child1/text()',t_tab(t_tab.last).country);
    -- putting the state and vendorname into the table rowtype
    dbms_xslprocessor.valueOf(l_n,'child2/text()',t_tab(t_tab.last).state);
    END LOOP;
    -- getting the version and putting into the table rowtype
    l_n := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(l_doc),'//mcd/mc/newid/id');
    dbms_xslprocessor.valueOf(l_n,'id/text()',t_tab(t_tab.last).id);
    -- selecting the nodes whose starting tag is "mindex"
    l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/mc/mindex');
    -- checking the total number of nodes whose starting through "mi"
    num_nodes := dbms_xmldom.getLength(l_nl1);
    l_index := 1;
    -- For loop to iterate the nodes.
    FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
    -- whole current node is selected and storing into the node1 variable
    node1 := dbms_xmldom.item(l_nl1, cur_sel);
    -- setting the xmltype as AL32UTF8
    l_xmltype := xmltype(l_bfile, nls_charset_id('AL32UTF8'));
    -- if selecting parent node containing the mt child node then only proceed else skip that parent node.
    IF (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r') > 0) Then
    -- fetch the datatime, convert it into to_date format and store it into table rowtype
    temp_datatime := dbms_xslprocessor.valueOf(node1, 'date/text()');
    t_tab(t_tab.last).data_time := to_char(to_date(temp_datatime, 'YYYYMmcDHH24MISS'));
    l_subIndex := 1;
                                  while (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt[' || l_subIndex || ']') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r['|| l_subIndex || ']') > 0 ) LOOP
                                  -- getting mt and corresponging mvalue/r values
    dbms_xslprocessor.valueOf(node1,'mt[' || l_subIndex || ']/text()',columnname);
    dbms_xslprocessor.valueOf(node1,'mvalue/r[' || l_subIndex || ']/text()',columnvalue);
    l_subIndex := l_subIndex + 1;
    -- getting the column to which this mapping belongs.
    select columnid into colid from abc_table where columnname=name;
    CASE colid
    WHEN 1 THEN t_tab(t_tab.last).col1 := columnvalue;
                             WHEN 2 THEN t_tab(t_tab.last).col2 := columnvalue;
                             WHEN 3 THEN t_tab(t_tab.last).col3 := columnvalue;
    ELSE dbms_output.put_line('No column mapping for counter ' || columnname) ;
    END CASE; -- end of case statement.
    END LOOP;
    -- Insert data into the real table from the table collection.
    FORALL i IN t_tab.first .. t_tab.last
    INSERT INTO test_hem VALUES t_tab(i);
    END IF;
    l_index := l_index + 1;
    COMMIT;
    END LOOP;
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    ecode := SQLCODE;
    emesg := SQLERRM;
    dbms_output.put_line(TO_CHAR(ecode) || '-' || emesg);
         dbms_lob.freetemporary(l_clob);
         dbms_xmlparser.freeParser(l_parser);
         dbms_xmldom.freeDocument(l_doc);
    END;

    Sorry Odie,
    I am new to this site as well as PL/SQL. I am giving additional details which you had mentioned in your last comments.
    our Oracle Database version is "10.2.0.4.0"
    The structure of target table Instrument_Details is as follows:
    Create table Instrument_Details (
    instrument_id          Integer  Primary Key,
    provider_name          Varchar2(32),
    version_number          Varchar2(32),
    location_id                  Integer,
    installation_date             Date,
    granularity                  Integer,
    time_out                  Integer );
    Note:- Here test_hem is alias of Instrument_details.
    Here instrument_id is a primary key.
    provider_name contains the child2 xml tag value.
    version_number contains the child1 xml tag value.
    location_id contains the newid/id value which is map to other table which fetching the location name corresponding to the location_id.
    installation_date contains the date xml tag value.
    Now we have created one mapping tables where we mapped the xml tag values "mt" with table column name means "abc1 = granularity", "abc2 = time_out" in that table.
    these table column value are written under mvalue xml tag.
    _Our Database Character set is_:-
    NLS_CHARACTERSET WE8ISO8859P1
    Now as you suggest me to format your code. I am writing the xml code and procedure code again.
    My xml file structure is as follows:-
    <?xml version="1.0" encoding="UTF-8"?>
    <mcd xmlns:HTML="http://www.w3.org/TR/REC-xml">
      <child>
          <child1>32.401 V5.5</child1>
          <child2>ZoneGate</child2>
      </child>
      <mc>
          <newid>
               <id>12</id>
          </newid>
      <mindex>
           <date>20111102180000</date>
           <mt>abc1</mt>
           <mt>abc2</mt>
           <mvalue>
                 <r>val_1</r>   -- here val_1 and val_2 are numeric values
                 <r>val_2</r>
            </mvalue>
      </mindex>
      </mc>
    </mcd>
    <!--
    ALARM STATUS
    morning 10
    afternoon 14
    evening 18
    night 22
    -->
    <!--
    PARAM:EID = 1
    PARAM:GId = 3
    PARAM:GSId = 0
    --!> And my oracle procedure is as follows:-
    create or replace procedure loadXMLtotable(dir_name IN varchar2, xmlfile IN varchar2) AS
    -- Defining the variables
    ecode NUMBER;
    emesg VARCHAR2(200);
    l_bfile BFILE;
    l_clob CLOB;
    l_dest_offset INTEGER:=1;
    l_src_offset INTEGER:=1;
    l_Char_set_id NUMBER := NLS_CHARSET_ID('UTF8');
    l_lang_context INTEGER := dbms_lob.default_lang_ctx;
    l_warning INTEGER;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    l_nl1 dbms_xmldom.DOMNodeList;
    l_nl2 dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    node1 dbms_xmldom.DOMNode;
    colid integer ; -- column id used for identifying which column it belongs.
    l_xmltype XMLTYPE;
    sub_xmltype XMLTYPE;
    num_nodes number;
    l_index PLS_INTEGER;
    l_subIndex PLS_INTEGER;
    starttime Date;
    temp_datatime VARCHAR(25);
    columnname varchar2(300);
    columnvalue varchar2(300);
    -- creating a Type which is a type of "Instrument_Details" table RowType, which I created in SVN server
    TYPE tab_type IS TABLE OF Instrument_Details%ROWTYPE;
    t_tab tab_type := tab_type();
    BEGIN
    -- Passing the xmlfile and virtual directory name which we gave at the time of directory creation
    l_bfile := BFileName('MY_FILES', xmlfile);
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
    --dbms_lob.loadFromFile(dest_lob => l_clob,
    -- src_lob => l_bfile,
    -- amount => dbms_lob.getLength(l_bfile));
    dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile),
    l_dest_offset, l_src_offset, l_Char_set_id, l_lang_context, l_warning);
    dbms_lob.close(l_bfile);
    -- make sure implicit date conversions are performed correctly
    dbms_session.set_nls('NLS_DATE_FORMAT','''YYYY-MON-DD HH24:MI:SS''');
    dbms_output.put_line('Date format set');
    -- Create a parser.
    l_parser := dbms_xmlparser.newParser;
    dbms_output.put_line('output 1');
    -- Parse the document and create a new DOM document.
    dbms_xmlparser.parseclob(l_parser, l_clob);
    *-- Below lines are skipping....*
    dbms_output.put_line(' passed parsing');
    l_doc := dbms_xmlparser.getDocument(l_parser);
    dbms_output.put_line(' passed getdocument');
    -- Free resources associated with the CLOB and Parser now they are no longer needed.
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    -- Get a list of all the EMP nodes in the document using the XPATH syntax.
    l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/child');
    -- Loop through the list and create a new record in a tble collection
    FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl1, cur_sel);
    t_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    dbms_xslprocessor.valueOf(l_n,'child1/text()',t_tab(t_tab.last).country);
    -- putting the state and vendorname into the table rowtype
       dbms_xslprocessor.valueOf(l_n,'child2/text()',t_tab(t_tab.last).state);
    END LOOP;
    -- getting the version and putting into the table rowtype
       l_n := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(l_doc),'//mcd/mc/newid/id');
      dbms_xslprocessor.valueOf(l_n,'id/text()',t_tab(t_tab.last).id);
    -- selecting the nodes whose starting tag is "mindex"
      l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/mc/mindex');
    -- checking the total number of nodes whose starting through "mi"
      num_nodes := dbms_xmldom.getLength(l_nl1);
    l_index := 1;
      -- For loop to iterate the nodes.
      FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
      -- whole current node is selected and storing into the node1 variable
      node1 := dbms_xmldom.item(l_nl1, cur_sel);
      -- setting the xmltype as AL32UTF8
       l_xmltype := xmltype(l_bfile, nls_charset_id('AL32UTF8'));
      -- if selecting parent node containing the mt child node then only proceed else skip that parent node.
        IF (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r') > 0) Then
      -- fetch the datatime, convert it into to_date format and store it into table rowtype
        temp_datatime := dbms_xslprocessor.valueOf(node1, 'date/text()');
        t_tab(t_tab.last).data_time := to_char(to_date(temp_datatime, 'YYYYMmcDHH24MISS'));
        l_subIndex := 1;
       while (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt[' || l_subIndex || ']') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r['|| l_subIndex || ']') > 0 ) LOOP
    -- getting mt and corresponging mvalue/r values
       dbms_xslprocessor.valueOf(node1,'mt[' || l_subIndex || ']/text()',columnname);
      dbms_xslprocessor.valueOf(node1,'mvalue/r[' || l_subIndex || ']/text()',columnvalue);
      l_subIndex := l_subIndex + 1;
      -- getting the column to which this mapping belongs.
      select columnid into colid from abc_table where columnname=name;
      CASE colid
      WHEN 1 THEN t_tab(t_tab.last).col1 := columnvalue;
      WHEN 2 THEN t_tab(t_tab.last).col2 := columnvalue;
      WHEN 3 THEN t_tab(t_tab.last).col3 := columnvalue;
          ELSE dbms_output.put_line('No column mapping for counter ' || columnname) ;
      END CASE; -- end of case statement.
      END LOOP;
    -- Insert data into the real table from the table collection.
      FORALL i IN t_tab.first .. t_tab.last
        INSERT INTO test_hem VALUES t_tab(i);
      END IF;
      l_index := l_index + 1;
    COMMIT;
    END LOOP;
    commit;
    EXCEPTION
      WHEN OTHERS THEN
      ecode := SQLCODE;
      emesg := SQLERRM;
      dbms_output.put_line(TO_CHAR(ecode) || '-' || emesg);
      dbms_lob.freetemporary(l_clob);
      dbms_xmlparser.freeParser(l_parser);
      dbms_xmldom.freeDocument(l_doc);
    END;Thanks in advance for your help...

  • Parse a xml file from clob column.

    Dear,
    i have been suffreing a problem about xml.
    i have a table with two columns, one is bfile data type other is clob data type. A xml data is stored into both cloumns
    as clob and bfile. My xml data format is correct.
    when i took xml data from bfile column, then dbms_xmlparser.parseClob successfully parse my xml data.
    Code below:
    =======================================
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.loadFromFile(dest_lob => l_clob,
    src_lob => l_bfile,
    amount => dbms_lob.getLength(l_bfile));
    l_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(l_parser, l_clob); ========================================
    But when i took xml data form clob clumn directly, then dbms_xmlparser.parseClob parse failed and go to exception.
    Code below:
    ====================================================================
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    select xml_cfile,xml_bfile                    
    into l_clob ,l_bfile
    from xml_load_in
    l_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(l_parser, l_clob); --failed parse    
    ====================================================================
    declare
    l_bfile BFILE;
    l_clob CLOB;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    begin
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    select xml_cfile,xml_bfile
    into l_clob ,l_bfile
    from xml_load_in
    l_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(l_parser, l_clob);
    l_doc := dbms_xmlparser.getDocument(l_parser);
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    exception
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    dbms_xmldom.freeDocument(l_doc);
    End;
    Example:
    ======--File_name := Outward.xml;
    CREATE OR REPLACE DIRECTORY
    MY_INWARD AS
    'D:\PBM\Inward\';
    CREATE TABLE XML_LOAD_IN
    ( XML_CFILE CLOB,
    XML_BFILE BFILE
    INSERT INTO XML_LOAD_IN ( XML_CFILE, XML_BFILE )
    VALUES (
    '<?xml version="1.0" encoding="UTF-8"?>
    <BACPSInterface>
    <OCE>
    <EHR>
    <StandardLevel>03</StandardLevel>
    <TestFiledIndicator>T</TestFiledIndicator>
    <ImmediateDestRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImmediateDestRoutingNumber>
    <ImmediateOriginRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImmediateOriginRoutingNumber>
    <FileCreationDate>20090714</FileCreationDate>
    <FileCreationTime>1047</FileCreationTime>
    <ResendIndicator>N</ResendIndicator>
    <ECESettlementDate>20090714</ECESettlementDate>
    <ECESessionTime>1047</ECESessionTime>
    <ECESettlementTime>1047</ECESettlementTime>
    <ECEtype>01</ECEtype>
    <CountryCode>BD</CountryCode>
    </EHR>
    <Collection>
    <CHR>
    <CashLetterBusinessDate>20090714</CashLetterBusinessDate>
    <CashLetterCreationDate>20090714</CashLetterCreationDate>
    <CashLetterCreationTime>1047</CashLetterCreationTime>
    <CashLetterRecordTypeInd>I</CashLetterRecordTypeInd>
    <CashLetterDocTypeIndicator>G</CashLetterDocTypeIndicator>
    <CashLetterID>1</CashLetterID>
    <OriginatorContactName>Bank Asia</OriginatorContactName>
    <OriginatorContactPhoneNumber>XXX</OriginatorContactPhoneNumber>
    </CHR>
    <ForwardBundle>
    <BHR>
    <CollectionTypeIndicator>I</CollectionTypeIndicator>
    <DestRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </DestRoutingNumber>
    <ECEInstitutionRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ECEInstitutionRoutingNumber>
    <BundleBusinessDate>20090714</BundleBusinessDate>
    <BundleCreationDate>20090714</BundleCreationDate>
    <BundleID>1</BundleID>
    <ReturnLocationRoutingNumber>070127538</ReturnLocationRoutingNumber>
    </BHR>
    <CDR>
    <CDR num="1">
    <ECESettlementDate>20090714</ECESettlementDate>
    <ECESessionTime>1047</ECESessionTime>
    <ECESettlementTime>1047</ECESettlementTime>
    <ECEItemType>N</ECEItemType>
    <IssuingBranchRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </IssuingBranchRoutingNumber>
    <AccountNumber>0000334008221</AccountNumber>
    <ChequeSequenceNumber>1601735</ChequeSequenceNumber>
    <ItemAmount>500</ItemAmount>
    <ECEInstitutionItemSequencNum>0701275380000001</ECEInstitutionItemSequencNum>
    <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
    <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
    <MICRValidIndicator>1</MICRValidIndicator>
    <BOFDIndicator>Y</BOFDIndicator>
    <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
    <CorrectionIndicator>0</CorrectionIndicator>
    <RepresentmentIndicator>0</RepresentmentIndicator>
    <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
    </CDR>
    <CDR num="2">
    <ECESettlementDate>20090714</ECESettlementDate>
    <ECESessionTime>1047</ECESessionTime>
    <ECESettlementTime>1047</ECESettlementTime>
    <ECEItemType>N</ECEItemType>
    <IssuingBranchRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </IssuingBranchRoutingNumber>
    <AccountNumber>0000345682256</AccountNumber>
    <ChequeSequenceNumber>1234567</ChequeSequenceNumber>
    <ItemAmount>1000</ItemAmount>
    <ECEInstitutionItemSequencNum>0701275380000002</ECEInstitutionItemSequencNum>
    <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
    <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
    <MICRValidIndicator>1</MICRValidIndicator>
    <BOFDIndicator>Y</BOFDIndicator>
    <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
    <CorrectionIndicator>0</CorrectionIndicator>
    <RepresentmentIndicator>0</RepresentmentIndicator>
    <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
    </CDR>
    </CDR>
    <CDA>
    <CDA num="1">
    <AddendumRecordNumber>1</AddendumRecordNumber>
    <BOFDRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>75</DistrictCode>
    <BranchCode>12</BranchCode>
    <CheckDigit>8</CheckDigit>
    </BOFDRoutingNumber>
    <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
    <BOFDDepositAccountNumber>0000334008221</BOFDDepositAccountNumber>
    <BOFDDepositBranch>753</BOFDDepositBranch>
    <PayeeName>XXX</PayeeName>
    <TruncationIndicator>Y</TruncationIndicator>
    <BOFDConversionIndicator>2</BOFDConversionIndicator>
    <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
    </CDA>
    <CDA num="2">
    <AddendumRecordNumber>1</AddendumRecordNumber>
    <BOFDRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>75</DistrictCode>
    <BranchCode>12</BranchCode>
    <CheckDigit>8</CheckDigit>
    </BOFDRoutingNumber>
    <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
    <BOFDDepositAccountNumber>0000345682256</BOFDDepositAccountNumber>
    <BOFDDepositBranch>753</BOFDDepositBranch>
    <PayeeName>XXX</PayeeName>
    <TruncationIndicator>Y</TruncationIndicator>
    <BOFDConversionIndicator>2</BOFDConversionIndicator>
    <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
    </CDA>
    </CDA>
    <CDC>
    <CDC num="1">
    <AddendumCRecordNumber>1</AddendumCRecordNumber>
    <EndorsingBankRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </EndorsingBankRountingNumber>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankItemSequenceNum>0701275380000001</EndorsingBankItemSequenceNum>
    <TruncationIndicator>Y</TruncationIndicator>
    <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
    <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
    </CDC>
    <CDC num="2">
    <AddendumCRecordNumber>1</AddendumCRecordNumber>
    <EndorsingBankRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </EndorsingBankRountingNumber>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankItemSequenceNum>0701275380000002</EndorsingBankItemSequenceNum>
    <TruncationIndicator>Y</TruncationIndicator>
    <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
    <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
    </CDC>
    </CDC>
    <IVD>
    <IVD num="1">
    <ImageIndicator>1</ImageIndicator>
    <ImageCreatorRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImageCreatorRountingNumber>
    <ImageCreatorDate>20090714</ImageCreatorDate>
    <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
    <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
    <ViewSideIndicator>0</ViewSideIndicator>
    <ViewDescriptor>0</ViewDescriptor>
    <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
    <DigitalSignatureMethod>0</DigitalSignatureMethod>
    <SecurityKeySize>12235</SecurityKeySize>
    <ImageRecreateIndicator>0</ImageRecreateIndicator>
    </IVD>
    <IVD num="2">
    <ImageIndicator>1</ImageIndicator>
    <ImageCreatorRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImageCreatorRountingNumber>
    <ImageCreatorDate>20090714</ImageCreatorDate>
    <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
    <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
    <ViewSideIndicator>0</ViewSideIndicator>
    <ViewDescriptor>0</ViewDescriptor>
    <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
    <DigitalSignatureMethod>0</DigitalSignatureMethod>
    <SecurityKeySize>12235</SecurityKeySize>
    <ImageRecreateIndicator>0</ImageRecreateIndicator>
    </IVD>
    </IVD>
    <IVT>
    <IVT num="1">
    <ECEInstitutionRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ECEInstitutionRoutingNumber>
    <BundleBusinessDate>20090714</BundleBusinessDate>
    <CycleNumber>0</CycleNumber>
    <ECEInstitutionItemSeqNumber>0701275380000001</ECEInstitutionItemSeqNumber>
    <ClippingOrigin>
    <Origin>0</Origin>
    <CoordinateH1>0000</CoordinateH1>
    <CoordinateH2>0000</CoordinateH2>
    <CoordinateV1>0000</CoordinateV1>
    <CoordinateV2>0000</CoordinateV2>
    </ClippingOrigin>
    <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
    <LengthofDigitalSignature>0</LengthofDigitalSignature>
    <LengthofImageData>1</LengthofImageData>
    <OffsetToImageData>01001000</OffsetToImageData>
    </IVT>
    <IVT num="2">
    <ECEInstitutionRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ECEInstitutionRoutingNumber>
    <BundleBusinessDate>20090714</BundleBusinessDate>
    <CycleNumber>0</CycleNumber>
    <ECEInstitutionItemSeqNumber>0701275380000002</ECEInstitutionItemSeqNumber>
    <ClippingOrigin>
    <Origin>0</Origin>
    <CoordinateH1>0000</CoordinateH1>
    <CoordinateH2>0000</CoordinateH2>
    <CoordinateV1>0000</CoordinateV1>
    <CoordinateV2>0000</CoordinateV2>
    </ClippingOrigin>
    <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
    <LengthofDigitalSignature>0</LengthofDigitalSignature>
    <LengthofImageData>1</LengthofImageData>
    <OffsetToImageData>01001000</OffsetToImageData>
    </IVT>
    </IVT>
    <IVA>
    <IVA num="1">
    <GlobalImageQuality>0</GlobalImageQuality>
    <GlobalImageUsability>1</GlobalImageUsability>
    <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
    </IVA>
    <IVA num="2">
    <GlobalImageQuality>0</GlobalImageQuality>
    <GlobalImageUsability>1</GlobalImageUsability>
    <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
    </IVA>
    </IVA>
    <BCR>
    <ItemsWithinBundleCount>2</ItemsWithinBundleCount>
    <BundleTotalAmount>1500</BundleTotalAmount>
    <MICRValidTotalAmount>1500</MICRValidTotalAmount>
    </BCR>
    </ForwardBundle>
    <CCR>
    <BundleCount>1</BundleCount>
    <ItemWithinCashLetterCount>2</ItemWithinCashLetterCount>
    <CashLetterTotalAmount>1500</CashLetterTotalAmount>
    <ImagesWithinCashLetterCount>2</ImagesWithinCashLetterCount>
    <ECEInstitutionName>Bank Asia</ECEInstitutionName>
    <SettlementDate>20090714</SettlementDate>
    </CCR>
    </Collection>
    <ECR>
    <CashLetterCount>1</CashLetterCount>
    <TotalRecordCount>2</TotalRecordCount>
    <TotalItemCount>2</TotalItemCount>
    <FileTotalAmount>1500</FileTotalAmount>
    <ImmediateOriginContactName>Bank Asia</ImmediateOriginContactName>
    <ImmediateOriginContactNumber>XXX</ImmediateOriginContactNumber>
    </ECR>
    </OCE>
    </BACPSInterface>'
    , BFILENAME('MY_INWARD','Outward.xml'));
    COMMIT;

    What version of Oracle (4 digits) and what is the error?
    This runs without error on 10.2.0.4 (though you can go directly from a CLOB to a DOMDocument via dbms_xmldom)
    -- Created on 9/14/2009 by JH20567
    declare
      -- Local variables here
      l_clob   CLOB;
      l_parser dbms_xmlparser.Parser;
      l_doc    dbms_xmldom.DOMDocument;
    begin
      -- Test statements here
       l_clob := '<?xml version="1.0" encoding="UTF-8"?>
    <BACPSInterface>
       <OCE>
          <EHR>
             <StandardLevel>03</StandardLevel>
             <TestFiledIndicator>T</TestFiledIndicator>
             <ImmediateDestRoutingNumber>
                <BankCode>070</BankCode>
                <DistrictCode>12</DistrictCode>
                <BranchCode>75</BranchCode>
                <CheckDigit>8</CheckDigit>
             </ImmediateDestRoutingNumber>
             <ImmediateOriginRoutingNumber>
                <BankCode>070</BankCode>
                <DistrictCode>12</DistrictCode>
                <BranchCode>75</BranchCode>
                <CheckDigit>8</CheckDigit>
             </ImmediateOriginRoutingNumber>
             <FileCreationDate>20090714</FileCreationDate>
             <FileCreationTime>1047</FileCreationTime>
             <ResendIndicator>N</ResendIndicator>
             <ECESettlementDate>20090714</ECESettlementDate>
             <ECESessionTime>1047</ECESessionTime>
             <ECESettlementTime>1047</ECESettlementTime>
             <ECEtype>01</ECEtype>
             <CountryCode>BD</CountryCode>
          </EHR>
          <Collection>
             <CHR>
                <CashLetterBusinessDate>20090714</CashLetterBusinessDate>
                <CashLetterCreationDate>20090714</CashLetterCreationDate>
                <CashLetterCreationTime>1047</CashLetterCreationTime>
                <CashLetterRecordTypeInd>I</CashLetterRecordTypeInd>
                <CashLetterDocTypeIndicator>G</CashLetterDocTypeIndicator>
                <CashLetterID>1</CashLetterID>
                <OriginatorContactName>Bank Asia</OriginatorContactName>
                <OriginatorContactPhoneNumber>XXX</OriginatorContactPhoneNumber>
             </CHR>
             <ForwardBundle>
                <BHR>
                   <CollectionTypeIndicator>I</CollectionTypeIndicator>
                   <DestRoutingNumber>
                      <BankCode>070</BankCode>
                      <DistrictCode>12</DistrictCode>
                      <BranchCode>75</BranchCode>
                      <CheckDigit>8</CheckDigit>
                   </DestRoutingNumber>
                   <ECEInstitutionRoutingNumber>
                      <BankCode>070</BankCode>
                      <DistrictCode>12</DistrictCode>
                      <BranchCode>75</BranchCode>
                      <CheckDigit>8</CheckDigit>
                   </ECEInstitutionRoutingNumber>
                   <BundleBusinessDate>20090714</BundleBusinessDate>
                   <BundleCreationDate>20090714</BundleCreationDate>
                   <BundleID>1</BundleID>
                   <ReturnLocationRoutingNumber>070127538</ReturnLocationRoutingNumber>
                </BHR>
                <CDR>
                   <CDR num="1">
                      <ECESettlementDate>20090714</ECESettlementDate>
                      <ECESessionTime>1047</ECESessionTime>
                      <ECESettlementTime>1047</ECESettlementTime>
                      <ECEItemType>N</ECEItemType>
                      <IssuingBranchRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </IssuingBranchRoutingNumber>
                      <AccountNumber>0000334008221</AccountNumber>
                      <ChequeSequenceNumber>1601735</ChequeSequenceNumber>
                      <ItemAmount>500</ItemAmount>
                      <ECEInstitutionItemSequencNum>0701275380000001</ECEInstitutionItemSequencNum>
                      <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
                      <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
                      <MICRValidIndicator>1</MICRValidIndicator>
                      <BOFDIndicator>Y</BOFDIndicator>
                      <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
                      <CorrectionIndicator>0</CorrectionIndicator>
                      <RepresentmentIndicator>0</RepresentmentIndicator>
                      <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
                   </CDR>
                   <CDR num="2">
                      <ECESettlementDate>20090714</ECESettlementDate>
                      <ECESessionTime>1047</ECESessionTime>
                      <ECESettlementTime>1047</ECESettlementTime>
                      <ECEItemType>N</ECEItemType>
                      <IssuingBranchRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </IssuingBranchRoutingNumber>
                      <AccountNumber>0000345682256</AccountNumber>
                      <ChequeSequenceNumber>1234567</ChequeSequenceNumber>
                      <ItemAmount>1000</ItemAmount>
                      <ECEInstitutionItemSequencNum>0701275380000002</ECEInstitutionItemSequencNum>
                      <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
                      <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
                      <MICRValidIndicator>1</MICRValidIndicator>
                      <BOFDIndicator>Y</BOFDIndicator>
                      <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
                      <CorrectionIndicator>0</CorrectionIndicator>
                      <RepresentmentIndicator>0</RepresentmentIndicator>
                      <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
                   </CDR>
                </CDR>
                <CDA>
                   <CDA num="1">
                      <AddendumRecordNumber>1</AddendumRecordNumber>
                      <BOFDRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>75</DistrictCode>
                         <BranchCode>12</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </BOFDRoutingNumber>
                      <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
                      <BOFDDepositAccountNumber>0000334008221</BOFDDepositAccountNumber>
                      <BOFDDepositBranch>753</BOFDDepositBranch>
                      <PayeeName>XXX</PayeeName>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <BOFDConversionIndicator>2</BOFDConversionIndicator>
                      <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
                   </CDA>
                   <CDA num="2">
                      <AddendumRecordNumber>1</AddendumRecordNumber>
                      <BOFDRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>75</DistrictCode>
                         <BranchCode>12</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </BOFDRoutingNumber>
                      <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
                      <BOFDDepositAccountNumber>0000345682256</BOFDDepositAccountNumber>
                      <BOFDDepositBranch>753</BOFDDepositBranch>
                      <PayeeName>XXX</PayeeName>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <BOFDConversionIndicator>2</BOFDConversionIndicator>
                      <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
                   </CDA>
                </CDA>
                <CDC>
                   <CDC num="1">
                      <AddendumCRecordNumber>1</AddendumCRecordNumber>
                      <EndorsingBankRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </EndorsingBankRountingNumber>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankItemSequenceNum>0701275380000001</EndorsingBankItemSequenceNum>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
                      <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
                   </CDC>
                   <CDC num="2">
                      <AddendumCRecordNumber>1</AddendumCRecordNumber>
                      <EndorsingBankRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </EndorsingBankRountingNumber>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankItemSequenceNum>0701275380000002</EndorsingBankItemSequenceNum>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
                      <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
                   </CDC>
                </CDC>
                <IVD>
                   <IVD num="1">
                      <ImageIndicator>1</ImageIndicator>
                      <ImageCreatorRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ImageCreatorRountingNumber>
                      <ImageCreatorDate>20090714</ImageCreatorDate>
                      <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
                      <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
                      <ViewSideIndicator>0</ViewSideIndicator>
                      <ViewDescriptor>0</ViewDescriptor>
                      <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
                      <DigitalSignatureMethod>0</DigitalSignatureMethod>
                      <SecurityKeySize>12235</SecurityKeySize>
                      <ImageRecreateIndicator>0</ImageRecreateIndicator>
                   </IVD>
                   <IVD num="2">
                      <ImageIndicator>1</ImageIndicator>
                      <ImageCreatorRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ImageCreatorRountingNumber>
                      <ImageCreatorDate>20090714</ImageCreatorDate>
                      <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
                      <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
                      <ViewSideIndicator>0</ViewSideIndicator>
                      <ViewDescriptor>0</ViewDescriptor>
                      <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
                      <DigitalSignatureMethod>0</DigitalSignatureMethod>
                      <SecurityKeySize>12235</SecurityKeySize>
                      <ImageRecreateIndicator>0</ImageRecreateIndicator>
                   </IVD>
                </IVD>
                <IVT>
                   <IVT num="1">
                      <ECEInstitutionRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ECEInstitutionRoutingNumber>
                      <BundleBusinessDate>20090714</BundleBusinessDate>
                      <CycleNumber>0</CycleNumber>
                      <ECEInstitutionItemSeqNumber>0701275380000001</ECEInstitutionItemSeqNumber>
                      <ClippingOrigin>
                         <Origin>0</Origin>
                         <CoordinateH1>0000</CoordinateH1>
                         <CoordinateH2>0000</CoordinateH2>
                         <CoordinateV1>0000</CoordinateV1>
                         <CoordinateV2>0000</CoordinateV2>
                      </ClippingOrigin>
                      <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
                      <LengthofDigitalSignature>0</LengthofDigitalSignature>
                      <LengthofImageData>1</LengthofImageData>
                      <OffsetToImageData>01001000</OffsetToImageData>
                   </IVT>
                   <IVT num="2">
                      <ECEInstitutionRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ECEInstitutionRoutingNumber>
                      <BundleBusinessDate>20090714</BundleBusinessDate>
                      <CycleNumber>0</CycleNumber>
                      <ECEInstitutionItemSeqNumber>0701275380000002</ECEInstitutionItemSeqNumber>
                      <ClippingOrigin>
                         <Origin>0</Origin>
                         <CoordinateH1>0000</CoordinateH1>
                         <CoordinateH2>0000</CoordinateH2>
                         <CoordinateV1>0000</CoordinateV1>
                         <CoordinateV2>0000</CoordinateV2>
                      </ClippingOrigin>
                      <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
                      <LengthofDigitalSignature>0</LengthofDigitalSignature>
                      <LengthofImageData>1</LengthofImageData>
                      <OffsetToImageData>01001000</OffsetToImageData>
                   </IVT>
                </IVT>
                <IVA>
                   <IVA num="1">
                      <GlobalImageQuality>0</GlobalImageQuality>
                      <GlobalImageUsability>1</GlobalImageUsability>
                      <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
                   </IVA>
                   <IVA num="2">
                      <GlobalImageQuality>0</GlobalImageQuality>
                      <GlobalImageUsability>1</GlobalImageUsability>
                      <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
                   </IVA>
                </IVA>
                <BCR>
                   <ItemsWithinBundleCount>2</ItemsWithinBundleCount>
                   <BundleTotalAmount>1500</BundleTotalAmount>
                   <MICRValidTotalAmount>1500</MICRValidTotalAmount>
                </BCR>
             </ForwardBundle>
             <CCR>
                <BundleCount>1</BundleCount>
                <ItemWithinCashLetterCount>2</ItemWithinCashLetterCount>
                <CashLetterTotalAmount>1500</CashLetterTotalAmount>
                <ImagesWithinCashLetterCount>2</ImagesWithinCashLetterCount>
                <ECEInstitutionName>Bank Asia</ECEInstitutionName>
                <SettlementDate>20090714</SettlementDate>
             </CCR>
          </Collection>
          <ECR>
             <CashLetterCount>1</CashLetterCount>
             <TotalRecordCount>2</TotalRecordCount>
             <TotalItemCount>2</TotalItemCount>
             <FileTotalAmount>1500</FileTotalAmount>
                   <ImmediateOriginContactName>Bank Asia</ImmediateOriginContactName>
                   <ImmediateOriginContactNumber>XXX</ImmediateOriginContactNumber>
              </ECR>
         </OCE>
    </BACPSInterface>';
       l_parser := dbms_xmlparser.newParser;
       dbms_xmlparser.parseClob(l_parser, l_clob);
       l_doc := dbms_xmlparser.getDocument(l_parser);
       dbms_lob.freetemporary(l_clob);
       dbms_xmlparser.freeParser(l_parser); 
       dbms_xmldom.freeDocument(l_doc);
    end;

Maybe you are looking for

  • Display image in HTML region???

    I made blank page, and on that page I made html region. Then I go to the Shared Components>Images Create and Upload the image DMD.gif to the Application 106, that the Application with which I'm working.I trying to put that image to the html region. I

  • Problem in Forms...!!!

    Hi All, i have created a form, and uploaded to respective directory. From apps menu it is calling the form and working fine, but the foreground colour is black... So if i highlighted the field then i can see the field value; otherwise full text field

  • Two apps have disappeard

    I just got my new iPhone 3GS. I downloaded two free applications: WootWatch and BBCReader. Both worked fine. At some point (I think after I synced with iTunes) they simply disappeared. I have tried turning the phone off, and turning it back on. Still

  • Relocation of Services

    I recently had FiOS installed in my home about 3 months ago. I am going to be moving soon into a rental propierty. I have discussd getting FiOS installed on the new property with the landlord and he says that it depends where and how much wiring is g

  • Oracle Connection Problems.

    I am on Business Objects Crystal Decisions. Trying to run a Crystal XI R2 report through InfoView. It works on Crystal, when I try to run it on InfoView, I get the following error: loupap04.reportjobserver Error in File D:\Program Files\Business Obje