I am trying to make a XML file in COBOL using the GENERATE statement. So far so good. But with this particular xml it needs to contain a seperate xml file within. So i want to use the CDATA tag around it. But, is there a way to do this in COBOL with the GENERATE statement?
Here an example.
01 request.
06 route.
11 name PIC X(030).
11 version PIC 9(004).
06 question.
11 IDENT PIC 9(009).
11 xmlFileName PIC X(006).
11 xmlFileInh PIC X(5000).
the xmlFileInh needs to be filled with another XML file. This can be only xml or a soap request.
Something like this:
<?xml version="1.0" encoding="UTF-8"?>
<request>
<route>
<name>serviceRequest</name>
<version>1</version>
</route>
<question>
<IDENT>111111111</IDENT>
<xmlFileName>FILE-1</xmlFileName>
<xmlFileInh>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope.....<SOAP-ENV:Envelope]]>
</xmlFileInh>
</question>
</request>
I have tried to STRING the "<![CDATA[" and "]]>" around the incoming XML-file and then put it in xmlFileInh. This does something, but renders all HTML control characters into something i don't want in my xml-file. The GENERATE statement does nothing with CDATA.
< becomes <
> becomes >
" becomes "
' becomes '
& becomes &
I also tried to give xmlFileInh another picture, even type XML. That gives a lot of new sorts of tags in my XML, name-length and data-length etc. but none i want.
Does anyone have a solution?
Thanks in advance Martijn.