Inserting XML files with attribute and frontslash(/) in database

Hi,
I want to get and insert the data from XML file into database. Below is the XML file:
<bne:document xmlns:bne="http://www.oracle.com/bne" bne:apiVersion="1.0">
     <bne:workspace>
          <bne:layout id="242:AMW_PROC_UPLOAD">
               <header><line/>
               </header>
          </bne:layout>
     </bne:workspace>
     <bne:collection id="collection_1">
          <bne:data bne:id="data_1" bne:integrator="242:AMW_PROCESS_IMPORT_INTG" bne:layout="242:AMW_PROC_UPLOAD" bne:date_format="yyyy-MM-dd" bne:validation="full" bne:recreate="TRUE" bne:columns_mapped="FALSE" bne:nls_numeric_characters=".,">
               <header AMW_PROCESSES_INTERFACE.HEADER_PARENT_PROCESS_ID="All Processes">
               <line bne:IDX="1"
AMW_PROCESSES_INTERFACE.PROCESS_DISPLAY_NAME="Process test 1" AMW_PROCESSES_INTERFACE.SIGNIFICANT_PROCESS_FLAG="Yes"
AMW_PROCESSES_INTERFACE.REVISE_PROCESS_FLAG="N"
AMW_PROCESSES_INTERFACE.PROCESS_CATEGORY="Routine"
AMW_PROCESSES_INTERFACE.APPROVAL_STATUS="Approved"
AMW_PROCESSES_INTERFACE.STANDARD_PROCESS_FLAG="Yes"
AMW_PROCESSES_INTERFACE.PROCESS_OWNER_ID=""
AMW_PROCESSES_INTERFACE.FINANCE_OWNER_ID=""
AMW_PROCESSES_INTERFACE.APPLICATION_OWNER_ID=""
AMW_PROCESSES_INTERFACE.PARENT_PROCESS_NAME=""/>
               </header>
          </bne:data>
     </bne:collection>
</bne:document>
and the table structure is:
12:53:58 SQL> desc bne
Name Null? Type
HEADER_PARENT_PROCESS_ID VARCHAR2(80)
PROCESS_DISPLAY_NAME VARCHAR2(80)
SIGNIFICANT_PROCESS_FLAG VARCHAR2(3)
REVISE_PROCESS_FLAG VARCHAR2(1)
PROCESS_CATEGORY VARCHAR2(30)
APPROVAL_STATUS VARCHAR2(30)
STANDARD_PROCESS_FLAG VARCHAR2(3)
PROCESS_OWNER_ID VARCHAR2(80)
FINANCE_OWNER_ID VARCHAR2(80)
APPLICATION_OWNER_ID VARCHAR2(80)
PARENT_PROCESS_NAME VARCHAR2(80)
So I want specific attribute values to be inserted into this table. I know the way to insert the simple XML document into database by using DBMS_XMLSave methods, but in this case I need to extract specific attribute values. I have learned that in order to use XML SQL Utility to "auto-load" XML into relational tables, I have to transform this XML file into Oracle's "canonical XML format" perhaps by using XSLT, not sure.
Can someone please advise the correct way to accomplish above thing.
Thanks in Advance.
Manoj

Great detective work. It's odd how that click-to-call extension creates such random issues...

