Dear Community,
has someone an example of a simple invoice generated using xml and the cobol copybooks created using the cbl2xml utility ?
I do not see any difficulty in creating an xml with
<invoice> <supplier> <supplierName>My Name</supplierName> <supplierAddess>My Address</supplierAddress> </supplier> <client> <clientName>My Client Name</clientName> <clientAddess>My Address</clientAddress> </client> <invoiceDate>14/07/2020</invoiceDate> <invoiceId>123456</invoiceId> <invoiceLines> <invoiceLine> <item>Item 1</item> <price>100 €</price> </invoiceLine> <invoiceLine> <item>Item 2</item> <price>200 €</price> </invoiceLine> </invoiceLines> <invoice>A cpy definition could be the following, then converted with cbl2xml in order to create an xml file from a cobol program. But my concern is : how do I manage the <invoiceLines> section as I have no idea in advance of the number of items per invoice ? Or do I have to split in two cpy files : one for the "fixed" part of the invoice (client name etc.) and another one for the item list ? But then, how to create a single xml file with my final invoice ?
01 invoice. 02 supplier. 03 supplierName pic x(50). 03 supplierAddess pic x(50). 02 client. 03 clientName pic x(50). 03 clientAddess pic x(50). 02 invoiceDate pic 9(8). 02 invoiceId pic 9(6). 02 invoiceLines. 03 invoiceLine occurs ???. 04 item pic x(20). 04 price pic 99999.Eventually, does anyone know how to link Factur-x ( http://fnfe-mpe.org/factur-x/factur-x_en/ ) to cobol?
Best regards,
Alain