-1

I've a mysql table with the header of an invoice. These data are enough to create my xml output file.

The structure of the output file must be:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<bpxml>
    <invoices>
       <invoice>
           <number>1</number>
           <date>01/01/2016</date>
           <amount>100</amount>
           <tax>20</tax>
           <customer>
                <name>Customer name</name>
                <taxcode>tax code123</taxcode>
           </customer>
        </invoice>
        <invoice>...</invoice>
     </invoices>
 </bpxml>

I created mysql input connection, xml output and I mapped all fields. All works fine but I've only two problems:

  1. Create invoices parent element
  2. Create customer parent element

It seems not simple to add these container elements to the output xml file.

The source mysql table contains all data in flat manner, so I've these columns:

number|date|amount|tax|customer_name|customer_taxcode

Also using parent xml element and row xml element I'm able only to manage <bpxml> and <invoice> element but I'm not able to add <invoices> container element and <customer> container element.

There is a simple way to add these container elements to the final stream?

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
drenda
  • 5,846
  • 11
  • 68
  • 141
  • Sure - there's a million ways to generate XML from a mySQL result set. It sounds like you want to use Pentaho Kettle. Try this hello world", and post back any specific questions once you've started coding: http://wiki.pentaho.com/display/EAI/03.+Hello+World+Example – paulsm4 Mar 30 '16 at 17:57
  • I've yet created my job. My only problemes are related to add a parent element that contains data read from a flat table. As described I yet mapped all fields but I need to add parent elements as "invoices" and "customer". Using parent xml element and element row xml permit only to manage and . – drenda Mar 30 '16 at 18:02

1 Answers1

1

Do one of the following:

  1. Add XML step to make subparts, and XML Join to create your structure.
  2. Add XML step and then XSL Transformation in your transformation.
  3. Create the file in your transformation and save it, and then use XSL Tranformation in the calling job.
bolav
  • 6,938
  • 2
  • 18
  • 42