Here you specify the path and name of the XML file:
Change XML definition XML300D
XML definition name . . : XML_DEMO Description . . . . . . : Demo: Convert demo spooled file into XML
User exit program . . . . *NONE Name, *NONE Library . . . . . . . . Name, *LIBL
XML output file . . . . . /APF3812Home/Work/MyFile*V1-*STAMP.xml
Create directories . . . . N Y=Yes, N=No
Generate unique* name . . N Y=Yes, N=No
Replace stream file . . . N Y=Yes, N=No
* Names are only unique per spooled file
F3=Exit F10=Define variables F12=Cancel
|
At the top of the screen you can state a user exit program if needed. The demo source of the program is included in source member XMLEXIT in the source file APISRC inside the APF3812 library.
The program will be called in these situations:
*START |
Initial call before any processing (Open files if necessary) |
*OPEN |
Open new XML file (A new XML file is opened for write) |
*DATA |
Field or attributte value (Assign a value to either a field or attribute) |
*CLOSE |
XML file closed (The XML file is done: Process the finished file if needed) |
*END |
End processing (Close files if necessary) |
For the XML output file you can e.g. include variables (*V1-*V9) and the special variable *STAMP to include a time stamp in the path or file name as shown above.
These options are available:
Create directories
Activate this option to let InterForm400 automatically create the necessary directories, if they should not already exist. If you state āNā and there is a directory missing, then you will get an error message, when you try to create the XML file(s).
Generate unique* name
If you should happen to setup a definition, which will try to create an XML file, that already exist, then you can with this option simply tell InterForm400 to automatically generate a new XML file name if needed. An extra counter will be added just before the .xml extension in the file name above. Please note, that the xml files are only unique per spooled file - so if you rerun the same spooled file, then the xml files will be named the same as the first time you run the definition.
Replace stream file
State āYā, if you want new XML files to replace existing ones with the same name.
If you have included a variable (*V1-*V9) in the file name or path, then you need also to define them. That is done via F10=Define variables on the screen above, via which you can see the defined variables and add new with F6 like below:
Change variable definition XML371D
XML definition name . . : XML_DEMO
Sequence number . . . . . 1 Variable . . . . . . . . . *V1 *V1-*V9
Description . . . . . . . Regarding
Page type(s) . . . . . . . PAGE1 Line type . . . . . . . . Use relative line . . . Y=Yes, N=No Line . . . . . . . . . . . 15 From position . . . . . . 12 To position . . . . . . . 41 Length . . . . . . . . . .
Operator . . . . . . . . . F4=List Compare value . . . . . .
More... F3=Exit F4=List F12=Cancel
|
Refer to this for a complete description of how you can define the variables in an XML definition.
Unless you state a double slash (//) for the root node in the XML structure (as described here), you will only create one XML file and the value for the variables is found only on the first page. If you do state a double slash one XML file will be created for each new value of the variable. To create multiple XML files you also need to defined at least one attribute or field in the root node.