Identifying the xml file

String contextName = request.getContextPath();
String imageDir = contextName + "/resources/images";
String xmlName = "Resources.xml";
String contextDir = contextName + "/resources/xml/" + xmlName;
String userName = (String) session.getAttribute("UserName");
String indname="";
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (new File(contextDir));
i have a xml file in resources folder.when iam trying to acces the iamges folder files iam getting.
but when iam trying to access the xml file and pass it to File method of xml..its giving error..
C:\test\resources\xml\Resources.xml (The system cannot find the path specified)
regards,

Does the file:
C:\test\resources\xml\Resources.xml
exists? Remember that this is case sensitive.
If that is the incorrect path, try doing something like:
String xmlFileName = getContext().getRealPath("/resources/xml/Resources.xml");

Similar Messages

  • Issue in reading the XML file

    Hi Gurus,
    I am dier need of one of the xml issue which I am facing right now.
    I am reading one of the xml file which is like this
    <?xml version="1.0" encoding="UTF-8" ?>
    - <GEBIZ_ORDER xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <HEADER>
      <MINISTRY_CODE>RPO</MINISTRY_CODE>
      <DEPARTMENT_CODE>000</DEPARTMENT_CODE>
      <ORDER_CODE>RPO000EPO11000953</ORDER_CODE>
      <EXTERNAL_SYSTEM_CODE>E</EXTERNAL_SYSTEM_CODE>
      <AMENDMENT_NUMBER>0</AMENDMENT_NUMBER>
      <VARIATION_NUMBER>0</VARIATION_NUMBER>
      <DESCRIPTION>Purchase Order for Air tickets for SOT to Korea (from 17th - 26th Sep 2011) off PC(RPO000ECN11000100)for SAS</DESCRIPTION>
      <STATUS>NEW</STATUS>
      <STATUS_DATE>2011-07-08T16:57:39</STATUS_DATE>
      <PAYMENT_TERMS xsi:nil="true" />
      <BILL_TO>One-Stop Centre, 9 Woodlands Avenue 9, S(738964)</BILL_TO>
      <JUSTIFICATION>Please refer to attached approval email.</JUSTIFICATION>
      <CREATE_TIMESTAMP>2011-07-08T16:57:39</CREATE_TIMESTAMP>
      <TERMINATE_REASON xsi:nil="true" />
      <TERMINATE_TIMESTAMP xsi:nil="true" />
      <ORDER_TYPE>1</ORDER_TYPE>
    - <FINANCIAL_SYSTEM>
      <SUB_BUSINESS_UNIT>RPS01</SUB_BUSINESS_UNIT>
      </FINANCIAL_SYSTEM>
    - <SUPPLIER>
      <CODE>200003048E</CODE>
      <NAME>Safe2Travel Pte Ltd</NAME>
      <GST_NUMBER>20-0003048-E</GST_NUMBER>
      <CONTACT_NAME>ONG PEI LENG</CONTACT_NAME>
      <CONTACT_PHONE>68233103</CONTACT_PHONE>
      <CONTACT_EMAIL>[email protected]</CONTACT_EMAIL>
      <CONTACT_FAX>68221636</CONTACT_FAX>
    - <SITES>
    - <SITE>
      <ID>1</ID>
      <NAME>ravel Pte Ltd</NAME>
      <PHONE>68233013</PHONE>
      <PHONE_EXTENSION xsi:nil="true" />
      <FAX>68221636</FAX>
      <EMAIL>[email protected]</EMAIL>
      <ADDRESS_LINE1>10 Eunos Road 8</ADDRESS_LINE1>
      <ADDRESS_LINE2>#08-03 (North Lobby)</ADDRESS_LINE2>
      <ADDRESS_LINE3>Singapore Post Centre</ADDRESS_LINE3>
      <COUNTRY_CODE>SG</COUNTRY_CODE>
      <PROVINCE xsi:nil="true" />
      <STATE xsi:nil="true" />
      <CITY xsi:nil="true" />
      <AREA_CODE xsi:nil="true" />
      <ZIP>408600</ZIP>
      <REGION_CODE xsi:nil="true" />
      </SITE>
    - <SITE>
      <ID>2</ID>
      <NAME>ravel Pte Ltd</NAME>
      <PHONE>62208866</PHONE>
      <PHONE_EXTENSION xsi:nil="true" />
      <FAX>62265578</FAX>
      <EMAIL>[email protected]</EMAIL>
      <ADDRESS_LINE1>3 Lim Teck Kim Road</ADDRESS_LINE1>
      <ADDRESS_LINE2>#02-02</ADDRESS_LINE2>
      <ADDRESS_LINE3>Singapore Technologies Building</ADDRESS_LINE3>
      <COUNTRY_CODE>SG</COUNTRY_CODE>
      <PROVINCE xsi:nil="true" />
      <STATE xsi:nil="true" />
      <CITY xsi:nil="true" />
      <AREA_CODE xsi:nil="true" />
      <ZIP>088934</ZIP>
      <REGION_CODE xsi:nil="true" />
      </SITE>
    - <SITE>
      <ID>3</ID>
      <NAME>Safe2Travel Pte Ltd</NAME>
      <PHONE>62208866</PHONE>
      <PHONE_EXTENSION xsi:nil="true" />
      <FAX>62265578</FAX>
      <EMAIL>[email protected]</EMAIL>
      <ADDRESS_LINE1>3 Lim Teck Kim Road</ADDRESS_LINE1>
      <ADDRESS_LINE2>#02-02</ADDRESS_LINE2>
      <ADDRESS_LINE3>Singapore Technologies Building</ADDRESS_LINE3>
      <COUNTRY_CODE>SG</COUNTRY_CODE>
      <PROVINCE xsi:nil="true" />
      <STATE xsi:nil="true" />
      <CITY xsi:nil="true" />
      <AREA_CODE xsi:nil="true" />
      <ZIP>088934</ZIP>
      <REGION_CODE xsi:nil="true" />
      </SITE>
      </SITES>
      </SUPPLIER>
    - <USER>
      <CODE>JOYCE SOON</CODE>
      <NAME>JOYCE SOON</NAME>
      <ORGANISATION_NAME>Republic Polytechnic</ORGANISATION_NAME>
      </USER>
    - <FUND_COMMIT_AMOUNT>
      <CURRENCY_CODE>SGD</CURRENCY_CODE>
      <CURRENCY_RATE>1</CURRENCY_RATE>
      <CURRENCY_RATE_DATE>1900-01-01T00:00:00</CURRENCY_RATE_DATE>
      <CURRENCY_RATE_TYPE>BOOK</CURRENCY_RATE_TYPE>
      <CURRENCY_AMOUNT>21551.4</CURRENCY_AMOUNT>
      </FUND_COMMIT_AMOUNT>
    - <PERIOD_CONTRACT>
      <CODE>RPO000ECN11000100</CODE>
      <AGENCY_CODE>RPO000</AGENCY_CODE>
      <ADMIN_FEE_SGD_AMOUNT>0</ADMIN_FEE_SGD_AMOUNT>
      </PERIOD_CONTRACT>
    - <BUYER>
      <ORGANISATION_CODE>1</ORGANISATION_CODE>
      <ORGANISATION_NAME>Republic Polytechnic</ORGANISATION_NAME>
      <NAME>Sally Ang</NAME>
      <PHONE>31001711</PHONE>
      <FAX>64151310</FAX>
      <EMAIL>[email protected]</EMAIL>
      </BUYER>
      <APPROVING_OFFICERS />
      </HEADER>
    - <ITEMS>
    - <ITEM>
      <LINE_NUMBER>1</LINE_NUMBER>
      <STATUS>NEW</STATUS>
      <STATUS_DATE>2011-07-08T16:57:39</STATUS_DATE>
      <DESCRIPTION>Return Air Ticket including Airport Taxes and Fuel Surcharges (2 staff and 24 students)</DESCRIPTION>
      <UNIT_OF_MEASURE>PAX</UNIT_OF_MEASURE>
      <QUANTITY>26</QUANTITY>
      <LINE_TYPE>SERVICES</LINE_TYPE>
      <UNIT_PRICE>828.9</UNIT_PRICE>
      <PRICE_UNIT>1</PRICE_UNIT>
      <TOTAL_AMOUNT>21551.4</TOTAL_AMOUNT>
      <MATERIAL_MASTER_CODE xsi:nil="true" />
      <MATERIAL_GROUP_CODE xsi:nil="true" />
      <PLANT_CODE xsi:nil="true" />
      <ITEM_CATEGORY_CODE xsi:nil="true" />
      <ADMIN_FEE_SGD_AMOUNT>0</ADMIN_FEE_SGD_AMOUNT>
      <INSTRUCTION_TO_SUPPLIER>Purchase of goods/services is subject to the Terms & Conditions found in www.rp.sg/purchase and/or in the ITQ/ITT Specifications. Please liaise with the Contact Person for delivery details. Invoice MUST be addressed to the Contact Person. PO number MUST be included in the Description field under e-Invoice Details section at Vendor@Gov.</INSTRUCTION_TO_SUPPLIER>
      <PERIOD_CONTRACT_LINE_NUMBER>1</PERIOD_CONTRACT_LINE_NUMBER>
      <GOODS_INSPECT_FLAG>N</GOODS_INSPECT_FLAG>
    - <PURCHASE_REQUEST>
      <CODE>RPO000EPR11000465</CODE>
      <LINE_NUMBER>1</LINE_NUMBER>
      </PURCHASE_REQUEST>
    - <PART_NUMBER_INFORMATION>
      <NATO_STOCK_NUMBER xsi:nil="true" />
      <MANUFACTURER_PART_NUMBER xsi:nil="true" />
      <PART_NUMBER xsi:nil="true" />
      <CAGE_CODE xsi:nil="true" />
      <CAGE_NAME xsi:nil="true" />
      <ITEM_CONDITION xsi:nil="true" />
      <MINIMUM_SHELF_LIFE xsi:nil="true" />
      <SHELF_LIFE_REMAINING xsi:nil="true" />
      <CERTIFICATE_OF_CONFORMANCE xsi:nil="true" />
      <EXPORT_LICENSE xsi:nil="true" />
      </PART_NUMBER_INFORMATION>
    - <LOCATIONS>
    - <LOCATION>
      <LINE_NUMBER>1</LINE_NUMBER>
      <STATUS>NEW</STATUS>
      <STATUS_DATE>2011-07-08T16:57:39</STATUS_DATE>
      <QUANTITY>26</QUANTITY>
      <DELIVERY_DESTINATION>Republic Polytechnic, One-Stop Centre, 9 Woodlands Avenue 9, S(738964)</DELIVERY_DESTINATION>
      <DELIVERY_DATE>2011-07-11T00:00:00</DELIVERY_DATE>
      <DELIVERY_TERMS>LOC</DELIVERY_TERMS>
      <PORT_OF_ORIGIN>-</PORT_OF_ORIGIN>
    - <RECIPIENT>
      <CODE>OSC</CODE>
      <NAME>One Stop Centre</NAME>
      <PHONE>65103000</PHONE>
      <EMAIL>[email protected]</EMAIL>
      </RECIPIENT>
    - <DISTRIBUTIONS>
    - <DISTRIBUTION>
      <LINE_NUMBER>1</LINE_NUMBER>
      <STATUS>NEW</STATUS>
      <STATUS_DATE>2011-07-08T16:57:39</STATUS_DATE>
      <QUANTITY>26</QUANTITY>
      <CHART_OF_ACCOUNT>1/G01/3SAS/020/220908/0000/0000/0000</CHART_OF_ACCOUNT>
      <PROJECT_DISTRIBUTION xsi:nil="true" />
      </DISTRIBUTION>
      </DISTRIBUTIONS>
      </LOCATION>
      </LOCATIONS>
      </ITEM>
      </ITEMS>
      </GEBIZ_ORDER>I was able to read this kind of file structure but due to some constraints now they added supplier sites and increment that one which will be like variable kind of thing now.
    And below mentioned is the script which I am using right now for reading that xml file
    PROCEDURE XGBZPROD.XGBZ_PUR_ORD_XMLTAG_PROC(P_XML_FILE IN VARCHAR2, P_FOLDER_NAME IN VARCHAR2)
    IS
      lv_supp_file     XMLTYPE;
      lv_hdr_error     VARCHAR2(240);
      lv_line_error    VARCHAR2(240);
      lv_line_loc_err  VARCHAR2(240);
      lv_dist_err      VARCHAR2(240);
      l_file_name      VARCHAR2(300);
      l_folder_name    VARCHAR2(300);
      lv_sysdate       DATE := sysdate;
    BEGIN
      l_file_name     := p_xml_file;
      l_folder_name   := p_folder_name;
      -- this clause to check whether is xml file or NODATA FILE.
      IF upper(substr(l_file_name,instr(l_file_name,'.',1)+1,3)) ='XML' THEN
        lv_supp_file  := xmltype( bfilename('XMLDIR',P_XML_FILE), nls_charset_id('AL32UTF8'));
        dbms_output.put_line('P_XML_FILE '||P_XML_FILE);
    -- Initially insert data into 11g table
    -- This is to read xml datafile
      INSERT INTO XGBZ_PO_XML_DETAILS
       (ministry_code                ,
        department_code              ,
        order_code                   ,
        external_system_code         ,
        amendment_number             ,
        variation_number             ,
        description                  ,
        status                       ,
        status_date                  ,
        payment_terms                ,
        bill_to                      ,
        justification                ,
        create_timestamp             ,
        terminate_reason             ,
        terminate_timestamp          ,
        order_type                   ,
        sub_business_unit            ,
        cost_center_group            ,
        buyer_code                   ,
        financial_system_order_code  ,
        user_nric                    ,
        supplier_code                ,
        supplier_name                ,
        gst_number                   ,
        contact_name                 ,
        contact_phone                ,
        contact_email                ,
        contact_fax                  ,
        supp_site_id                 ,
        supp_site_name               ,
        supp_site_phone              ,
        supp_sit_phone_ext           ,
        supp_site_fax                ,
        supp_site_email              ,
        supp_site_add_line1          ,
        supp_site_add_line2          ,
        supp_site_add_line3          ,
        supp_site_country_code       ,
        supp_site_province           ,
        supp_site_state              ,
        supp_site_city               ,
        supp_site_area_code          ,
        supp_site_zip                ,
        supp_site_region_code        ,
        user_code                    ,
        user_name                    ,
        user_org_name                ,
        currency_code                ,
        currency_rate                ,
        currency_rate_date           ,
        currency_rate_type           ,
        currency_amount              ,
        tx_field_2                   ,
        agency_code                  ,
        admin_fee_sgd                ,
        buyer_orgn_code              ,
        buyer_orgn_name              ,
        buyer_name                   ,
        buyer_phone                  ,
        buyer_fax                    ,
        buyer_email                  ,
        ao_code                      ,
        ao_name                      ,
        line_no                      ,
        line_status                  ,
        line_status_date             ,
        line_description             ,
        unit_of_measure              ,
        line_qty                     ,
        line_type                    ,
        unit_price                   ,
        line_total_amount            ,
        material_master_code         ,
        material_group_code          ,
        item_category_code           ,
        line_admin_fee_sgd_amt       ,
        instruction_supplier         ,
        period_contract_line_no      ,
        goods_inspect_flag           ,
        pr_code                      ,
        pr_line_number               ,
        nato_stock_number            ,
        manufacturer_part_no         ,
        part_number                  ,
        cage_code                    ,
        cage_name                    ,
        item_condition               ,
        minimum_shelf_life           ,
        shelf_life_remaining         ,
        cert_of_conformance          ,
        export_license               ,
        line_location_no             ,
        line_loc_status              ,
        line_loc_status_date         ,
        line_loc_qty                 ,
        delivery_destination         ,
        delivery_date                ,
        delivery_terms               ,
        port_of_origin               ,
        recipient_code               ,
        recipient_name               ,
        recipient_phone              ,
        recipient_email              ,
        dist_line_no                 ,
        dist_line_status             ,
        dist_line_status_date        ,
        dist_line_qty                ,
        chart_of_account             ,
        project_distribution
       SELECT --Header Data
              ministry_code                ,
              department_code              ,
              order_code                   ,
              external_system_code         ,
              amendment_number             ,
              variation_number             ,
              description                  ,
              status                       ,
              status_date                  ,
              payment_terms                ,
              bill_to                      ,
              justification                ,
              create_timestamp             ,
              terminate_reason             ,
              terminate_timestamp          ,
              order_type                   ,
              sub_business_unit            ,
              cost_center_group            ,
              buyer_code                   ,
              financial_system_order_code  ,
              user_nric                    ,
              supplier_code                ,
              supplier_name                ,
              gst_number                   ,
              contact_name                 ,
              contact_phone                ,
              contact_email                ,
              contact_fax                  ,
              supp_site_id                 ,
              supp_site_name               ,
              supp_site_phone              ,
              supp_sit_phone_ext           ,
              supp_site_fax                ,
              supp_site_email              ,
              supp_site_add_line1          ,
              supp_site_add_line2          ,
              supp_site_add_line3          ,
              supp_site_country_code       ,
              supp_site_province           ,
              supp_site_state              ,
              supp_site_city               ,
              supp_site_area_code          ,
              supp_site_zip                ,
              supp_site_region_code        ,
              user_code                    ,
              user_name                    ,
              user_org_name                ,
              currency_code                ,
              currency_rate                ,
              currency_rate_date           ,
              currency_rate_type           ,
              currency_amount              ,
              tx_field_2                   ,
              agency_code                  ,
              admin_fee_sgd                ,
              buyer_orgn_code              ,
              buyer_orgn_name              ,
              buyer_name                   ,
              buyer_phone                  ,
              buyer_fax                    ,
              buyer_email                  ,
              ao_code                      ,
              ao_name                      ,
              line_no                      ,
              line_status                  ,
              line_status_date             ,
              line_description             ,
              unit_of_measure              ,
              line_qty                     ,
              line_type                    ,
              unit_price                   ,
              line_total_amount            ,
              material_master_code         ,
              material_group_code          ,
              item_category_code           ,
              line_admin_fee_sgd_amt       ,
              instruction_supplier         ,
              period_contract_line_no      ,
              goods_inspect_flag           ,
              pr_code                      ,
              pr_line_number               ,
              nato_stock_number            ,
              manufacturer_part_no         ,
              part_number                  ,
              cage_code                    ,
              cage_name                    ,
              item_condition               ,
              minimum_shelf_life           ,
              shelf_life_remaining         ,
              cert_of_conformance          ,
              export_license               ,
              line_location_no             ,
              line_loc_status              ,
              line_loc_status_date         ,
              line_loc_qty                 ,
              delivery_destination         ,
              delivery_date                ,
              delivery_terms               ,
              port_of_origin               ,
              recipient_code               ,
              recipient_name               ,
              recipient_phone              ,
              recipient_email              ,
              dist_line_no                 ,
              dist_line_status             ,
              dist_line_status_date        ,
              dist_line_qty                ,
              chart_of_account             ,
              project_distribution
         FROM XMLTable('/GEBIZ_ORDER'
              passing lv_supp_file
              columns
              ministry_code                      VARCHAR2(3)    path    'HEADER/MINISTRY_CODE',
              department_code                    VARCHAR2(3)    path    'HEADER/DEPARTMENT_CODE',
              order_code                         VARCHAR2(17 )  path    'HEADER/ORDER_CODE',
              external_system_code               VARCHAR2(1)    path    'HEADER/EXTERNAL_SYSTEM_CODE',
              amendment_number                   VARCHAR2(5)    path    'HEADER/AMENDMENT_NUMBER' ,
              variation_number                   VARCHAR2(5)    path    'HEADER/VARIATION_NUMBER',
              description                        VARCHAR2(500)  path    'HEADER/DESCRIPTION',
              status                             VARCHAR2(500)  path    'HEADER/STATUS',
              status_date                        VARCHAR2(24)   path    'HEADER/STATUS_DATE',
              payment_terms                      VARCHAR2(400)  path    'HEADER/PAYMENT_TERMS',
              bill_to                            VARCHAR2(200)  path    'HEADER/BILL_TO',
              justification                      VARCHAR2(400)  path    'HEADER/JUSTIFICATION',
              create_timestamp                   VARCHAR2(24)   path    'HEADER/CREATE_TIMESTAMP',
              terminate_reason                   VARCHAR2(400)  path    'HEADER/TERMINATE_REASON',
              terminate_timestamp                VARCHAR2(24)   path    'HEADER/TERMINATE_TIMESTAMP',
              order_type                         VARCHAR2(2 )   path    'HEADER/ORDER_TYPE',
              sub_business_unit                  VARCHAR2(5 )   path    'HEADER/FINANCIAL_SYSTEM/SUB_BUSINESS_UNIT',
              cost_center_group                  VARCHAR2(20 )  path    'HEADER/FINANCIAL_SYSTEM/NFS/COST_CENTER_GROUP',
              buyer_code                         VARCHAR2(30 )  path    'HEADER/FINANCIAL_SYSTEM/NFS/BUYER_CODE',
              financial_system_order_code        VARCHAR2(20 )  path    'HEADER/FINANCIAL_SYSTEM/NFS/FINANCIAL_SYSTEM_ORDER_CODE',
              user_nric                          VARCHAR2(9 )   path    'HEADER/FINANCIAL_SYSTEM/NFS/USER_NRIC',
              supplier_code                      VARCHAR2(10)   path    'HEADER/SUPPLIER/CODE',
              supplier_name                      VARCHAR2(140)  path    'HEADER/SUPPLIER/NAME' ,
              gst_number                         VARCHAR2(30 )  path    'HEADER/SUPPLIER/GST_NUMBER',
              contact_name                       VARCHAR2(140 ) path    'HEADER/SUPPLIER/CONTACT_NAME',
              contact_phone                      VARCHAR2(23 )  path    'HEADER/SUPPLIER/CONTACT_PHONE',
              contact_email                      VARCHAR2(100)  path    'HEADER/SUPPLIER/CONTACT_EMAIL',
              contact_fax                        VARCHAR2(23 )  path    'HEADER/SUPPLIER/CONTACT_FAX',
              supp_site_id                       NUMBER         path    'HEADER/SUPPLIER/SITES/SITE/ID',
              supp_site_name                     VARCHAR2(140)  path    'HEADER/SUPPLIER/SITES/SITE/NAME',
              supp_site_phone                    VARCHAR2(23)   path    'HEADER/SUPPLIER/SITES/SITE/PHONE',
              supp_sit_phone_ext                 VARCHAR2(4 )   path    'HEADER/SUPPLIER/SITES/SITE/PHONE_EXTENSION',
              supp_site_fax                      VARCHAR2(23 )  path    'HEADER/SUPPLIER/SITES/SITE/FAX',
              supp_site_email                    VARCHAR2(100 ) path    'HEADER/SUPPLIER/SITES/SITE/EMAIL',
              supp_site_add_line1                VARCHAR2(254 ) path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE1',
              supp_site_add_line2                VARCHAR2(35 )  path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE2',
              supp_site_add_line3                VARCHAR2(35 )  path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE3',
              supp_site_country_code             VARCHAR2(2 )   path    'HEADER/SUPPLIER/SITES/SITE/COUNTRY_CODE',
              supp_site_province                 VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/PROVINCE',
              supp_site_state                    VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/STATE',
              supp_site_city                     VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/CITY',
              supp_site_area_code                VARCHAR2(10 )  path    'HEADER/SUPPLIER/SITES/SITE/AREA_CODE',
              supp_site_zip                      VARCHAR2(20 )  path    'HEADER/SUPPLIER/SITES/SITE/ZIP',
              supp_site_region_code              VARCHAR2(3 )   path    'HEADER/SUPPLIER/SITES/SITE/REGION_CODE',
              user_code                          VARCHAR2(16 )  path    'HEADER/USER/CODE',
              user_name                          VARCHAR2(25 )  path    'HEADER/USER/NAME',
              user_org_name                      VARCHAR2(95 )  path    'HEADER/USER/ORGANISATION_NAME',
              currency_code                      VARCHAR2(3 )   path    'HEADER/FUND_COMMIT_AMOUNT/CURRENCY_CODE',
              currency_rate                      NUMBER         path    'HEADER/FUND_COMMIT_AMOUNT/CURRENCY_RATE',
              currency_rate_date                 VARCHAR2(24)   path    'HEADER/FUND_COMMIT_AMOUNT/CURRENCY_RATE_DATE',
              currency_rate_type                 VARCHAR2(5 )   path    'HEADER/FUND_COMMIT_AMOUNT/CURRENCY_RATE_TYPE',
              currency_amount                    NUMBER         path    'HEADER/FUND_COMMIT_AMOUNT/CURRENCY_AMOUNT',
              tx_field_2                         VARCHAR2(17 )  path    'HEADER/PERIOD_CONTRACT/CODE',
              agency_code                        VARCHAR2(6 )   path    'HEADER/PERIOD_CONTRACT/AGENCY_CODE',
              admin_fee_sgd                      NUMBER         path    'HEADER/PERIOD_CONTRACT/ADMIN_FEE_SGD_AMOUNT'  ,
              buyer_orgn_code                    VARCHAR2(5 )   path    'HEADER/BUYER/ORGANISATION_CODE',
              buyer_orgn_name                    VARCHAR2(95 )  path    'HEADER/BUYER/ORGANISATION_NAME',
              buyer_name                         VARCHAR2(80 )  path    'HEADER/BUYER/NAME',
              buyer_phone                        VARCHAR2(23 )  path    'HEADER/BUYER/PHONE',
              buyer_fax                          VARCHAR2(23 )  path    'HEADER/BUYER/FAX',
              buyer_email                        VARCHAR2(100 ) path    'HEADER/BUYER/EMAIL',
              ao_code                            VARCHAR2(16 )  path    'HEADER/APPROVING_OFFICERS/APPROVING_OFFICER/CODE',
              ao_name                            VARCHAR2(40 )  path    'HEADER/APPROVING_OFFICERS/APPROVING_OFFICER/NAME',
              items                              XMLTYPE        path    'ITEMS'
              ) x1,
            XMLTABLE('/ITEMS/ITEM'
            passing x1.items
            columns
              line_no                            VARCHAR2(5)    path    'LINE_NUMBER',
              line_status                        VARCHAR2(15)   path    'STATUS',
              line_status_date                   VARCHAR2(24)   path    'STATUS_DATE',
              line_description                   VARCHAR2(500)  path    'DESCRIPTION',
              unit_of_measure                    VARCHAR2(3)    path    'UNIT_OF_MEASURE',
              line_qty                           NUMBER         path    'QUANTITY',
              line_type                          VARCHAR2(20)   path    'LINE_TYPE',
              unit_price                         NUMBER         path    'UNIT_PRICE',
              line_total_amount                  NUMBER         path    'TOTAL_AMOUNT',
              material_master_code               VARCHAR2(20)   path    'MATERIAL_MASTER_CODE',
              material_group_code                VARCHAR2(10)   path    'MATERIAL_GROUP_CODE',
              item_category_code                 VARCHAR2(18)   path    'ITEM_CATEGORY_CODE',
              line_admin_fee_sgd_amt             NUMBER         path    'ADMIN_FEE_SGD_AMOUNT',
              instruction_supplier               VARCHAR2(400)  path    'INSTRUCTION_TO_SUPPLIER',
              period_contract_line_no            NUMBER         path    'PERIOD_CONTRACT_LINE_NUMBER',
              goods_inspect_flag                 VARCHAR2(1)    path    'GOODS_INSPECT_FLAG',
              pr_code                            VARCHAR2(17)   path    'PURCHASE_REQUEST/CODE',
              pr_line_number                     VARCHAR2(5)    path    'PURCHASE_REQUEST/LINE_NUMBER',
              nato_stock_number                  VARCHAR2(14)   path    'PART_NUMBER_INFORMATION/NATO_STOCK_NUMBER',
              manufacturer_part_no               VARCHAR2(32)   path    'PART_NUMBER_INFORMATION/MANUFACTURE_PART_NUMBER',
              part_number                        VARCHAR2(200)  path    'PART_NUMBER_INFORMATION/PART_NUMBER',
              cage_code                          VARCHAR2(10)   path    'PART_NUMBER_INFORMATION/CAGE_CODE',
              cage_name                          VARCHAR2(140)  path    'PART_NUMBER_INFORMATION/CAGE_NAME',
              item_condition                     VARCHAR2(1)    path    'PART_NUMBER_INFORMATION/ITEM_CONDITION'  ,
              minimum_shelf_life                 NUMBER         path    'PART_NUMBER_INFORMATION/MINIMUM_SHELF_LIFE',
              shelf_life_remaining               VARCHAR2(3)    path    'PART_NUMBER_INFORMATION/SHELF_LIFE_REMAINING',
              cert_of_conformance                VARCHAR2(1000) path    'PART_NUMBER_INFORMATION/CERTIFICATE_OF_CONFORMANCE',
              export_license                     VARCHAR2(3)    path    'PART_NUMBER_INFORMATION/EXPORT_LICENSE',
              locations                          XMLTYPE        path    'LOCATIONS'
             )x2,
             XMLTABLE('/LOCATIONS/LOCATION'
             passing x2.locations
             columns
              line_location_no                   NUMBER         path     'LINE_NUMBER',
              line_loc_status                    VARCHAR2(15)   path     'STATUS',
              line_loc_status_date               VARCHAR2(24)   path     'STATUS_DATE',
              line_loc_qty                       NUMBER         path     'QUANTITY',
              delivery_destination               VARCHAR2(1000) path     'DELIVERY_DESTINATION',
              delivery_date                      VARCHAR2(24)   path     'DELIVERY_DATE',
              delivery_terms                     VARCHAR2(3)    path     'DELIVERY_TERMS',
              port_of_origin                     VARCHAR2(150)  path     'PORT_OF_ORIGIN',
              recipient_code                     VARCHAR2(16 )  path     'RECIPIENT/CODE',
              recipient_name                     VARCHAR2(40 )  path     'RECIPIENT/NAME',
              recipient_phone                    VARCHAR2(23 )  path     'RECIPIENT/PHONE',
              recipient_email                    VARCHAR2(100 ) path     'RECIPIENT/EMAIL',
              distributions                      XMLTYPE        path     'DISTRIBUTIONS'
             )x3,
             XMLTABLE('/DISTRIBUTIONS/DISTRIBUTION'
             passing x3.distributions
             columns
              dist_line_no                       NUMBER         path     'LINE_NUMBER',
              dist_line_status                   VARCHAR2(15)   path     'STATUS',
              dist_line_status_date              VARCHAR2(24)   path     'STATUS_DATE',
              dist_line_qty                      NUMBER         path     'QUANTITY',
              chart_of_account                   VARCHAR2(420)  path     'CHART_OF_ACCOUNT',
              project_distribution               VARCHAR2(4000) path     'PROJECT_DISTRIBUTION'
              )x4;
    end;As there is change in requirement now I need to read the multiple supplier sites at the header level. Current this is my structure please give an idea how to read the mulitple sites as one record, probably i can increase the supplier site columns at table level so as to capture second site level information.
    But if in case if i receive that time it should not fail please provide some good solution for this issue.
    Thanks in advance for your help.
    Regards
    Nagendra

    Hi odie,
    Thanks for your response. But here my supplier site will always be maxiumum 2 times and minimum 1 time. My thinking is to fit this one in the existing code by repeating the supplier site only like this
              supp_site_id                       NUMBER         path    'HEADER/SUPPLIER/SITES/SITE/ID',
              supp_site_name                     VARCHAR2(140)  path    'HEADER/SUPPLIER/SITES/SITE/NAME',
              supp_site_phone                    VARCHAR2(23)   path    'HEADER/SUPPLIER/SITES/SITE/PHONE',
              supp_sit_phone_ext                 VARCHAR2(4 )   path    'HEADER/SUPPLIER/SITES/SITE/PHONE_EXTENSION',
              supp_site_fax                      VARCHAR2(23 )  path    'HEADER/SUPPLIER/SITES/SITE/FAX',
              supp_site_email                    VARCHAR2(100 ) path    'HEADER/SUPPLIER/SITES/SITE/EMAIL',
              supp_site_add_line1                VARCHAR2(254 ) path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE1',
              supp_site_add_line2                VARCHAR2(35 )  path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE2',
              supp_site_add_line3                VARCHAR2(35 )  path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE3',
              supp_site_country_code             VARCHAR2(2 )   path    'HEADER/SUPPLIER/SITES/SITE/COUNTRY_CODE',
              supp_site_province                 VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/PROVINCE',
              supp_site_state                    VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/STATE',
              supp_site_city                     VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/CITY',
              supp_site_area_code                VARCHAR2(10 )  path    'HEADER/SUPPLIER/SITES/SITE/AREA_CODE',
              supp_site_zip                      VARCHAR2(20 )  path    'HEADER/SUPPLIER/SITES/SITE/ZIP',
              supp_site_region_code              VARCHAR2(3 )   path    'HEADER/SUPPLIER/SITES/SITE/REGION_CODE',
              supp_site_id2                       NUMBER         path    'HEADER/SUPPLIER/SITES/SITE/ID',
              supp_site_name2                     VARCHAR2(140)  path    'HEADER/SUPPLIER/SITES/SITE/NAME',
              supp_site_phone2                    VARCHAR2(23)   path    'HEADER/SUPPLIER/SITES/SITE/PHONE',
              supp_sit_phone_ext2                 VARCHAR2(4 )   path    'HEADER/SUPPLIER/SITES/SITE/PHONE_EXTENSION',
              supp_site_fax2                      VARCHAR2(23 )  path    'HEADER/SUPPLIER/SITES/SITE/FAX',
              supp_site_email2                    VARCHAR2(100 ) path    'HEADER/SUPPLIER/SITES/SITE/EMAIL',
              supp_site_add_line1_2                VARCHAR2(254 ) path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE1',
              supp_site_add_line2_2                VARCHAR2(35 )  path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE2',
              supp_site_add_line3_2                VARCHAR2(35 )  path    'HEADER/SUPPLIER/SITES/SITE/ADDRESS_LINE3',
              supp_site_country_code_2             VARCHAR2(2 )   path    'HEADER/SUPPLIER/SITES/SITE/COUNTRY_CODE',
              supp_site_province_2                 VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/PROVINCE',
              supp_site_state_2                    VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/STATE',
              supp_site_city_2                     VARCHAR2(25 )  path    'HEADER/SUPPLIER/SITES/SITE/CITY',
              supp_site_area_code_2                VARCHAR2(10 )  path    'HEADER/SUPPLIER/SITES/SITE/AREA_CODE',
              supp_site_zip_2                      VARCHAR2(20 )  path    'HEADER/SUPPLIER/SITES/SITE/ZIP',
              supp_site_region_code_2              VARCHAR2(3 )   path    'HEADER/SUPPLIER/SITES/SITE/REGION_CODE',As this table I am being used in many areas, it will be problem for me if try to go for different levels of tables. Or else can it be possible to read only once
    I mean only the first in the xml tags and leave the second xml. As there is not much significant for the second one.
    I appreciate your ideas on this, as the structure we are following is to rigid so I don't have much options to explore, please provide me your inputs in this context.
    Thanks for your help.
    Regards
    Nagendra
    Edited by: 838961 on Jul 13, 2011 1:43 AM

  • 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.

  • To Place the XML file from one folder to another folder in AL11

    Hi All,
      Here my requirement is to create the quotes using XML document. The XML document will come from the Application server. this one is fine.
    Now my prob is after processing the XML file, we have to place the XML file into another folder.
    Please let me know how to move the data inot XML file.
    Now iam reading the data into one variable V_string(it will contains the total XML file). From this variable how to move the data into APplication server.
    Please do the needful.
    Regards,
    Sreehari

    Hi,
    Use FM WS_FILE_COPY To FIrst Copy the File to some Location
    and Next Use FM TMP_GUI_DELETE_FILE To Delete the File from Old LOcation.
    Regards
    Bala.M

  • Create a Purchase order using the BAPI using the data in the XML file.

    Hello Gurus,
    here is the scenario can anyone help me how to proceed explaining the procedure?
    Create a Purchase order using the BAPI using the data in the XML file.
    comprehensive explanations are appreciated.
    thanks in advance.

    hi,
      first use fm "bapi_po_create".
      then use fm "BAPI_ACC_GL_POSTING_POST"
    The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
    •     No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
    •     In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
    •     A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM).

  • Unable to recreate replica as I cannot delete the xml files for the old VM on Hyper-v Cluster

    My setup
    There are 2 sites each running a Hyper-v 2012-R2 cluster comprising of 5 nodes each.
    All the machines are in a HA state and stored on the shared clustered resource.
    Initially we had replication working and it was replicating all the servers from Site A to Site B
    There were some replication issues which needed me to stop the replication and redo it again, in doing so I firstly removed replication on Fail-over cluster manager on Site A and did the same on Site B.
    On one of the servers I had to remove the VM, although the VM config and Disks still remain on the Site B Cluster.
    I was trying to recreate the replica but it always fails with the following error :
    Hyper-v failed to enable replication for virtual machine xxxxxxxx operation aborted (0x80004004).....
    I followed an article to stop the Hyper-V Virtual Machine Management Service and try delete the file,
    When i tried to stop the service it would restart automatically and I was unable to delete the file. I put the service in disabled which kept it stopped however I was still unable to delete the files. I also tried to get File assassin which can help delete
    and clear locked files but it too was unable to delete it while the service was running or stopped as well as its additional mode whereby it will delete it on next reboot.
    The  Article Https://social.technet.microsoft.com/Forums/windowsserver/en-US/4c4f2535-81ee-4a21-a920-b5632de2be37/hyperv-old-vm-folders-cannot-be-deleted?forum=winserverhyperv
     makes mention of stopping another service Hyper-V
    Image Management Service but I am unable to find it on 2012-R2 server.
    I have also tried to put the additional nodes in a paused drained roles state leaving only one node as the active one but it still will not let me delete the VM config
    files, without removing those files I cannot re-initiate the Replication.
    Any assistance would be greatly appreciated.

    Can you storage migrate any other vms or resources off of the CSV that contains the XML file in question? If so you may be able to then take that CSV offline, remove it from available storage, re-add as available storage, and add to CSV Volumes. Maybe
    that will clear your lock. 

  • Is a copy of .xml file on the iPod too? If so, how can I copy ONLY the .xml file to my computer and NOT have to copy all my music files too?

    I had to re-load my OS (Windows XP Pro) from a HD snapshot via Acronis True Image Server. I save my OS on my C: drive and all my data files on my D: drive.  So when I re-loaded my OS, I still have all of my music files intact.
    I have re-loaded the OS before and had to re-create iTunes library which I did by doing the follwing:
    1. cut & paste .xml file in iTunes folder to desktop
    2. delete .itl file in iTunes folder
    3. import .xml file through iTunes  file>library>iport playlist
    4. navigate to .xml file on desktop and import
    This worked last time I re-loaded my OS but not this time for some reason.
    So I'm wondering if there is a copy of the .xml file on the iPod itself in the iPod_Control folder that I can copy and paste to my comuter desktop and import via the above steps?
    I have seen all kinds of solutions on the web that include copying the music files from the iPod to the computer.  I don't need to do that.  I have the music files.  I just need the .xml file so iTunes can talk to my iPod (5th Generation - 30G).

    Backup your music library, that is the only way to ensure it does not go missing through theft, damage, operator error, machine breaks, upgrades go wrong, operator goes wrong .........

  • How to read the attribute of the xml file using jaxb

    Thanks,
    Buddy as i have a issue i have to read the xml file using jaxb and xml file contains this data and i have read the attribute like name , desc and action for a particular menu name pls tell the code how to do this it will be a great favour to me
    thanx in advance
    Rasool
    <contextmenu>
    <menu name='Lead' >
    <menuitem name='newlead' desc='New Lead' action='/leads.do?dispatch=insert' />
    <menuitem name='editlead' desc='Edit Lead' action='' />
    <menuitem name='leadinfo' desc='Lead Information' action='' />
    </menu>
    <menu name='Cases' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    <menu name='Contact' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    </contextmenu>

    What my program do is to get the encoding of XML files and convert them to UTF-8 encoding files, while I need this "encoding" information of the original XML document thus I can convert...
    After reading specifications and JDOM docs, the truth turns to be disappointed, no function is provided to get this information in JDOM level 2(the current released one), while it's promissed that this function will be provided in JDOM level API....
    Thanx all for your help and attention!!!

  • Error while opening the XML file

    Hi all,
    i'am trying to download data from internal table to XML file with root node and its
    corresponding child nodes.i have written the program in this way.
    tables: mara.
    include bcciixml_decl.
    include bcciixml_impl.
    parameters: p_matnr like mara-matnr.
    start-of-selection.
    data: piXML          type ref to if_ixml,
            pDocument      type ref to if_ixml_document,
            pStreamFactory type ref to if_ixml_stream_factory,
            pIStream       type ref to if_ixml_istream,
            pParser        type ref to if_ixml_parser,
            pNode          type ref to if_ixml_node,
            pText          type ref to if_ixml_text,
            string         type string,
            count          type i,
            index          type i,
            totalSize      type i,
            dsn(40)        type C,
            xstr           type xstring.
      types: begin of it_mara,
                matnr like mara-matnr,
                ernam like mara-ernam,
                aenam like mara-aenam,
                vpsta like mara-vpsta,
            end of it_mara.
    data: itab_mara type table of it_mara.
    select matnr ernam aenam vpsta from mara into table itab_mara where
           matnr =  p_matnr.
    types: begin of xml_line,
            data(256) type X,
          end of xml_line.
    data: xml_table type table of xml_line.
    parameters: filename like rlgrap-filename.
    pixml = cl_ixml=>create( ).
    *-- create the initial document
      pDocument = pixml->create_document( ).
      pStreamFactory = pixml->create_stream_factory( ).
    *-- create an input stream for the table
    *pIStream = pStreamFactory->create_istream_itable( table = xml_table
                                                     size  = totalSize ).
      pParser = piXML->create_parser( stream_factory = pStreamFactory
                                      istream        = pIStream
                                      document       = pDocument ).
    data: pOStream type ref to if_ixml_ostream.
    pOStream = pStreamFactory->create_ostream_itable( table = xml_table ).
    call method pDocument->render( ostream   = pOStream ).
    *-- how many bytes were written to the table?
    totalSize = pOStream->get_num_written_raw( ).
    *-- write the XML document back to the frontend
    concatenate filename '.out' into filename.
    condense filename no-gaps.
    CALL FUNCTION 'WS_DOWNLOAD'
         EXPORTING
              BIN_FILESIZE            = totalSize
              FILENAME                = filename
              FILETYPE                = 'BIN'
         TABLES
              DATA_TAB                = itab_mara
         EXCEPTIONS
              OTHERS                  = 11
    IF SY-SUBRC <> 0.
    ENDIF.
    *-- print the whole DOM tree as a list...
    pNode = pDocument.
    perform print_node using pNode.
          FORM print_node                                               *
    form print_node using value(pNode) type ref to if_ixml_node.
      data: indent      type i.
      data: pText       type ref to if_ixml_text.
      data: string      type string.
      indent  = pNode->get_height( ) * 2.
      case pnode->get_type( ).
        when if_ixml_node=>co_node_element.
          string = pNode->get_name( ).
          write: at /indent '<', string, '> '.
        when if_ixml_node=>co_node_text.
           pText ?= pNode->query_interface( ixml_iid_text ).
           if pText->ws_only( ) is initial.
            string = pNode->get_value( ).
            write: at /indent string.
           endif.
      endcase.
      pNode = pNode->get_first_child( ).
      while not pNode is initial.
         perform print_node using pNode.
         pNode = pNode->get_next( ).
      endwhile.
    endform.
    but when open the XML file which i created on the desktop it shows the following error.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'file:///C:/Documents and Settings/anilda/Desktop/sim...
    how to rectify this error.
    Regards,
    satish.

    You are going to need to provide more details about this shell script file you are executing and the environment it is in. Beyond being on a Windows box, you have provided none of those details.
    If the SQL statement will execute cleanly in SQLDeveloper but not your script, then the issue lies in the script. How do you know the error is that SQL statement? Can your script even "select * from dual;" successfully?
    Also, SQLDeveloper (which I don't use) may contain its own libraries for accessing the DB. You probably should consider upgrading to a SQL*Plus client that is at least the same version or later as your database.
    Note:
    As I recall, xmlgen in 9.2 is now a synonym for dbms_xmlgen. You should change the package name accordingly [url http://docs.oracle.com/cd/B10501_01/appdev.920/a96612/d_xmlge2.htm#1010709]dbms_xmlgen.getXML

  • Error in reading the XML file

    Hi,
    I am trying to read the values of the node of XML file. The structure of the XML file is:
    <?xml version = "1.0"?>
    <DOCUMENT>
    <LANGUAGE_TRANS>
    <TRANSLATION>
    <CODE>3</CODE>
    <VALUE>Please select a number</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>5</CODE>
    <VALUE>Patni</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>6</CODE>
    <VALUE>Status Messages</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>7</CODE>
    <VALUE>Progress</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>8</CODE>
    <VALUE>Create Data Files...</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>9</CODE>
    <VALUE>OK</VALUE>
    </TRANSLATION>
    </LANGUAGE_TRANS>
    </DOCUMENT>
    I have written the code to read the value of the code from the XML file. When I run the code as written below. It doesnot give any error or exception. The node name returned is CODE as desired but the Node value returned is null which is not the desired result. Can anyone please help me to find where I am going wrong. Thanks a lot.
    Regards,
    Shweta
    import java.net.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    public class MergeXMLTest
    private static XMLDocument mDoc;
    public MergeXMLTest () {
    try {
    // Get an instance of the parser
    DOMParser lParser = new DOMParser();
    // Generate a URL from the filename for UPDATE.XML file.
    URL lUrl = createURL("mot.xml");
    System.out.println("after creating the URL object ");
    lParser.setErrorStream(System.out);
    lParser.showWarnings(true);
    lParser.parse(lUrl);
    mDoc = lParser.getDocument();
    System.out.println("after creating the URL object "+mDoc);
    lParser.reset();
    } catch (Exception e) {
    e.printStackTrace();
    } // end catch block
    } // End of constructor
    public void merge() throws DOMException {
    try {
         NodeList lTrans1 = this.mDoc.getElementsByTagName("CODE");
         if(lTrans1.getLength()>0) {
              Node lTransTag1 = lTrans1.item(0);
              System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getNodeName());
              System.out.println("lTrans1.item(0).getNodeValue : " + lTrans1.item(0).getNodeValue());
         } catch (Exception e) {
         System.out.println("Exception "+e);
         e.printStackTrace();
         } catch (Throwable t) {
              System.out.println("Exception "+t);
    public static URL createURL(String pFileName) throws MalformedURLException {
    URL url = null;
    Block of code to create a URL object from the file name
    that is passed as parameter.
    try {
    url = new URL(pFileName);
    } catch (MalformedURLException ex) {
    File f = new File(pFileName);
    String path = f.getAbsolutePath();
    String fs = System.getProperty("file.separator");
    System.out.println(" path of file : "+path +"separator " +fs);
    if (fs.length() == 1) {
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    System.out.println("path is : "+path);
    // Try again, if this throws an exception we just raise it up
    url = new URL(path);
    } // End catch block
    return url;
    } // end method create URL
    public static void main (String args[]) {
         MergeXMLTest mXML = new MergeXMLTest();
         mXML.merge();
    }

    see my answer here: http://forum.java.sun.com/thread.jsp?forum=34&thread=304647
    ps. if you know a little of XPath, this is why text() is a special kind of node()...

  • Getting error while running the XML file using XML Publisher Desktop

    Hi all,
    We have successfully loaded the XML file using XML Publisher Desktop. But when we preview the same using PDF format we are getting the following error.
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\smanmadh\Desktop\ProductCompensationDT.xml
    FOProcessor setLocale: en-us
    java.lang.NullPointerException
         at oracle.apps.xdo.template.fo.area.PageNumber.formatString(PageNumber.java:104)
         at oracle.apps.xdo.template.fo.IDManager.registerId(IDManager.java:44)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageJoinSeq(AreaTree.java:1106)
         at oracle.apps.xdo.template.fo.area.AreaTree.incrementJoinSequenceIndex(AreaTree.java:219)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageDocument(AreaTree.java:1089)
         at oracle.apps.xdo.template.fo.area.AreaTree.forceOutput(AreaTree.java:471)
         at oracle.apps.xdo.template.fo.elements.FORoot.end(FORoot.java:58)
         at oracle.apps.xdo.template.fo.FOHandler.endElement(FOHandler.java:386)
         at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:279)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1022)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Thanks in Advance.
    Sudeep.

    This is BI related. You will get a quicker answer from the BI Publisher forum
    BI Publisher

  • Error while running the XML file using XML Publisher Desktop

    Hi All,
    We have successfully loaded the XML file using XML Publisher Desktop.But when we try to preview it using the PDF format we are getting the following error.
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\smanmadh\Desktop\ProductCompensationDT.xml
    FOProcessor setLocale: en-us
    java.lang.NullPointerException
         at oracle.apps.xdo.template.fo.area.PageNumber.formatString(PageNumber.java:104)
         at oracle.apps.xdo.template.fo.IDManager.registerId(IDManager.java:44)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageJoinSeq(AreaTree.java:1106)
         at oracle.apps.xdo.template.fo.area.AreaTree.incrementJoinSequenceIndex(AreaTree.java:219)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageDocument(AreaTree.java:1089)
         at oracle.apps.xdo.template.fo.area.AreaTree.forceOutput(AreaTree.java:471)
         at oracle.apps.xdo.template.fo.elements.FORoot.end(FORoot.java:58)
         at oracle.apps.xdo.template.fo.FOHandler.endElement(FOHandler.java:386)
         at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:279)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1022)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Any pointers will be of great help.
    Thanks in Advance
    Sudeep.


    I had a similar error which when I searched, came up with this thread.
    My issue was resolved after I discovered that my RTF template was not really RTF. It was sill in MS Word DOC format. This was discovered by reviewing two templates in NOTEPAD. The MS-DOC files have a lot of "special" characters in them. My RTF was not really RTF.
    After doing a SAVE AS - RTF format, then the preview worked as expected.
    Just Sharing...
    --Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while downloading the xml file

    i am having a internal table which contains data in xml format but i am unable to download the data into local system by using 'GUI_DOWNLOAD' fn. module
    its error its showing is as :
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    A name contained an invalid character. Error processing resource 'file:///D:/XX.XML'. Line 4, Position 4
    MOD/><RPTSX/><MANDT/><SYPSY/><SYSID/><SAPRL/></T682><T682><KVEWE>A</KV...

    hello Durairaj,
    i am fwd the code go thru it and check why the xml file is not downloading,
    and after downloading the file i want that file to be in displayed in  .pdf.
    REPORT  ZCCSV_TO_XML.
    DATA : BEGIN OF TABLE OCCURS 0,
            TABNAME(15) TYPE C,
           END OF TABLE.
    DATA : BEGIN OF HEADER_NAMTAB OCCURS 0,
            NAMTAB TYPE STRING,
           END OF HEADER_NAMTAB.
    DATA : BEGIN OF CONVERT_ITAB_TO_XML OCCURS 0,
            FIELDNAME(255) TYPE C,
           END OF CONVERT_ITAB_TO_XML .
    DATA : BEGIN OF CONVERT_XML_TO_ITAB OCCURS 0,
            FIELDNAME(255) TYPE C,
           END OF CONVERT_XML_TO_ITAB.
    DATA DREF TYPE REF TO DATA.
    DATA TNAME LIKE DD02L-TABNAME.
    DATA BEGIN OF ZDFIES OCCURS 0.
            INCLUDE STRUCTURE DFIES.
    DATA END OF ZDFIES.
    DATA: xml_out TYPE string .
    DATA: xml_TO_ITAB TYPE string .
    data : wa_indx type indx.
    DATA : DETAIL(30).
    DATA : DATA1 TYPE STRING.
    DATA : COMMA . "VALUE ','.
    DATA : DBTAB1(15) TYPE C.
    FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE,
                   <WA>    TYPE ANY,
                    <WA1> TYPE ANY .
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME,
                       SKIP 1.
    PARAMETERS : SPOOL    RADIOBUTTON GROUP rad1 DEFAULT 'X',
                 CSV      RADIOBUTTON GROUP rad1 ,
                 XMLTOPDF RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN : SKIP 1,
                       END OF BLOCK b1.
        TABLE-TABNAME = 'T681'.
        APPEND TABLE.
        TABLE-TABNAME = 'T682'.
        APPEND TABLE.
      IF SPOOL = 'X'.
       PERFORM SPOOL.
      ELSEIF CSV = 'X'.
        PERFORM CSV.
      ELSEIF XMLTOPDF = 'X'.
        PERFORM XMLTOPDF.
      ENDIF.
    *&      Form  CSV
    form CSV .
    LOOP AT TABLE.
      dbtab1 = TABLE-TABNAME.
      TNAME = dbtab1.
      PERFORM GETFIELDS.
      LOOP AT HEADER_NAMTAB.
       WRITE: HEADER_NAMTAB-NAMTAB, COMMA.
      ENDLOOP.
      PERFORM GET_DETAIL_LIST.
    ENDLOOP.
    endform.                    " CSV
    form XMLTOPDF .
    LOOP AT TABLE.
      PERFORM GET_DETAIL_LIST.
    ENDLOOP.
    endform.                    " XMLTOPDF
    GETTING THE HEADER OF THE TABLE                                     *
    FORM GETFIELDS.
      REFRESH HEADER_NAMTAB.
      CALL FUNCTION 'GET_FIELDTAB'
       EXPORTING
           LANGU              = SY-LANGU
           ONLY               = SPACE
           TABNAME            = TNAME
           WITHTEXT           = 'X'
       TABLES
           FIELDTAB           = ZDFIES
       EXCEPTIONS
           INTERNAL_ERROR      = 01
           NO_TEXTS_FOUND      = 02
           TABLE_HAS_NO_FIELDS = 03
           TABLE_NOT_ACTIV     = 04.
      CASE SY-SUBRC.
        WHEN 0.
          LOOP AT ZDFIES.
            HEADER_NAMTAB-NAMTAB = ZDFIES-SCRTEXT_M.
            APPEND HEADER_NAMTAB.
          ENDLOOP.
        WHEN OTHERS.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH  SY-SUBRC.
      ENDCASE.
    ENDFORM.                  " GETFIELEDS
    *&      Form  GET_DETAIL_LIST
    form GET_DETAIL_LIST .
      CREATE DATA DREF TYPE STANDARD TABLE OF (TABLE)
                                WITH NON-UNIQUE DEFAULT KEY.
      ASSIGN DREF->* TO <ITAB> .
      SELECT * FROM (TABLE) INTO TABLE <ITAB>.
      CALL TRANSFORMATION ('ID')
      SOURCE tab = <ITAB>[]
      RESULT XML xml_out.
    Convert to TABLE
    CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
    EXPORTING
    i_string = xml_out
    i_tabline_length = 100
    TABLES
    et_table = CONVERT_ITAB_TO_XML.
    Download
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'ASC'
    filename = 'D:\XX.XML'
    TABLES
    data_tab = CONVERT_ITAB_TO_XML
    endform.

  • Error while validating the xml file

    Hello All,
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(false);
    DocumentBuilder db = dbf.newDocumentBuilder();
    doc = db.parse(new ByteArrayInputStream(xmlString.getBytes()));
    In this code even though I have set the validation of instance of DocumentBuilderFactory to false it still tries to validate the xml file using the dtd. How do I avoid the validation of the xml file by the dtd file ?.
    Is anybody having any suggestions for that ?.
    Help needed urgently.
    Thanks and regards,
    Sachin

    Thanks for the prompt help. Is there any other way instead of removing the DTD line ?. Because the xml is coming as a string and removing the dtd and then adding it will unneccesary hamper performance. Do you any other way in which even though I don't remove the line I get the output without removing the dtd line ?.
    thanks and regards,
    Sachin

  • Help in loading the xml file using  AS 2.0

    Hi
    I try to load the Xml file in As file but i need do all the
    fetching details from the __LoadXmlFile file function
    but it's working fine can any one help me for this issue
    ~~Sk

    You can't! Well, at least Flex cannot do this. All Flex can
    do is send this data -- any data -- to the server and it's up to
    you how you want to append this data to a file on the server.
    You see, flex can't write to local files. If you looking for
    client side file manipulation, take a look at Flex's desktop
    brother call AIR!
    ATTA

Maybe you are looking for

  • Problem with NSR database recovery

    Hi We use Networker to backup our databases. When we try and recover a database (using the DBMGui) the Networker software is asking for the incorrect tape to be loaded.  The parameter NSR_EBIDTYPE is set to NSAVETIME.  The correct information is bein

  • Apple tv is reducing tv volume

    Whenever I turn on my apple tv, the volume on my TV immediately and automatically goes down to zero.  I have had the apple tv and been using it with the same Sony Bravia TV for over a year without any problem until yesterday.  Both devices have fully

  • Mts files cannot imported with audio in pro cc6. how i can import mts files with audio?

    when i am importing mts files in pro cc6. every time it is being imported without audio. though original mts files have audio. how can i import mts files with audio in cc6?

  • Updating records

    helloo.. i have a java application that will add records , search and update records in the database.. i have the fields id,name,phone,address,sex and dob.. i will be having an update button , whenever the user will click on the update button he can

  • Cannot boot up at all---t61 7664-17u

    I was playing warcraft just now. Then the laptop suddenly stop and the screen has random blue line on the original picture. I shut it down and tried to reboot but cannot even see the first screen where LENOVO  logo was shown...The hard drive just sto