Preventing proxy sub structure to generate xml

Hi,
i have a proxy with a deep structure.
I want to prevent a sub structure to generate a empty xml element like <element-x/> because this will give an error during mapping.
How can i do that?
thanks,
Peter Ha

You can suppress that optional element in the mapping tool of XI using a node standard function (don't know exactly which...). There are many ways to do that but one I can thing right now could be to do a check on the context of that particular element and based on the results of that check generate or not generate the element.
Hope that makes sense..
Cheers,
Roberto
Message was edited by: Roberto Viana

Similar Messages

  • How to add doctype when generating XML from an arbitrary data structure

    I was reading SUN's tutorial "Working with XML - PART IV: Using XSLT". Inside this tutorial, in 3, it talks about how to generate XML from an arbitrary data structure making use of a XMLReader and a Transformer. The example only shows adding elements. Is there a way to add DTD information in the XML generated, i.e. <!DOCTYPE ... >? What APIs can I use?
    Thanks,
    Alex

    The simplest way seems to me is to use a XSL file for that. The <xsl:output> attributes doctype-system and doctype-public generate the DTD declaration <!DOCTYPE YOUR_ROOT SYSTEM "yourDTDfile.dtd"> and <!DOCTYPE YOUR_ROOT PUBLIC "yourDTDfile.dtd">, respectively.
    When calling transformerInstance.transform() the XSLT processor performs the identity transformation - it just copies elements, attributes, content, processing instructions and comments to the result stream.
    If you're using an xsl file for your transformation already, simply add <xsl:output doctype-system="yourDTDfile.dtd"/> to your existing XSL file.
    If you're only using the identity transformation you'd need to change the line of code where you obtain the transformer instance from the TransformerFactory to:
    t_factory.newTransformer(new StreamSource("test.xsl"));
    and use this as test.xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <xsl:output doctype-system="yourDTDfile.dtd"/>
       <!-- this is the identity transformation -->
       <xsl:template match="*|@*|comment()|processing-instruction()|text()">
          <xsl:copy>
             <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
          </xsl:copy>
       </xsl:template>
    </xsl:stylesheet>Good luck.

  • How to generate XML from relational data : PL/SQL or Java

    I'm new to Oracle XML and would appreciate some advice. I've been asked to generate XML documents from data stored in relational tables. The XML documents must be validated against a DTD. We will probably want to store the XML in the database.
    I've seen a PL/SQL based approach as follows :
    1.Mimic the structure of the DTD using SQL object types 2.Assign the relational data to the object type using PL/SQL as required
    3.Use the SYS_XMLGEN package to render the required XML documents from the SQL objects
    However, creating the object types seems to be quite time consuming (step 1 above) for anything other than the simplest of XML documents.
    I've also seen that there is the Java based approach, namely :
    1. Use the XML generator to build Java classes based on a DTD.
    2. Use these classes to build the required XML
    On the face of it, the Java based approach seems simpler. However, I'm not that familiar with Java.
    Which is the best way to proceed ? Is the PL/SQL based approach worth pursuing or should I bite the bullet and brush up my Java ?
    Is it possible to use a combination of PL/SQL and Java to populate the dtd generated java classes (step 2 of the Java approach) to reduce my learning curve ?
    Thanks in advance

    To help answer your questions:
    1) Now, in 9iR2, you can use SQL/XML as another choice.
    2) You can also use XSU to generate the XML and use XSLT to transform it to a desired format instead of using object views if possible.
    3) XDK provide Class generator support to populate XML data to Java classes.

  • Sender FCC , problem with Repeating Field under a Sub-structure

    Hi,
    I have an Input File as
    D,TH_ ,10/31/2008,ABC,pieces
    PF, 10/31/2008,11/2/2008,11/3/2008,11/4/2008
    P,mat,CS,100,120,130,125,150,170,120
    P,mat,CS,100,120,100,110,140,120,110
    I need to Implement an FCC to convert this to
    a Structure like this
      Recorset
        Header           1....1
            Unique Id
            date Time
            CustomerCode
            Code
            Unit
        Dates         1
         date          1....n
        Products       1....n
          product      1
          unit         1
          quantity     1.....n
    This this is a Variable recordset type ( i.e each ROW has a Different Structure) the following keys D,PF,P  are defined, for the header, dates, and Product Information.
    The Following FCC parameters are applied
    Document Name :  MT_FILE_INPUt
    Document NameSpace = http://xyz.com
    Recordset Name = "Recordset"
    Recordset structure = Header,1,Dates,1,Products,*
    keyname              = Key
    Keytype               = String
    Header.FieldSeprator = ,
    Header.FieldName = Unique Id,date Time,CustomerCode,Code,unit
    Header.keyValue = 'H'
    Dates.FieldSeprator = ,
    Dates.Fieldname   = 'date'
    Date.keyValue    = 'PF'
    Products.FieldSeprator = ,
    Product.FieldName =  product,unit,quantity
    Product.KeyValue  = 'P'
    Now the Problem is as Follows:
    1) I have a Repeating Field Quantity under the Product and Date under the Dates Sub-structure,  This is not getting Repeated at all.
    Is there a Way to achieve the same
    2) Another Point is That, i do not want to take the key Value in the XML structure after converion, is there a way to avoid it
    Please let me know if any blogs are available
    Any help would be appreciated.
    Thanks,
    Best Regards
    Abhishek

    can u try.. i haven't tired this.
    quantity is occuring multiple times, but if that is fixed no# of occurance,, you can can try with this?
    P,mat,CS,100,120,130,125,150,170,120
    Product.FieldName = product,unit,quantity,quantity,quantity,quantity,quantity,quantity
    let me try ..
    As long as the quanitfy defined under Product.FieldName are more than the input msg quantity values (100,120..), you will be safe...
    Edited by: Anand on Oct 31, 2008 3:54 PM

  • XML Elements Ordering in Generated XML Output

    I have a requirement where I need the xml element tags to appear in the generated xml output in the same order as in data template definition but in my case this is not happening. I have one master group - Customer and two subgroups - BillingAddress and ShipToAddress. The subgroups appear below some master elements eg. Contact but above other master elements eg. Telephone . However when the xml output is finally generated all the Master Elements appear first followed by the subgroup elements. Does anyone know how I can rectify this?
    See below:
    my data template structure is as follows:
    - <group name="Customer" dataType="varchar2" source="Q_MASTER_FILE_CUST">
    <element name="CustomerID" datatype="varchar2" value="CUSTOMER_NUM" />
    <element name="CustomerTaxID" datatype="varchar2" value="TAXPAYER_ID" />
    <element name="CompanyName" datatype="varchar2" value="COMPANY_NAME1" />
    <element name="Contact" datatype="varchar2" value="CONTACT_NAME" />
    - <group name="BillingAddress" dataType="varchar2" source="Q_MF_CUST_BILLTO">
    <element name="BuildingNumber" datatype="varchar2" value="BUILD_NUM1" />
    <element name="StreetName" datatype="varchar2" value="STREET_NAME1" />
    <element name="AddressDetail" datatype="varchar2" value="ADDRESS_STYLE1" />
    <element name="City" datatype="varchar2" value="CITY1" />
    <element name="PostalCode" datatype="varchar2" value="POSTAL_CODE1" />
    <element name="Region" datatype="varchar2" value="COUNTY1" />
    <element name="Country" datatype="varchar2" value="COUNTRY1" />
    </group>
    - <group name="ShipToAddress" dataType="varchar2" source="Q_MF_CUST_SHIPTO">
    <element name="BuildingNumber" datatype="varchar2" value="BUILD_NUM2" />
    <element name="StreetName" datatype="varchar2" value="STREET_NAME2" />
    <element name="AddressDetail" datatype="varchar2" value="ADDRESS_STYLE2" />
    <element name="City" datatype="varchar2" value="CITY2" />
    <element name="PostalCode" datatype="varchar2" value="POSTAL_CODE2" />
    <element name="Region" datatype="varchar2" value="COUNTY2" />
    <element name="Country" datatype="varchar2" value="COUNTRY2" />
    </group>
    <element name="Telephone" datatype="varchar2" value="PHONE_NUMBER" />
    <element name="Fax" datatype="varchar2" value="FAX1" />
    <element name="Email" datatype="varchar2" value="EMAIL_ADDRESS" />
    <element name="WebSite" datatype="varchar2" value="URL" />
    </group>
    </group>
    My XML Output is as follows:
    <Customer>
    <CustomerID>1000</CustomerID>
    <CustomerTaxID>65-94238654</CustomerTaxID>
    <CompanyName>World of Business</CompanyName>
    <Contact>MS. Jolene Smith-Kelly</Contact>
    <Telephone>8441212</Telephone>
    <Fax />
    <Email />
    <WebSite />
    - <BillingAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </BillingAddress>
    - <ShipToAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </ShipToAddress>
    </Customer>
    It should be as follows:
    <Customer>
    <CustomerID>1000</CustomerID>
    <CustomerTaxID>65-94238654</CustomerTaxID>
    <CompanyName>World of Business</CompanyName>
    <Contact>MS. Jolene Smith-Kelly</Contact>
    - <BillingAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </BillingAddress>
    - <ShipToAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </ShipToAddress>
    <Telephone>8441212</Telephone>
    <Fax />
    <Email />
    <WebSite />
    </Customer>
    is anyone able to advise?
    Rani

    If you know the changes necessary then you could write an XSL transformation to do them. But a generalized piece of code that examined an XML document and a schema, then produced a corrected document, would be quite difficult to write.

  • ABAP Proxy Import Structure

    ok. Guys and gals I have limited ABAP expierence and have a simple question around loops. I have an ABAP proxy setup that receives an XML file and stores the contents in the INPUT method. The two structures under Item I am working with are I_HEADER and I_ITEM.
    I can access the values in I_HEADER with something like the following:
    CLEAR w_header.
    w_header-guid = v_header_guid.
    w_header-description = input-I_HEADER-DESCRIPTION.
    w_header-process_type = input-I_HEADER-PROCESS_TYPE.
    w_header-posting_date = sy-datum.
    now I currently have been testing the proxy with the following for my i_item structure. This is hard coded but I would like to import from the INPUT structure.
    CLEAR w_item.
    w_item-guid = v_item_guid.
    w_item-parent = v_header_guid.
    w_item-product = '00000000000000000000000000000000'.
    w_item-description = 'Test Item Description'.
    APPEND w_item TO i_item.
    How would I setup my loop to read the I_ITEM-ITEM table and populate with the imported values instead of hard coded. For instance using this example I would need the values from I_ITEM-ITEM-DESCRIPTION and I_ITEM-ITEM-PRODUCT?
    Thank You.

    Hi Joe,
    You have to use to loops one for header and another for Item details in that header something like this
    loop at it_header into wa_header
         loop at it_item into wa_tem
          endloop.
    endloop.

  • Trouble including registered XML Schema in generated XML

    Hello,
    I'm new to XMLDB, and find myself wanting to build an XML document that conforms
    to a paricular XML schema. I'm looking for help in "passing" the shema into the
    xml query, and for advice (i may not be going about things in the best way possible).
    my data comes from three different sources: deliveries, origin of deliveries (warehouse),
    and a user-defined parameter (number of vehicles). I am putting the xml data together via union statements.
    this is slightly undesireable due to the limitations on union (no xmltypes, no clobs)
    and the size limitation of the varchar datatype. If there is a better way of structuring
    the end XML document (all three sources, one output record) then please advise me.
    I am having issues "passing" the registered XML schema to the SYS_XMLGEN function,
    so if you see where I've made a mistake, please point it out.
    Last thing, Oracle version: 9.2.0.4.0 (aka 9iR2)
    --Register a new XML schema
    --Since this is a GLOBAL schema, register it as privileged user (SYS).
    DECLARE
           vrp varchar2(10000) :=
    '<xs:schema targetNamespace="http://example.com/vrp.xsd"
        xmlns:vrp="http://example.com/vrp.xsd"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified">
        <xs:complexType name="VehicleRoute">
            <xs:sequence>
                <xs:element name="Stops" type="vrp:Stops" minOccurs="1" maxOccurs="1" />
                <xs:element name="Vehicles" type="xs:string" minOccurs="1" maxOccurs="1" />
                <xs:element name="Warehouse" type="vrp:Warehouse" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Stops">
            <xs:sequence>
                <xs:element name="Stop" type="vrp:Stop" minOccurs="1" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Stop">
            <xs:sequence>
                <xs:element name="Documents" type="vrp:Documents" minOccurs="1" maxOccurs="1" />
                <xs:element name="Stop_Address" type="xs:string" minOccurs="1" maxOccurs="1" />
                <xs:element name="Stop_Minutes" type="xs:double" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Documents">
            <xs:sequence>
                <xs:element name="Document" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Warehouse">
            <xs:sequence>
                <xs:element name="Warehouse_Address" type="xs:string" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
        <xs:element name="Vehicle_Route" type="vrp:VehicleRoute" />
    </xs:schema>';  
    begin
      --"CUSTOM" is the name of my database user - the SCHEMA in which this development should occur.
         dbms_xmlschema.registerschema('http://example.com/vrp.xsd', vrp, false, false, false, false, false, 'CUSTOM');
    END;Here is the XML schema (as viewed by the 'CUSTOM' user):
    <xs:schema targetNamespace="http://example.com/vrp.xsd" xmlns:vrp="http://example.com/vrp.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:oraxdb="http://xmlns.oracle.com/xdb" oraxdb:flags="17" oraxdb:schemaURL="http://example.com/vrp.xsd" oraxdb:schemaOwner="CUSTOM" oraxdb:numProps="10">
      <xs:complexType name="VehicleRoute" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Stops" type="vrp:Stops" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2225" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
          <xs:element name="Vehicles" type="xs:string" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2226" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
          <xs:element name="Warehouse" type="vrp:Warehouse" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2227" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Stops" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Stop" type="vrp:Stop" minOccurs="1" maxOccurs="unbounded" oraxdb:propNumber="2228" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Stop" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Documents" type="vrp:Documents" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2229" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
          <xs:element name="Stop_Address" type="xs:string" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2230" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
          <xs:element name="Stop_Minutes" type="xs:double" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2231" oraxdb:global="false" oraxdb:memType="2" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Documents" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Document" type="xs:string" minOccurs="1" maxOccurs="unbounded" oraxdb:propNumber="2232" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Warehouse" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Warehouse_Address" type="xs:string" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2233" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="Vehicle_Route" type="vrp:VehicleRoute" oraxdb:propNumber="2224" oraxdb:global="true" oraxdb:SQLType="CLOB" oraxdb:SQLName="Vehicle_Route" oraxdb:memType="258"/>
    </xs:schema>Here is sample data for reproducing what I'm seeing:
    --Create the "document" table
    create table vrp_document
    (document_num varchar2(10),
    document_minutes number(10),
    document_address varchar2(30));
    --Sample "document" data
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST1', 30, '1234 ELM ST');
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST2', 20, '1234 ELM ST');
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST3', 40, '1234 MAPLE ST');
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST3', 15, '1234 YEW ST');
    --Create the "warehouse" table
    create table vrp_warehouse
    (warehouse_id varchar2(3),
    warehouse_address varchar2(30));
    --Sample "warehouse" data
    insert into vrp_warehouse (warehouse_id, warehouse_address)
    values ('100', '900 MY OWN WAY');Query to produce XML
    Please note, I realize that for the data provided, the aggregations (and sub queries)
    are a little over the top. They are however necessary for my actual data set.
    SELECT SYS_XMLGEN(xmlagg(XMLTYPE(xmlroute)),  xmlformat.createFormat('Vehicle_Route')).getStringVal() Delivery_XML_Data
    FROM (SELECT XMLELEMENT("Stops",
              XMLAGG(XMLELEMENT("Stop",    
              XMLCONCAT(
                XMLELEMENT("Documents",
                    xmlagg(xmlelement("Document", t.document))),
                  xmlforest(t.document_address "Stop_Address",  
                 SUM(t.document_minutes) "Stop_Minutes"))))).getStringVal() AS xmlroute
    from     (select   s.document_num document, 
                       s.document_address,
                       sum(s.document_minutes) document_minutes
              from     vrp_document s       
              group by s.document_num, s.document_address) t
    GROUP BY t.document_address
    UNION
    SELECT   XMLELEMENT("Warehouse",
             xmlforest(
              w.warehouse_address "Warehouse_Address")).getstringval()
    from     vrp_warehouse w
    WHERE    w.warehouse_id = '100'
    union
    select   xmlelement("Vehicles", '&Number_Of_Vehicles').getstringval()
    FROM     dual) g;This query produces the following (Note. Answer "1" or any other integer for &Number_Of_Vehicles):
    The only other thing I want is to mention the above schema (that is, xmlns:http://example.com/vrp) or however that goes.
    I realize I can "fudge" this by assigning the attribute for various elements, but I think the "right" way would be to modify that call to createFormat().
    <?xml version="1.0"?>
    <Vehicle_Route>
    <Stops>
      <Stop>
        <Documents>
          <Document>TEST1</Document>
          <Document>TEST2</Document>
        </Documents>
        <Stop_Address>1234 ELM ST</Stop_Address>
        <Stop_Minutes>50</Stop_Minutes>
      </Stop>
      <Stop>
        <Documents>
          <Document>TEST3</Document>
        </Documents>
        <Stop_Address>1234 MAPLE ST</Stop_Address>
        <Stop_Minutes>40</Stop_Minutes>
      </Stop>
      <Stop>
        <Documents>
          <Document>TEST3</Document>
        </Documents>
        <Stop_Address>1234 YEW ST</Stop_Address>
        <Stop_Minutes>15</Stop_Minutes>
      </Stop>
    </Stops>
    <Vehicles>1</Vehicles>
    <Warehouse>
      <Warehouse_Address>900 MY OWN WAY</Warehouse_Address>
    </Warehouse>
    </Vehicle_Route>I have tried various permutation of the following with no success:
    Currently, the error is something serious:
    ORA-00600: internal error code, arguments: [kkdotat1], [], [], [], [], [], [], []
    00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
    *Cause:    This is the generic internal error number for Oracle program
    exceptions.     This indicates that a process has encountered an
    exceptional condition.
    *Action:   Report as a bug - the first argument is the internal error number
    SELECT SYS_XMLGEN(xmlagg(XMLTYPE(xmlroute)),  xmlformat.createFormat('Vehicle_Route', 'USE_GIVEN_SCHEMA', 'http://example.com/vrp.xsd', 'http://example.com/vrp.xsd')).getStringVal() Delivery_XML_Data
    . . .Edited by: user2316919 on Jan 21, 2010 3:46 PM

    Cannot find a cleanest solution:
    SQL>  select xmltype('<?xml version="1.0"?>'||
      2                  xmlelement("Vehicle_Route",
      3                     xmlattributes('http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi",
      4                                   'http://example.com/vrp.xsd' AS "xsi:schemaLocation"
      5                                   ),
      6                     xmlagg(xmltype(xmlroute))
      7                     ).extract('/*')
      8                  ) Delivery_XML_Data
      9   FROM (SELECT XMLELEMENT("Stops",
    10             XMLAGG(XMLELEMENT("Stop",    
    11             XMLCONCAT(
    12               XMLELEMENT("Documents",
    13                   xmlagg(xmlelement("Document", t.document))),
    14             xmlforest(t.document_address "Stop_Address",  
    15                SUM(t.document_minutes) "Stop_Minutes"))))).getStringVal() AS xmlroute
    16   from     (select   s.document_num document, 
    17                      s.document_address,
    18                      sum(s.document_minutes) document_minutes
    19             from     vrp_document s       
    20             group by s.document_num, s.document_address) t
    21   GROUP BY t.document_address
    22   UNION
    23   SELECT   XMLELEMENT("Warehouse",
    24             xmlforest(
    25              w.warehouse_address "Warehouse_Address")).getstringval()
    26    from     vrp_warehouse w
    27    WHERE    w.warehouse_id = '100'
    28    union
    29    select   xmlelement("Vehicles", '&Number_Of_Vehicles').getstringval()
    30    FROM     dual) g;
    Immettere un valore per number_of_vehicles: 1
    vecchio  29:   select   xmlelement("Vehicles", '&Number_Of_Vehicles').getstringval()
    nuovo  29:   select   xmlelement("Vehicles", '1').getstringval()
    DELIVERY_XML_DATA
    <?xml version="1.0"?><Vehicle_Route xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schema
    http://example.com/vrp.xsd">
      <Stops>
        <Stop>
          <Documents>
            <Document>TEST1</Document>
            <Document>TEST2</Document>
          </Documents>
          <Stop_Address>1234 ELM ST</Stop_Address>
          <Stop_Minutes>50</Stop_Minutes>
        </Stop>
        <Stop>
          <Documents>
            <Document>TEST3</Document>
          </Documents>
          <Stop_Address>1234 MAPLE ST</Stop_Address>
          <Stop_Minutes>40</Stop_Minutes>
        </Stop>
        <Stop>
          <Documents>
            <Document>TEST3</Document>
          </Documents>
          <Stop_Address>1234 YEW ST</Stop_Address>
          <Stop_Minutes>15</Stop_Minutes>
        </Stop>
      </Stops>
      <Vehicles>1</Vehicles>
      <Warehouse>
        <Warehouse_Address>900 MY OWN WAY</Warehouse_Address>
      </Warehouse>
    </Vehicle_Route>
    {code}
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • EBS-R12 Generate XML (with data) from Embedded Data Definition

    Hi
    I'm new to running XMLP/BIP in EBS.
    I have found the extensive set of data definitions and templates in EBS and they work great out of the box.
    I, however, need to make template modifications.
    To this end, a correctly structured XML data template - containing all the data fields - is needed for loading into the template-builder in Word.
    If for example I take the embedded R12 data definition - XLAJELINESRPT.xml - for Posted Payable Invoices, and load it into the template builder, it provides the structure of the data template and not the structure of the output XML data.
    I have tried several ways to run the Data definition through XMLP using the concurrent manager attempting to intercept the generated XML (with data) but it either completes the process and uses the linked output template - producing the PDF - or other output - or if I remove the (output template altogether) it fails with an error.
    Maybe I'm missing an obvious step, but there has to be a way of taking the very comprehensive Data Definitions embedded in R12 EBS and using them in custom report templates.
    If I've totally missed the point, please give me the steps to follow.
    Many thaks in anticipation.
    Mike MacMurray

    HI Mike,
    You cannot load your Data Template into the MS Word Template Builder plugin, as it cannot be run to generate XML this way.
    You have two options to get the data from an XML Publisher Report run as a concurrent program in EBS.
    1) Using the XML Publisher Administrator responsibility, set an end date for both the Data Defintion and Template Definitions associated with the XLAJELINESRPT report.
    2) Leave the concurrent program, Data Defintions and Template Definitions exactly as they are and run the report. Once the report has completed, select the Concurrent Request, click "Diagnostics" then click "View XML". This will open the XML in a new browser window. You can then right click, View Source and then save this document locally.
    You can then load this XML into the MS Word Template Builder and start building your template.
    I hope this helps.
    Regards,
    Cj

  • Generate xml using FOR XML PATH from table with hierarchy

    I need to create xml from a table like:
    EL1 EL2 EL3 Attr01 Attr02 Attr03 Attr04
    E10,    ,    ,a,b,c,d
    E10,E1010,    ,a,b,c,d
    E10,E1010,E101010,a,b,c,d
    E10,E1010,E101020,a,b,c,d
    E10,E1010,E101030,a,b,c,d
    E10,E1020,    ,a,b,c,d
    E10,E1020,E102010,a,b,c,d
    E20,    ,    ,a,b,c,d
    E20,E2010,    ,a,b,c,d
    E20,E2010,E201010,a,b,c,d
    E20,E2020,    ,a,b,c,d
    E20,E2020,E202010,a,b,c,d
    E20,E2020,E202020,a,b,c,d
    The hierarchy is EL1--EL2--EL3, and the 3 columns should be elements of xml;
    The other for columns Attr01,Attr02,Attr03,Attr04 should be attributes of xml;
    The actual table could have more than 500 rows(there are many values for El1,EL2,and EL3). 
    The expected xml should like:
    <root>
      <E10 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
        <E1010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E101010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E101020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E101030 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E1010>
        <E1020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E102010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E1020>
      </E10>
      <E20 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
        <E2010 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E201010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E2010>
        <E2020 Attr01="a" Attr02="b" Attr03="c" Attr04="d">
          <E202010 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
          <E202020 Attr01="a" Attr02="b" Attr03="c" Attr04="d" />
        </E2020>
      </E20>
    </root>
    I create a sample Src table:
    CREATE TABLE Src
    EL1 VARCHAR(10),
    EL2 VARCHAR(10),
    EL3 VARCHAR(10),
    Attr01 VARCHAR(10),
    Attr02 VARCHAR(10),
    Attr03 VARCHAR(10),
    Attr04 VARCHAR(10)
    GO
    INSERT INTO Src
    (EL1,EL2,EL3,Attr01,Attr02,Attr03,Attr04
     SELECT 'E10','','','a','b','c','d'
     UNION SELECT 'E10','E1010','','a','b','c','d'
     UNION SELECT 'E10','E1010','E101010','a','b','c','d'
     UNION SELECT 'E10','E1010','E101020','a','b','c','d'
     UNION SELECT 'E10','E1010','E101030','a','b','c','d'
     UNION SELECT 'E10','E1020','','a','b','c','d'
     UNION SELECT 'E10','E1020','E102010','a','b','c','d'
     UNION SELECT 'E20','','','a','b','c','d'
     UNION SELECT 'E20','E2010','','a','b','c','d'
     UNION SELECT 'E20','E2010','E201010','a','b','c','d'
     UNION SELECT 'E20','E2020','','a','b','c','d'
     UNION SELECT 'E20','E2020','E202010','a','b','c','d'
     UNION SELECT 'E20','E2020','E202020','a','b','c','d'
    GO
    I tried to use FOR XML PATH to generate xml for the sample data. When the records increase to a few hundreds, it's not a good idea.
    Here is my script:
    SELECT
    (SELECT Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101010'
    FOR XML PATH('E101010'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101020'
    FOR XML PATH('E101020'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E101030'
    FOR XML PATH('E101030'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E1010' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E1010'),TYPE
    ) AS 'node()'--1010
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E102010'
    FOR XML PATH('E102010'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E1020' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E1020'),TYPE
    ) AS 'node()'--1020
    FROM Src
    WHERE EL1 = 'E10' AND (EL2 ='' AND EL3 ='')
    FOR XML PATH('E10'),TYPE) 'node()'
    ,(SELECT Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E201010'
    FOR XML PATH('E201010'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E2010' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E2010'),TYPE
    ) AS 'node()'--2010
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E202010'
    FOR XML PATH('E202010'),TYPE
    ) AS 'node()'
    ,( SELECT
    Attr01 AS '@Attr01'
    ,Attr02 AS '@Attr02'
    ,Attr03 AS '@Attr03'
    ,Attr04 AS '@Attr04'
    FROM Src
    WHERE EL3 = 'E202020'
    FOR XML PATH('E202020'),TYPE
    ) AS 'node()'
    FROM Src
    WHERE EL2 = 'E2020' AND (EL1 <>'' AND EL3 ='')
    FOR XML PATH('E2020'),TYPE
    FROM Src
    WHERE EL1 = 'E20' AND (EL2 ='' AND EL3 ='')
    FOR XML PATH('E20'),TYPE) AS 'node()'
    FOR XML PATH(''),ROOT('root')
    If I get a few hundreds of rows, how huge the script should be. Does anyone have better solution for this? Thanks.
    Tao

    wBob,
    Thanks! And sorry for late feedback.
    The XSD requires the xml structures like the following
    <Schools>
    <School01>Some school</School01>
    <School02>Some other school</School02>
    </Schools>
    I have to use the number in the element name. 
    Right now I just use the nested FOR XML PATH, although I have to write thousand lines code.
    Thanks anyway.
    Tao
    Tao

  • How to generate xml file with multiple nodes using sqlserver as database in SSIS..

    Hi ,
    I have to generate the xml file using multiple nodes by using ssis and database is sqlserver.
    Can some one guide me on to perform this task using script task?
    sudha

    Why not use T-SQL for generating XML? You can use FOR XML for that
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Unable to Generate XML Schema

    Hi all,
               When i add a sales order it's giving an error like "Couldn't Generate XML schema"....can anybody pls give me some suggestions....i have tried all the possibilities but unable to rectify this error...
    <?xml version="1.0"?>
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
    <env:Body>
    <env:Fault>
    <env:Code>
    <env:Value>env:Receiver</env:Value>
    <env:Subcode>
    <env:Value>-2053</env:Value>
    </env:Subcode>
    </env:Code>
    <env:Reason>
    <env:Text xml:lang="en">Could not Generate XML Schema</env:Text>
    </env:Reason>
    <env:Detail>
    <Object>oDocuments</Object>
    <Object>oDocuments</Object>
    <ObjectIndex>1</ObjectIndex>
    <Command>AddObject</Command>
    <SessionID>2789C3B9-2E34-EC45-4F44-9E5F224CF30D</SessionID>
    </env:Detail>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    My coding for adding a sales order is given below:--
    Private Sub btnClick_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick.Click
            Dim oQuotationXml As Xml.XmlElement
            Dim oBpCode As Xml.XmlNodeList
            Dim oDocNo As Xml.XmlNodeList
            Dim oItemCode As Xml.XmlNode
            Dim oDocDate As Xml.XmlNode
            Dim oItemQuantity As Xml.XmlNode
            Dim oDocumentLines As Xml.XmlNode
            oQuotationXml = DIS.GetEmptySalesXml(SessionID)
            oDocNo = oQuotationXml.SelectNodes("//DocEntry")
            oDocNo.Item(0).InnerText = "29"
            oBpCode = oQuotationXml.SelectNodes("//CardCode")
            oBpCode.Item(0).InnerText = "C3456" 
            oDocDate = oQuotationXml.SelectSingleNode("//DocDueDate")
            oDocDate.InnerText = "20080909"
            oItemCode = oQuotationXml.SelectSingleNode("//ItemCode")
            oItemCode.InnerText = "A00006"
            oItemQuantity = oQuotationXml.SelectSingleNode("//Quantity")
            oItemQuantity.InnerText = "2"
            txtTmp.Text = oQuotationXml.OuterXml
            DIS.AddSalesOrder(SessionID, oQuotationXml.OuterXml)
    regards,
    shangai.

    Hi Mohan,
    I am facing a similar issue in creating XML from IDOC for MATMAS05, can you tell me how you fixed the issue? I am unable to follow your above comment about started with '\' in root? Can you tell me where was this please?
    Thanks.
    Manish

  • Generate XML out of internal Table (via XSLT)

    Hi NG,
    is there an easy way to generate an XML document out of an internal ABAP Table? Maybe there is even a chnage to use XSLT as an template to define the structure of the XML file.
    Thanks
    Stefan

    check out following thread you will find more than one answer. I like CL_XML_DOCUMENT solution, that is so simple.
    Re: Convert to XML format
    -Sanjeev

  • Sub Structure

    Hi Friends,
    my File is like this.
    aa,bb,cc,dd,ee
    can we make two substructures in one row,that means aa,bb,cc in one sub structure and dd,ee in another sub structure.
    Finally my xml structure is like this.
    <root>
    <sub1>
         <aa>...</>
         <bb>..</b>
         <cc>...</c>
    </sub1>
    <sub2>
          <dd>...</dd>
          <ee>....>/ee>
    </sub2>
    </root>

    hi praveen,
    we can create two substructures in a single row. specify the  parameter RecordsetStructure in content conversion as
    RecordsetStructure: sub1,,sub2,
    detailed configuration steps are mentioned in the below blog
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    Kind Regards
    Francis

  • Read xml-structure from a xml-document stored in a xmltype-column?

    Hello,
    I have several xml-documents stored in a table with a xmltype-column.
    Is it possible to read the structure of one xml-document? I need to know what data are exists in the xml-documents.
    I had read some hours here, but I dont find a suitable solution for that.
    To make a example, what I need:
    I have stored the following xml-document in the table:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="6">
    <EMPLOYEE_ID>105</EMPLOYEE_ID>
    <FIRST_NAME>David</FIRST_NAME>
    <LAST_NAME>Austin</LAST_NAME>
    <EMAIL>DAUSTIN</EMAIL>
    <PHONE_NUMBER>590.423.4569</PHONE_NUMBER>
    <HIRE_DATE>6/25/1997 0:0:0</HIRE_DATE>
    <JOB_ID>IT_PROG</JOB_ID>
    <SALARY>4800</SALARY>
    <MANAGER_ID>103</MANAGER_ID>
    <DEPARTMENT_ID>60</DEPARTMENT_ID>
    </ROW>
    </ROWSET>
    I need to return the following:
    ROWSET
    ...ROW
    ......EMPLOYEE NUMBER
    ......FIRST_NAME VARCHAR2
    ......DEPARTMENT_ID NUMBER
    Regards,
    Mark

    Hi,
    I was on a wrong way. The datatype is not stored in xml, this was a mistake from me.
    I needed something to printout some values from a xml-file. This xml-file was generated bei MS Excel. The data are in /Workbook/Worksheet/Table/Cell and I didnt know how to access it.
    I write for that the following:
    DECLARE
    v_xml XMLType;
    v_doc dbms_xmldom.DOMDocument;
    v_node dbms_xmldom.DOMNode;
    type t_values is table of varchar2(2000) index by binary_integer;
    v_values t_values;
    type t_table is table of t_values index by binary_integer;
    v_table t_table;
    procedure node_output (v_node in out dbms_xmldom.DOMNode)
    is
    v_nodelist1 DBMS_XMLDOM.DOMNodeList;
    v_nodelist2 DBMS_XMLDOM.DOMNodeList;
    v_anzahlnodes number;
    v_anzahlrows number;
    v_node_c dbms_xmldom.DOMNode;
    v_xmlmitarbeiterid number;
    begin
    v_nodelist1 := dbms_xmldom.GETCHILDNODES(v_node);
    v_anzahlrows := DBMS_XMLDOM.GETLENGTH(v_nodelist1);
    if v_anzahlrows = 0 or DBMS_XMLDOM.GETNODENAME(v_node) = 'Table'
    then
    if v_anzahlrows > 0
    then
    for i1 in 0..v_anzahlrows - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist1,i1);
    v_nodelist2 := dbms_xmldom.GETCHILDNODES(v_node);
    v_anzahlnodes := DBMS_XMLDOM.GETLENGTH(v_nodelist2);
    for i2 in 0..v_anzahlnodes - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist2,i2);
    v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node);
    v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node_c);
    v_values(i2) := DBMS_XMLDOM.GETNODEVALUE(v_node_c);
    end loop;
    v_table(i1) := v_values;
    end loop;
    for i1 in 1..v_anzahlrows - 1
    loop
    select SEQ_XMLMITARBEITER.nextval into v_xmlmitarbeiterid from dual;
    for i2 in 1..v_table(i1).count - 1
    loop
    dbms_output.put_line(v_table(i1)(i2));
    end loop;
    end loop;
    end if;
    else
    v_node := dbms_xmldom.GETFIRSTCHILD(v_node);
    for i in 0..v_anzahlrows - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist1,i);
    node_output(v_node);
    end loop;
    end if;
    end;
    BEGIN
    select inhalt into v_xml FROM xmlimport WHERE name = 'F23973/mitarbeiter.xml';
    v_doc := dbms_xmldom.newDOMDocument(v_xml);
    v_node:= dbms_xmldom.makeNode(dbms_xmldom.getDocumentElement(v_doc));
    node_output(v_node);
    END;
    This gives me all data from a xml-Excel-file. Is there a better way to do that? I have Oracle 10.2.
    Regards,
    Mark

  • How to? regarding adding xml parent tag in generated xml script using C# scripting

    Hi All,
    I have a set of transformations, which will generate xml data by reading rows from database
    here is my data flow https://social.msdn.microsoft.com/Forums/getfile/606619
    <Customer> 
    <CustomerId>1</CustomerId> 
    <Name></Name> 
    <Title></Title> 
    <Phone>1 (11) 500 555-0162</Phone> 
    <Gender>F</Gender> 
    <MaritalStatus>S</MaritalStatus> 
    <YearlyIncome>70000</YearlyIncome> 
    <BirthDate>15-02-1968 12:00:00</BirthDate> 
    <EmailAddress>[email protected]</EmailAddress> 
    <CustomerKey>11003</CustomerKey> 
    </Customer> 
    <Customer> 
    <CustomerId>2</CustomerId> 
    <Name></Name> 
    <Title></Title> 
    <Phone>1 (11) 500 555-0131</Phone> 
    <Gender>F</Gender> 
    <MaritalStatus>S</MaritalStatus> 
    <YearlyIncome>80000</YearlyIncome> 
    <BirthDate>08-08-1968 12:00:00</BirthDate> 
    <EmailAddress>[email protected]</EmailAddress> 
    <CustomerKey>11004</CustomerKey> 
    </Customer> 
    my problem is I am not able to add <?xml version="1.0" encoding="UTF-8"?> (xml tag) to output folder, which should be just at the beginning of xml file. 
    I am a beginner in SSIS, any help/hints will be appreciated.
    Regards,
    Mateen

    Why not do it in t-sql?
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
    If you want to do it in SSIS use this
    http://bicortex.com/how-to-create-an-xml-file-using-ssis-and-ms-sql-server/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for