Similar Messages

  • XML tag with attributes and one value via XSU

    I need to generate a XML structure with attributes in the opening tag, and just one value in the body, like this:
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">9.99</PRODUCT-LIST-PRICE>
    Without an object type, I can just create tags like this
    XML3
    <PRODUCT-LIST-PRICE>9.99</PRODUCT-LIST-PRICE>
    (with no attributes, but a single value) via the followig statement
    SELECT sys_xmlgen ('9.99',
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML3"
    FROM DUAL;
    Having an object "productlisteprice_type", defined by
    CREATE OR REPLACE TYPE productlisteprice_type AS OBJECT
    "@NET-PRICE" VARCHAR2(10),
    "@CURRENCY" VARCHAR2(10),
    "PRICE" VARCHAR2(20)
    I just get XML like this
    XML2
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">
    <PRICE>9.99</PRICE>
    </PRODUCT-LIST-PRICE>
    (with attributes, but no direct value beneath the "PRODUCT-LIST-PRICE" tag) via the following statement
    SELECT sys_xmlgen ( productlisteprice_type(0,'USD','9.99'),
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML2"
    FROM DUAL;
    Not what I need :-(
    Are there any possibilities in XSU to get the needed XML code? Or do I have to do some post-production via XSQL???
    Another question: Is it possible to use specific keywords like "online" as XML tagnames, via objects? The objects don't allow "online" as a field name...
    Thanks in advance,
    Holger

    I need to generate a XML structure with attributes in the opening tag, and just one value in the body, like this:
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">9.99</PRODUCT-LIST-PRICE>
    Without an object type, I can just create tags like this
    XML3
    <PRODUCT-LIST-PRICE>9.99</PRODUCT-LIST-PRICE>
    (with no attributes, but a single value) via the followig statement
    SELECT sys_xmlgen ('9.99',
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML3"
    FROM DUAL;
    Having an object "productlisteprice_type", defined by
    CREATE OR REPLACE TYPE productlisteprice_type AS OBJECT
    "@NET-PRICE" VARCHAR2(10),
    "@CURRENCY" VARCHAR2(10),
    "PRICE" VARCHAR2(20)
    I just get XML like this
    XML2
    <PRODUCT-LIST-PRICE NET-PRICE="0" CURRENCY="USD">
    <PRICE>9.99</PRICE>
    </PRODUCT-LIST-PRICE>
    (with attributes, but no direct value beneath the "PRODUCT-LIST-PRICE" tag) via the following statement
    SELECT sys_xmlgen ( productlisteprice_type(0,'USD','9.99'),
    sys.xmlgenformattype.createFormat('PRODUCT-LIST-PRICE')
    ).getClobVal() "XML2"
    FROM DUAL;
    Not what I need :-(
    Are there any possibilities in XSU to get the needed XML code? Or do I have to do some post-production via XSQL???
    Another question: Is it possible to use specific keywords like "online" as XML tagnames, via objects? The objects don't allow "online" as a field name...
    Thanks in advance,
    Holger

  • Generate XML file with Elements and attributes from Oracle table

    Hi,
    I have the following table structure.
    CREATE TABLE COIL
    COIL_ID                         NUMBER(10),
    COIL_NUMBER                    VARCHAR2(40),
    COIL_PO_OPERATING_UNIT     VARCHAR2(20),
    COIL_PO_NUMBER               VARCHAR2(40),
    MILL_NUMBER                    VARCHAR2(2),
    MILL_COIL_STATUS          VARCHAR2(15),
    ITEM_NUMBER                    VARCHAR2(40),
    COIL_WEIGHT                    NUMBER(38),
    WEIGHT_UOM                    VARCHAR2(10),
    DOCUMENT_NUMBER               VARCHAR2(40),
    DOCUMENT_DATE               DATE,
    DOCUMENT_STATUS               VARCHAR2(15),
    DOCUMENT_TYPE               VARCHAR2(20),
    DOCUMENT_SOURCE               VARCHAR2(20),
    TEST_ID                         NUMBER(38),
    VALUE                         NUMBER,
    TEST_UOM                    VARCHAR2(20),
    TEST_STATUS               VARCHAR2(70),
    TESTER_LOGIN               VARCHAR2(20),
    EQUIPMENT_CODE               VARCHAR2(50),
    DOC_STS_MSG               VARCHAR2(600)
    For each COILID record, there could be multiple records baased on TEST_ID/VALUE/TEST_UOM etc.
    And I would like to prepare xml file in the following format by selecting data from COIL?
    <?xml version="1.0"?>
    -<Coil xsi:noNamespaceSchemaLocation="www.tempel.com/COIL.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb">
    <CoilId>1419532</CoilId>
    <CoilNo>D2221050010A0</CoilNo>
    <CoilPOOperatingUnit>Changzhou</CoilPOOperatingUnit>
    <CoilPONo>4619</CoilPONo>
    <MillNo>86</MillNo>
    <MillCoilStatus>Test</MillCoilStatus>
    <ItemNo>050FP800 C5</ItemNo>
    <Weight>7076</Weight>
    <UOM>KILOGRAM</UOM>
    <DocumentNo>0</DocumentNo>
    <DocumentDate>2013-01-11</DocumentDate>
    <DocumentStatus>NonProcessed</DocumentStatus>
    <DocumentType>Tests</DocumentType>
    <DocumentSource>CHIGMA1</DocumentSource>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4992" TestUnit="mm" Status="NonProcessed" TestId="135"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.0128" TestUnit="mm" Status="NonProcessed" TestId="124"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="12" TestUnit="mm" Status="NonProcessed" TestId="125"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5095" TestUnit="mm" Status="NonProcessed" TestId="127"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5042" TestUnit="mm" Status="NonProcessed" TestId="128"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5058" TestUnit="mm" Status="NonProcessed" TestId="129"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4967" TestUnit="mm" Status="NonProcessed" TestId="130"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5049" TestUnit="mm" Status="NonProcessed" TestId="131"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4972" TestUnit="mm" Status="NonProcessed" TestId="132"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4960" TestUnit="mm" Status="NonProcessed" TestId="133"/>
    <Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4996" TestUnit="mm" Status="NonProcessed" TestId="134"/>
    </Coil>
    Can you please guide me how to do it in a single query?
    Thanks in advance.

    Hi Odie,
    Thanks for the quick offer.Sure,No problem.I expect the format to be as follows
    <Coil xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="www.tempel.com/COIL.xsd">
    <CoilId>97239</CoilId>
    <CoilNo>777078</CoilNo>
    <CoilPOOperatingUnit>TSUSA</CoilPOOperatingUnit>
    <CoilPONo>3407</CoilPONo>
    <MillNo>31</MillNo>
    <MillCoilStatus>Test</MillCoilStatus>
    <ItemNo>0140SP150 C5A</ItemNo>
    <Weight>17365</Weight>
    <UOM>POUNDS</UOM>
    <DocumentNo>0</DocumentNo>
    <DocumentDate>2008-10-13</DocumentDate>
    <DocumentStatus>Processed</DocumentStatus>
    <DocumentType>Tests</DocumentType>
    <DocumentSource>MILL</DocumentSource>
    <Tests EquipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="84" TestUnit="15T" Status="Processed" TestId="65"></Tests>
    <Tests EquipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="1.39" TestUnit="W/Lb" Status="Processed" TestId="48"></Tests>
    <Tests EquipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="1979" TestUnit="W/Lb" Status="Processed" TestId="49"></Tests>
    </Coil>
    But instead it came with below format
    <Coil xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSch
    emaLocation="www.tempel.com/COIL.xsd"><CoilId>97239</CoilId><CoilNo>777078</Co
    ilNo><CoilPOOperatingUnit>TSUSA</CoilPOOperatingUnit><CoilPONo>3407</CoilPONo>
    <MillNo>31</MillNo><MillCoilStatus>Test</MillCoilStatus><ItemNo>0140SP150 C5A<
    /ItemNo><Weight>17365</Weight><UOM>POUNDS</UOM><DocumentNo>0</DocumentNo><Docu
    mentDate>2008-10-13</DocumentDate><DocumentStatus>Processed</DocumentStatus><Do
    cumentType>Tests</DocumentType><DocumentSource>MILL</DocumentSource><Tests Equ
    ipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="84" TestUnit="15T" Status="P
    rocessed" TestId="65"></Tests><Tests EquipmentCode="MILLEDI" TesterLogin="MILL
    EDI" Value="1.39" TestUnit="W/Lb" St atus="Processed" TestId="48"></Tests><Tes
    ts EquipmentCode="MILLEDI" TesterLog in="MILLEDI" Value="1979" TestUnit="W/Lb"
    Status="Processed" TestId="49"></Tests></Coil>
    The sample insert records are as follows
    insert into COIL (coil_id, coil_number, coil_po_operating_unit, coil_po_number, mill_number, mill_coil_status, item_number, coil_weight, weight_uom, document_number, document_date, document_status, document_type, document_source, test_id, value, test_uom, test_status, tester_login, equipment_code, doc_sts_msg)
    values (97239, '777078', 'USA', '3407', '31', 'Test', '0140SP150 C5A', 17365, 'POUNDS', '0', to_date('13-10-2008', 'dd-mm-yyyy'), 'Processed', 'Tests', 'MILL', 65, 84, '15T', 'Processed', 'MILLEDI', 'MILLEDI', null);
    insert into COIL (coil_id, coil_number, coil_po_operating_unit, coil_po_number, mill_number, mill_coil_status, item_number, coil_weight, weight_uom, document_number, document_date, document_status, document_type, document_source, test_id, value, test_uom, test_status, tester_login, equipment_code, doc_sts_msg)
    values (97239, '777078', 'USA', '3407', '31', 'Test', '0140SP150 C5A', 17365, 'POUNDS', '0', to_date('13-10-2008', 'dd-mm-yyyy'), 'Processed', 'Tests', 'MILL', 48, 1.39, 'W/Lb', 'Processed', 'MILLEDI', 'MILLEDI', null);
    insert into COIL (coil_id, coil_number, coil_po_operating_unit, coil_po_number, mill_number, mill_coil_status, item_number, coil_weight, weight_uom, document_number, document_date, document_status, document_type, document_source, test_id, value, test_uom, test_status, tester_login, equipment_code, doc_sts_msg)
    values (97239, '777078', 'USA', '3407', '31', 'Test', '0140SP150 C5A', 17365, 'POUNDS', '0', to_date('13-10-2008', 'dd-mm-yyyy'), 'Processed', 'Tests', 'MILL', 49, 1979, 'W/Lb', 'Processed', 'MILLEDI', 'MILLEDI', null);
    commit;
    Thanks in Advance.

  • Editing a XML file with PHP and HTML or AS2

    Hi webmates...
    I have been looking for a good tutorial on managing an XML
    file through Flash (AS2) or HTML and PHP... but all of what I have
    found at the moment are very confusing and incomplete... the
    examples actually do not work ok...
    Would anyone mind on addressing me any good place where I can
    find nice tutorials for this ? perhaps any example ? I wil really
    appreciate it, My web is already reading the XML file to load
    data... but I also need to create an application for editing this
    XML... thanx in advance...

    I have no experience with any decompilers beyond possibly attempting to trial one once.  The only one I have seen recommended is made by Sothink.
    Here is a link to a page with a tool that has an interface you can use to determine various properties of an swf file, including the Actionscript version.
    http://blog.sitedaniel.com/2009/11/swf-info-width-height-swf-version-actionscript-version- framerate/

  • Insert Insert XML file into multiple records in Oracle Database

    I would like to find out if it is possible to insert a single XML file into multiple records or tuples in a Oracle database table. I have a single XML file which is at multiple levels. The meta data for the levels are common and each level can have meta data of their own in addition. I do not have any meta data field which will uniquely determine whether the data belongs to Root level, Intermediate level or at the document level. Is there any way I can determine which level the meta data belongs to and thereby make a corresponding entry into the database table tuple? For example I could have an attribute called level which is going to be present only in the database table and not in the XML file. If level=1 then it corresponds to "Root" meta data, if level=2 then it corresponds to "Intermediate" level and if level=3 then it corresponds to meta data at document level. I need a way to calculate the value for level from the XML file and thereby insert the meta data element into a tuple in a single table in Oracle.

    Hi,
    extract your xml and then you can use insert all clause.
    here's very small example on 10.2.0.1.0
    SQL> create table table1(id number,val varchar2(10));
    Table created.
    SQL> create table table2(id number,val varchar2(10));
    Table created.
    SQL> insert all
      2  into table1 values(id,val)
      3  into table2 values(id2,val2)
      4  select extractValue(x.col,'/a/id1') id
      5        ,extractValue(x.col,'/a/value') val
      6        ,extractValue(x.col,'/a/value2') val2
      7        ,extractValue(x.col,'/a/id2') id2
      8  from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
    2 rows created.
    SQL> select * from table1;
            ID VAL                                                                 
             1 a                                                                   
    SQL> select * from table2;
            ID VAL                                                                 
             2 b                                                                    Ants

  • What's the best way to create XML file with a schema from a database table?

    Hi,
    I want to create an XML file from a database table (which has over 600 columns) using XML schema (.xsd file). I want to know the best way to do this.
    The output XML file is NOT a direct data dump from the DB table, there�re some logic around it, such as the XML file has some hierarchy with repeating tags.
    I have done this using JAXB by creating Java classes form XML schema, but I don�t want to map 600 DB columns to these Java classes manually, and loop through the record set to create repeating tags.
    I know there are few tools around now like MapForce (Altova), how do people do these now?
    Thanks,
    Chandi

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

  • How to validate the Xml File With Java

    Hi,
    Can pls tell me. I want to validate the XML File for the Some Mandartory TAG. if that if Tag null i want to generate error xml file with error and i want move another folder with java. pls help me as soon as possible

    Use a validating parser (any recent Xerces, for one) and switch on the validation feature. Very much vendor-specific, so look at the docs of your parser. Oh, you do have a schema for these documents, don't you?

  • I am in hurry,how to save  the xml file without attributes

    i have the following xml file with attributes,
    <?xml version="1.0"?>
    <Ve2.Configuration>
         <Ve2.Displaymanager>
              <type type="combobox">eVeDisplayStandardType</type>
              <setCounter type="bool">false</setCounter>
              <frames type="textfield">20</frames>
         </Ve2.Displaymanager>
    </Ve2.Configuration>
    but i want to save it without attributes, that means, my saved xml file look like this.:
    <?xml version="1.0"?>
    <Ve2.Configuration>
         <Ve2.Displaymanager>
              <type >eVeDisplayStandardType</type>
              <setCounter >false</setCounter>
              <frames20</frames>
         </Ve2.Displaymanager>
    </Ve2.Configuration>
    how can i do it with java.

    If you know the format of the XML file, then you can write a straight forward XSL file to transform it.
    Paul
    www.codetelligence.com

  • File Adapter : read XML file with data validation and file rejection ?

    Hello,
    In order to read a XML file with the file adapter, I have defined a XSD that I have imported to my project.
    Now the File Adapter reads the file correctly but it does not give an error when:
    - the data types are not valid. Ex: dateTime is expected in a node and a string is provided
    - the XML file has invalid attributes.
    How can I manage error handling for XML files ?
    Should I write my own Java XPath function to validate the file after is processed ? (here is an example for doing this : http://www.experts-exchange.com/Web/Web_Languages/XML/Q_21058568.html)
    Thanks.

    one option is to specify validateXML on the partnerlink (that describes the file adapter endpoint) such as shown here
    <partnerLinkBinding name="StarLoanService">
    <property name="wsdlLocation"> http://<hostname>:9700/orabpel/default/StarLoan/StarLoan?wsdl</property>
    <property name="validateXML">true</property>
    </partnerLinkBinding>
    hth clemens

  • How to retrieve xml file from BLOB and display on browser with css/xslt

    Hi All,
    I am new to xml. I am storing my xml file into BLOB in database. Now in my jsp page I want to retrieve this xml file from BLOB and display in HTML/CSS/XSLT form...
    Pl. guide me.. any docs..?? Logic...??
    Thanks in Advance.
    Sandeep Oza

    Hello Sandeep!
    I'm not familiar with jsp but logic should be as follows:
    -in jsp page instantiate XML parser
    -load specified BLOB into parser
    Now you may traverse the XML tree or you might load XSL file and use transform method to transform XML according to XSL file.
    I have an example where I'm selecting XML straight from relational database and then transform it using XSL into appropriate HTML output, but it's written in PSP.
    You can try http://www.w3schools.com/default.asp for basics on XML, CSS, XSL. It's easy to follow with good examples.
    Regards!
    miki

  • Open XML file with user default browser and not the default editor.

    Hi,
    I'm writing a java program that appends numerous XML files together. The result is a NEW well formed XML document. Since i have an XSLT that performs several UI modifications on this xml file, the file extension must remain '.xml'. I need to open this xml file with the users default web browser. The problem is that:
    Runtime.getRuntime().exec(cmd);
    ....opens the xml file with the users default program for opening xml files which in my case is Oxygen. I want to force java to open this xml file with the users default web browser and nothing else.
    I guess i need the Windows command to perform the 'open with' feature but i have no idea what that command is or how to find it.
    Any ideas?
    Thanks,
    Varun Singh
    Edited by: Jagara00 on Jul 2, 2009 3:49 PM

    sabre150 wrote:
    Jagara00 wrote:
    Your right, but my question relates to the java issue and not the XSLT aspect of the problem. I am looking for a java solution for reasons i will no go into here. You have lost me.Me too.
    People do not often ask questions (or make challenges or observations) idly for the sake of 'theory'. It is most useful to explain to the best of your ability.
    As to
    "Since the Desktop class was only released with SE 6 I am forced to find another alternative. "
    There is an 'alternative'. You can import it into a 1.5 project. It was available as a free standing API before 1.6 - through JDIC. See [https://jdic.dev.java.net/documentation/Examples.html|https://jdic.dev.java.net/documentation/Examples.html] for more info.
    Edit 1:
    To a later reply
    "Do u .."
    ..want to spell incorrectly when you get frustrated?
    "..do not wish to.."
    ..get any help? That is the way you are heading.
    Edited by: AndrewThompson64 on Jul 3, 2009 9:27 AM

  • Create xml file with nested internla table or with header & item tables

    Hi I have a requirement like, I need to create an xml file for header and item details. For 1 header there may be multiple line items.
    I did search in forums some where I came to know that we can use XSL:IF to achieve this. but I could not able to do this.
    I tried with using nested internal tables also but now luck.
    can anybody please suggest how can we create xml for header and item detials.
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
      xmlns:asx="http://www.sap.com/abapxml"
      exclude-result-prefixes="asx"
    >
    <xsl:template match="/">
      <OrbisomRequest>
        <xsl:attribute name="Version">
          <xsl:value-of select="11.1"/>
        </xsl:attribute>
        <xsl:attribute name="IssuerID">
          <xsl:value-of select="1"/>
        </xsl:attribute>
        <xsl:for-each select="asx:abap[1]/asx:values[1]/T_FINAL[1]/*">
    <CreateApprovedPurchaseRequest
           RerquestID="{VBLNR}"
           CommonName="User1"
           Amount="{WRBTR}"
           Comment="TestComment"
           CurrencyCode="978"
           PurchaseType="All"
           SupplierName="All"
           VCardAlias="PurchaseCard"
           ValidFrom="1M"
           CurrencyType="B">
                    <CDFs>
                      <Invoice> <xsl:value-of select="BELNR"/> </Invoice>
                      <Amount> <xsl:value-of select="WRBTR"/> </Amount>
                    </CDFs>
          </CreateApprovedPurchaseRequest>
        </xsl:for-each>
      </OrbisomRequest>
    </xsl:template>
    </xsl:transform>
    here belnr and wrbtr will be my item details. for each payment document I can have multiple invoices. in CDF I need to display the invoices for that particular payment document.
    what conditions can I put there before CDFs to make the item internal table to loop based on header internal table.
    Regards,
    Ranganadh.

    Looks like you have already created the transformation "Z_ID"
    Take a look at the following thread, it answers many of the questions you have asked:
    [ABAP data to XML conv with UTF-8 encoding and custom namespace|Re: ABAP data to XML conv with UTF-8 encoding and custom namespace;
    Che

  • Create xml file with values from context

    Hi experts!
    I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
    Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
    Is there any standard used code to do this??
    If not how can i do this???
    Thanx in advance!!!
    P.S. Points will be rewarded to all usefull answers.
    Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
    Please stop this P.S. nonsense!

    Hi,
    you need to create three util class for that:-
    XMLHandler
    XMLParser
    XMLBuilder
    for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
    And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
    Code for XMLBuilder:-
    Created on Apr 4, 2006
    Author-Anish
    This class is to created for having function for to build XML
    and to get EncodedXML
      and to get formated date
    package com.idb.events.util;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import com.idb.events.Event;
    public class XMLBuilder {
    This attribute represents the XML version
         private static final double VERSION_NUMBER = 1.0;
    This attribute represents the encoding
         private static final String ENCODING_TYPE = "UTF-16";
         /*Begin of Function to buildXML
    return: String
    input: Event
         public String buildXML(Event event) {
              StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
              xmlBuilder.append(VERSION_NUMBER);
              xmlBuilder.append("\" encoding=\"");
              xmlBuilder.append(ENCODING_TYPE);
              xmlBuilder.append("\" ?>");
              xmlBuilder.append("<event>");
              xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
              xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
              xmlBuilder.append("</event>");
              return xmlBuilder.toString();
         /End of Function to buildXML/
         /*Begin of Function to get EncodedXML
    return: String
    input: String,String
         public String getEncodedXML(String xmlString, String tag) {
              StringBuffer begin = new StringBuffer("");
              if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
                   begin.append("<").append(tag).append(">");
                   begin.append("<![CDATA[");
                   begin.append(xmlString).append("]]>").append("</").append(
                        tag).append(
                        ">");
              return begin.toString();
         /End of Function to get EncodedXML/
         /*Begin of Function to get formated date
    return: String
    input: Date
         private final String formatDate(Date inputDateStr) {
              String date;
              try {
                   SimpleDateFormat simpleDateFormat =
                        new SimpleDateFormat("yyyy-MM-dd");
                   date = simpleDateFormat.format(inputDateStr);
              } catch (Exception e) {
                   return "";
              return date;
         /End of Function to get formated date/
    Code for XMLParser:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLParser {
    Enables namespace functionality in parser
         private final boolean isNameSpaceAware = true;
    Enables validation in parser
         private final boolean isValidating = true;
    The SAX parser used to parse the xml
         private SAXParser parser;
    The XML reader used by the SAX parser
         private XMLReader reader;
    This method creates the parser to parse the user details xml.
         private void createParser()
              throws SAXException, ParserConfigurationException {
              // Create a JAXP SAXParserFactory and configure it
              SAXParserFactory saxFactory = SAXParserFactory.newInstance();
              saxFactory.setNamespaceAware(isNameSpaceAware);
              saxFactory.setValidating(isValidating);
              // Create a JAXP SAXParser
              parser = saxFactory.newSAXParser();
              // Get the encapsulated SAX XMLReader
              reader = parser.getXMLReader();
              // Set the ErrorHandler
    This method is used to collect the user details.
         public Event getEvent(
              String newsXML,
              XMLHandler xmlHandler,
              IWDMessageManager mgr)
              throws SAXException, ParserConfigurationException, IOException {
              //create the parser, if not already done
              if (parser == null) {
                   this.createParser();
              //set the parser handler to extract the
              reader.setErrorHandler(xmlHandler);
              reader.setContentHandler(xmlHandler);
              InputSource source =
                   new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
              reader.parse(source);
              //return the results of the parse           
              return xmlHandler.getEvent(mgr);
    Code for XMLHandler:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    Created on Apr 12, 2006
    Author-Anish
    *This handler class is created to have constant value for variables and function for get events,
        character values for bean variable,
        parsing thr date ......etc
    package com.idb.events.util;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Locale;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    import java.util.*;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLHandler extends DefaultHandler {
         private static final String TITLE = "title";
         private static final String ORGANIZER = "organizer";
         IWDMessageManager manager;
         private Event events;
         private String tagName;
         public void setManager(IWDMessageManager mgr) {
              manager = mgr;
    This function is created to get events
         public Event getEvent(IWDMessageManager mgr) {
              manager = mgr;
              return this.events;
    This function is created to get character for setting values through event's bean setter method
         public void characters(char[] charArray, int startVal, int length)
              throws SAXException {
              String tagValue = new String(charArray, startVal, length);
              if (TITLE.equals(this.tagName)) {
                   this.events.setTitle(tagValue);
              if (ORGANIZER.equals(this.tagName)) {
                   String orgName = tagValue;
                   try {
                        orgName = getOrgName(orgName);
                   } catch (Exception ex) {
                   this.events.setOrganizer(orgName);
    This function is created to parse boolean.
         private final boolean parseBoolean(String inputBooleanStr) {
              boolean b;
              if (inputBooleanStr.equals("true")) {
                   b = true;
              } else {
                   b = false;
              return b;
    This function is used to call the super constructor.
         public void endElement(String uri, String localName, String qName)
              throws SAXException {
              super.endElement(uri, localName, qName);
         /* (non-Javadoc)
    @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
    This function is used to call the super constructor.
         public void fatalError(SAXParseException e) throws SAXException {
              super.fatalError(e);
    This function is created to set the elements base on the tag name.
         public void startElement(
              String uri,
              String localName,
              String qName,
              Attributes attributes)
              throws SAXException {
              this.tagName = localName;
              if (ROOT.equals(tagName)) {
                   this.events = new Event();
         public static void main(String a[]) {
              String cntry = "Nigeria";
              XMLHandler xml = new XMLHandler();
              ArrayList engList = new ArrayList();
              engList = xml.getCountries();
              ArrayList arList = xml.getArabicCountries();
              int engIndex = engList.indexOf(cntry);
              System.out.println("engIndex  :: " + engIndex);
              String arCntryName = (String) arList.get(engIndex);
              System.out.println(
                   ">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
    Hope that may help you.
    If need any help , you are most welcome.
    Regards,
    Deepak

  • How to parse XML file with namesapce?

    Hi,
       I am trying to parse an xml file having namespace. But no data is returned.
    Sample Code:
    public class XMLFileLoader
    var xml:XML = new XML();
    var myXML:XML = new XML();
    var XML_URL:String = "file:///C:/Documents and Settings/Administrator/Desktop/MyData.xml";
    var myLoader:URLLoader = null;
    public function XMLFileLoader()
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    myLoader= new URLLoader(myXMLURL);
    myLoader.addEventListener(Event.COMPLETE,download);
    public function download(event:Event):void
    myXML = XML(myLoader.data);
    var ns:Namespace=myXML.namespace("xsi");
    for(var prop:String in myXML)
         trace(prop);
    //Alert.show(myXML..Parameters);
    //trace("Data loadedww."+myXML.toString());
    //Alert.show(myXML.DocumentInfo.attributes()+"test","Message");
    The XML Contains the following format.
    <Network xmlns="http://www.test.com/2005/test/omc/conf"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.test.com/2005/test/omc/conf/TestConfigurationEdition3proposal4.xsd">
        <TestDomain>
          <WAC>
            <!--Release Parameter  -->
            <Parameters ParameterName="ne_release" OutageType="None"
                        accessRight="CreateOnly" isMandatory="true"
                        Planned="false"
                        Reference="true" Working="true">
              <DataType>
                <StringType/>
              </DataType>
              <GUIInfo graphicalName="Release"
                       tabName="All"
                       description="Describes the release version of the managed object"/>
            </Parameters>
    </TestDomain>
    </Network>
    Any sample code how to parse this kind of xml file with namespaces...
    Regards,
    Purushotham

    i have exactly the same problem with KXml2, but using a j2me-polish netbeans project.
    i've tried to work around with similar ways like you, but none of them worked. now i've spent 3 days for solving this problem, i'm a bit disappointed :( what is wrong with setting the downloaded kxml2 jar path in libraries&resources?
    screenshot

  • LPX-00004 - Problems while inserting xml files in a xmltype column

    I've faced two problems while trying to insert xml files into my table containing a xmltype column:
    create table xml_test (id number(20),content xmltype)
    I use following java code for writing xml docs into db:
         conn.setAutoCommit(false);
         OraclePreparedStatement stmt = (OraclePreparedStatement)
              conn.prepareStatement("INSERT INTO xml_test (id,content) VALUES(?,?)");
         File file = new File(file1);
         InputStream in1 = new FileInputStream(file1);
         Reader r1 = new BufferedReader(new InputStreamReader(in1, "UTF-8"));
         int len = 0;
         StringBuffer text = new StringBuffer();
         while ((len = r1.read()) != -1) {
              text.append((char) len);
         in1.close();
         r1.close();
         XMLType poXML1 = XMLType.createXML(conn, text.toString());
         for (int i = 1; i <= 1; i++) {
              stmt.setInt(1, i);
              stmt.setObject(2, poXML1);
              stmt.execute();
         conn.commit();
    1. problem: occures only if a xml schema has been assoicated to the specific xmltype column. it seems that the length of a specific xml tag in the document is limited. but why?
    java.sql.SQLException: ORA-22814: attribute or element value is larger than specified in type
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
         at test.insertXML(test.java:84)
         at test.main(test.java:261)
    hier the xml-schema of the xmltype column "content":
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="AUTOR-ID" type="xs:string"/>
         <xs:element name="BODY" type="xs:string"/>
         <xs:element name="CONTENT">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="METADATEN"/>
                        <xs:element ref="BODY"/>
                   </xs:sequence>
                   <xs:attribute name="content-id" type="xs:string" use="required"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="DATUM" type="xs:string"/>
         <xs:element name="KEYWORD" type="xs:string"/>
         <xs:element name="METADATEN">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="DATUM"/>
                        <xs:element ref="TITEL" maxOccurs="unbounded"/>
                        <xs:element ref="KEYWORD" maxOccurs="unbounded"/>
                        <xs:element ref="AUTOR-ID"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="TITEL" type="xs:string"/>
    </xs:schema>
    2. problem: hier i have no idea what is happening ... please help
    java.sql.SQLException: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00004: internal error "MultiChar overflow"
    Error at line 61
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
         at test.insertXML(test.java:53)
         at test.main(test.java:259)

    It's hard for me to tell you more without seeing your instance data, but for problem #1, if you look at the underlying SQL types being generated by your schema, you will see that the default SQL mapping for a "string" in your schema is a VARCHAR2(4000) (and I believe this would be only 2000 for a varying width character set like UTF8).
    You can specify that you wish this column to be mapped as a CLOB in your schema if this is the problem. Also note that there is a 64K limit on the size of an individual node in XMLType.

Maybe you are looking for

  • Exchange Rate problem at the time of sales Invoice

    hi experts Exchange rate type AR is made for Sales at the time Sales Order amount is being picked from exchange rate type AR but at the time of Sales Invoice the amount is being picked from Standard Rate Type M at the header level but at the item lev

  • When deleting an e-mail on Gmail, the display reverts to the Gmail log-in window

    When deleting an e-mail on Gmail, the display reverts to the Gmail log-in window. Internet Explorer does not have this problem. Firefox did not have this problem until a few weeks ago. Firefox version 1.9.2 3855

  • DMS server not dispalying attached file

    Hello gurus I have AIX and DB2 platform of Prod server and we had cerate A DMS on Solman and platform is DB2 with Windows 2003 64 Bit when user was to see attach file from DMS it give error your are not authorizer and other scenario if i access in th

  • Serious AFP issues

    Running 10.5.5 on a brand new xServe. Seriously.. what is wrong with leopard server? This is my first experience with it and I am not happy. I am simply running AFP with 4 share points. No other services. Clients get disconnected for no reason. Clien

  • ITEM TEXT Not Pulling in to Sale order Item Level

    Hello All, I have maintained ITEM Text in VD52 CMIR, when i try to create Sale order  and trying to check the item text at item level but it is not pulling, please suggest me where i need to correct. Thanks in advace, Suma