From: Matteo on 23 Jan 2006 05:15 sto provando a leggere un file xml ma non riesco a venirne fuori ... infatti lancio il wruncbl32 books.acu ma non mi da il risultato ... sicuramente sto sbagliando qualche variabile in runtime ... qualche idicazione ? questo il sorgente identification division. program-id. books. * Copyright (c) 2003 by Acucorp, Inc. * Users of ACUCOBOL may freely use this file. * This program displays the records in the bookfile.xml file. * Create bookfile.sl and bookfile.fd by executing * xml2fd -p xml- bookfile.xml * Note that this assumes that the bookfile.xsd file is available. * If it is not, then the bookfile.fd generated will not allow this * program to compile (it will have too few occurrances of some * table elements). * Compile this program with the flags "-Fax -Fc" (optionally use "-Gd" * to use the debugger). * Run it with the cblconfig configuration file. 2 records should be displayed. environment division. input-output section. file-control. * .\bookfile.sl - Generated by xml2fd from bookfile.xml on 2006/01/23 select xml-bookfile assign to disk "bookfile.xml" binary sequential status is xml-bookfile-status. data division. file section. * .\bookfile.fd - Generated by xml2fd from bookfile.xml on 2006/01/23 fd xml-bookfile. 01 xml-transaction. 06 xml-Lender. 11 xml-name pic x(30). 11 xml-street pic x(30). 11 xml-city pic x(30). 11 xml-state pic x(2). 06 xml-Borrower. 11 xml-name pic x(30). 11 xml-street pic x(30). 11 xml-city pic x(30). 11 xml-state pic x(2). 06 xml-note pic x(255). 06 xml-books. 11 book occurs 10 times. 16 xml-bookTitle pic x(30). 16 xml-pubDate pic x(30). 16 xml-replacementValue pic x(7). 16 xml-maxDaysOut pic x(3). working-storage section. 01 xml-bookfile-status pic xx. screen section. 01 books-screen. 03 lender. 05 "Lender" line 4 col 1. 05 from xml-name of xml-lender line 5 col 3. 05 from xml-street of xml-lender line 6 col 3. 05 from xml-city of xml-lender line 7 col 3. 05 from xml-state of xml-lender line 8 col 3. 03 borrower. 05 "Borrower" line 4 col 41. 05 from xml-name of xml-borrower line 5 col 43. 05 from xml-street of xml-borrower line 6 col 43. 05 from xml-city of xml-borrower line 7 col 43. 05 from xml-state of xml-borrower line 8 col 43. 03 book-info. 05 "Title" line 10 col 1. 05 "Pub Date" line 10 col 41. 05 "Value" line 10 col 53. 05 "Days" line 10 col 63. 03 one-book occurs 10 times. 05 from xml-booktitle line + 1 col 1. 05 from xml-pubdate col 41. 05 from xml-replacementvalue col 53. 05 from xml-maxdaysout col 63. procedure division. main-logic. open input xml-bookfile. perform until xml-bookfile-status = "10" read xml-bookfile next at end display "No more data" line 24 not at end display books-screen end-read initialize xml-transaction accept omitted end-perform. close xml-bookfile. questo il file xml : <?xml version="1.0"?> <bookfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceschemaLocation="bookfile.xsd"> <transaction borrowDate="2001-10-15"> <Lender phone="607.555.2222"> <name>Doug Glass</name> <street>416 Disk Drive</street> <city>Medfield</city> <state>MA</state> </Lender> <Borrower phone="310.555.1111"> <name>Britta Regensburg</name> <street>219 Union Drive</street> <city>Medfield</city> <state>CA</state> </Borrower> <note>Lender wants these back in two weeks!</note> <books> <book bookID="123-4567-890"> <bookTitle>Earthquakes for Breakfast</bookTitle> <pubDate>2001-10-20</pubDate> <replacementValue>15.95</replacementValue> <maxDaysOut>14</maxDaysOut> </book> <book bookID="123-4567-891"> <bookTitle>Avalanches for Lunch</bookTitle> <pubDate>2001-10-21</pubDate> <replacementValue>19.99</replacementValue> <maxDaysOut>14</maxDaysOut> </book> <book bookID="123-4567-892"> <bookTitle>Meteor Showers for Dinner</bookTitle> <pubDate>2001-10-22</pubDate> <replacementValue>11.95</replacementValue> <maxDaysOut>14</maxDaysOut> </book> <book bookID="123-4567-893"> <bookTitle>Snacking on Volcanoes</bookTitle> <pubDate>2001-10-23</pubDate> <replacementValue>17.99</replacementValue> <maxDaysOut>14</maxDaysOut> </book> </books> </transaction> <transaction borrowDate="2002-11-18"> <Lender phone="619.555.2222"> <name>Philip Glass</name> <street>146 Floppy Drive</street> <city>Chicago</city> <state>IL</state> </Lender> <Borrower phone="310.555.1111"> <name>Britta Regensburg</name> <street>219 Union Drive</street> <city>Medfield</city> <state>CA</state> </Borrower> <books> <book bookID="321-4567-890"> <bookTitle>Day Tripping in San Francisco</bookTitle> <pubDate>1998-11-20</pubDate> <replacementValue>25.95</replacementValue> <maxDaysOut>28</maxDaysOut> </book> <book bookID="321-4567-891"> <bookTitle>3 Ways to better skiing</bookTitle> <pubDate>19889-9-2</pubDate> <replacementValue>9.99</replacementValue> <maxDaysOut>3</maxDaysOut> </book> <book bookID="321-4567-892"> <bookTitle>Skylines of Utah</bookTitle> <pubDate>1998-4-1</pubDate> <replacementValue>31.95</replacementValue> <maxDaysOut>14</maxDaysOut> </book> </books> </transaction> </bookfile>
From: yogibear on 25 Jan 2006 11:29 In the directory where you found the sample program is a runtime configuration file cblconfig. You need to execute the COBOL program using this config file. On Windows this would be: wrun32 -c cblconfig books.acu
From: Matteo on 26 Jan 2006 05:51 I find it after but now the problem is to create the file .xsd from the .xml but I do not find instruction form make this ... Matteo
From: yogibear on 26 Jan 2006 15:05 The sample program shows how COBOL can read an xml file. Are you trying to create a schema for an xml file? There are a number of configuration file entries, look for config variables that start with AXML_
|
Pages: 1 Prev: free implementation? factorial? Next: Mainframe Question |