Skip to main content

I would like to ask for help with creating an XML document, please.  Basically, I need to "wrap" an existing message with XML.

Here is an example of what a complete message needs to look like.

<AutoBOD>

<AutoBOD xmlns="schemas.oxlo.com/.../SendFordFile">

<Routing>

<SenderId>999X9999</SenderId>

<DestinationId>FM</DestinationId>

</Routing>

<Body>

<SendFordFile>

<Detail><![CDATA[

1HDR-91378-465-81A378-COMBAT -KA-00000000-6.00-FS -OXLHUB

ENDFAS070101271378ACME AUTOMOTIVE 32154 BENTFORTH ROAD ALMA

CO80020000091378^>

0001000036759 >

0002000002100 >

0003000006319 >

0004000001500 >

0005000000100 >

0006000000100 >

0007000000000 >

0008000106060 >

7967000000025 >

7968000000075 >

7969000000125 >

7970000000021 >

7975000002434 >

1EOF-FS11010602-03064-292143333-465-

]]></Detail>

<FileName>O1125328.F465</FileName>

</SendFordFile>

</Body>

</AutoBOD>

As another example, I need to "wrap" this message within a CDATA section like the example above.

$CUD-06336-136-000000-COMBAT  -KA-00000000-3.21NCD01011601-         -                 CD2300101160100000007     00000000CUD3.21NUSA01v.1.0.0  00136COMBAT  KA00000000DDPCUNXD>
U1F01695    20151230C          246             2GNALBEK0D6301695038412M5N1ED28T63C672552158542M          UMALONIE                       GFLORES                             3814 SUNDOWN TRL                                            GRANBURY                      TX                            76049                                                                                                                                                                                                                                              PURCHASE       CASH           USED                                    USA>
U1F30946    20151231M          341             5NMSH13E49H330946109675M1FTSX21526EA99992158001M          UGERALD                        LBENCH                              517 A DRUMMOND RD                                           ABILENE                       TX                            79605    3258643604    3258643604                                                                                                                                                                                                                  PURCHASE       MISCELLANEOUS  USED                                    USA>
U1F35040    20151115R          246             KNDJJ741295035040091331M                 000000M          UWILLIAM                       HGILLENTINE                         1478 CR 2480                                                HICO                          TX                            76457    2543867353    9725645525                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F57108    20151231R          246             1FT7W2BT1FEA57108049452M1FTFW1ET4DKG43804062250M          UHUBERT                        LTRAWICK                            P.O. BOX 1711                                               MARTINSBURG                   WV                            25402    9363554519    9036096779                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F79785    20151231R          247             3C6UR5HJ2EG279785031120M1C6RR7GT8ES149961063242M          UFREIDA                        DJANUARY                            1776 REMINGTON CR                                           WEATHERFORD                   TX                            76086    9407450350                                                                                                                                                                                                                                PURCHASE       RETAIL         USED                                    USA>
$EOF-321N06336     USA0101160100000007D>

I've never had to do this before and I'm having trouble trying to think through it.

I would really appreciate any assistance you have to offer.  Thank You.  Russell Haile.


#XMLCDATA

I would like to ask for help with creating an XML document, please.  Basically, I need to "wrap" an existing message with XML.

Here is an example of what a complete message needs to look like.

<AutoBOD>

<AutoBOD xmlns="schemas.oxlo.com/.../SendFordFile">

<Routing>

<SenderId>999X9999</SenderId>

<DestinationId>FM</DestinationId>

</Routing>

<Body>

<SendFordFile>

<Detail><![CDATA[

1HDR-91378-465-81A378-COMBAT -KA-00000000-6.00-FS -OXLHUB

ENDFAS070101271378ACME AUTOMOTIVE 32154 BENTFORTH ROAD ALMA

CO80020000091378^>

0001000036759 >

0002000002100 >

0003000006319 >

0004000001500 >

0005000000100 >

0006000000100 >

0007000000000 >

0008000106060 >

7967000000025 >

7968000000075 >

7969000000125 >

7970000000021 >

7975000002434 >

1EOF-FS11010602-03064-292143333-465-

]]></Detail>

<FileName>O1125328.F465</FileName>

</SendFordFile>

</Body>

</AutoBOD>

As another example, I need to "wrap" this message within a CDATA section like the example above.

$CUD-06336-136-000000-COMBAT  -KA-00000000-3.21NCD01011601-         -                 CD2300101160100000007     00000000CUD3.21NUSA01v.1.0.0  00136COMBAT  KA00000000DDPCUNXD>
U1F01695    20151230C          246             2GNALBEK0D6301695038412M5N1ED28T63C672552158542M          UMALONIE                       GFLORES                             3814 SUNDOWN TRL                                            GRANBURY                      TX                            76049                                                                                                                                                                                                                                              PURCHASE       CASH           USED                                    USA>
U1F30946    20151231M          341             5NMSH13E49H330946109675M1FTSX21526EA99992158001M          UGERALD                        LBENCH                              517 A DRUMMOND RD                                           ABILENE                       TX                            79605    3258643604    3258643604                                                                                                                                                                                                                  PURCHASE       MISCELLANEOUS  USED                                    USA>
U1F35040    20151115R          246             KNDJJ741295035040091331M                 000000M          UWILLIAM                       HGILLENTINE                         1478 CR 2480                                                HICO                          TX                            76457    2543867353    9725645525                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F57108    20151231R          246             1FT7W2BT1FEA57108049452M1FTFW1ET4DKG43804062250M          UHUBERT                        LTRAWICK                            P.O. BOX 1711                                               MARTINSBURG                   WV                            25402    9363554519    9036096779                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F79785    20151231R          247             3C6UR5HJ2EG279785031120M1C6RR7GT8ES149961063242M          UFREIDA                        DJANUARY                            1776 REMINGTON CR                                           WEATHERFORD                   TX                            76086    9407450350                                                                                                                                                                                                                                PURCHASE       RETAIL         USED                                    USA>
$EOF-321N06336     USA0101160100000007D>

I've never had to do this before and I'm having trouble trying to think through it.

I would really appreciate any assistance you have to offer.  Thank You.  Russell Haile.


#XMLCDATA

Russell,

Ah, using XML to send an old EDI file...

Use the cdata-section-elements attribute on the <xsl:output> processing instruction in the XSL that you use on the XML OUTPUT FILE.  Then you will need to take considerable care on what you place in your COBOL data element.

In general, unless the receiver of your file absolutely needs CDATA because it is using some oddball ad hoc XML processor, you should be able to place the information in a COBOL data element and let XML Extensions take care of the encoding (such as CDATA and escaping some characters to entities).

Best regards,

Tom


I would like to ask for help with creating an XML document, please.  Basically, I need to "wrap" an existing message with XML.

Here is an example of what a complete message needs to look like.

<AutoBOD>

<AutoBOD xmlns="schemas.oxlo.com/.../SendFordFile">

<Routing>

<SenderId>999X9999</SenderId>

<DestinationId>FM</DestinationId>

</Routing>

<Body>

<SendFordFile>

<Detail><![CDATA[

1HDR-91378-465-81A378-COMBAT -KA-00000000-6.00-FS -OXLHUB

ENDFAS070101271378ACME AUTOMOTIVE 32154 BENTFORTH ROAD ALMA

CO80020000091378^>

0001000036759 >

0002000002100 >

0003000006319 >

0004000001500 >

0005000000100 >

0006000000100 >

0007000000000 >

0008000106060 >

7967000000025 >

7968000000075 >

7969000000125 >

7970000000021 >

7975000002434 >

1EOF-FS11010602-03064-292143333-465-

]]></Detail>

<FileName>O1125328.F465</FileName>

</SendFordFile>

</Body>

</AutoBOD>

As another example, I need to "wrap" this message within a CDATA section like the example above.

$CUD-06336-136-000000-COMBAT  -KA-00000000-3.21NCD01011601-         -                 CD2300101160100000007     00000000CUD3.21NUSA01v.1.0.0  00136COMBAT  KA00000000DDPCUNXD>
U1F01695    20151230C          246             2GNALBEK0D6301695038412M5N1ED28T63C672552158542M          UMALONIE                       GFLORES                             3814 SUNDOWN TRL                                            GRANBURY                      TX                            76049                                                                                                                                                                                                                                              PURCHASE       CASH           USED                                    USA>
U1F30946    20151231M          341             5NMSH13E49H330946109675M1FTSX21526EA99992158001M          UGERALD                        LBENCH                              517 A DRUMMOND RD                                           ABILENE                       TX                            79605    3258643604    3258643604                                                                                                                                                                                                                  PURCHASE       MISCELLANEOUS  USED                                    USA>
U1F35040    20151115R          246             KNDJJ741295035040091331M                 000000M          UWILLIAM                       HGILLENTINE                         1478 CR 2480                                                HICO                          TX                            76457    2543867353    9725645525                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F57108    20151231R          246             1FT7W2BT1FEA57108049452M1FTFW1ET4DKG43804062250M          UHUBERT                        LTRAWICK                            P.O. BOX 1711                                               MARTINSBURG                   WV                            25402    9363554519    9036096779                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F79785    20151231R          247             3C6UR5HJ2EG279785031120M1C6RR7GT8ES149961063242M          UFREIDA                        DJANUARY                            1776 REMINGTON CR                                           WEATHERFORD                   TX                            76086    9407450350                                                                                                                                                                                                                                PURCHASE       RETAIL         USED                                    USA>
$EOF-321N06336     USA0101160100000007D>

I've never had to do this before and I'm having trouble trying to think through it.

I would really appreciate any assistance you have to offer.  Thank You.  Russell Haile.


#XMLCDATA

Tom,

I'm concerned about one thing.  In June, we had a file that Windows reports the file size as "15.5 MB (16,267,302 bytes)".  I don't think I can out the entire contents of a file like that into a COBOL data element, can I?  I think I'll have to somehow import the contents of a file into a CDATA section to generate a single XML document, is that sound correct?

Part of the issue is that we have to

(1) send files wrapped in XML

(2) receive files wrapped in XML and parse the CDATA section into a file so our normal process can handle it.

This is a Ford Motors thing and we don't really know how many different files there are or what the size of each file might be.


I would like to ask for help with creating an XML document, please.  Basically, I need to "wrap" an existing message with XML.

Here is an example of what a complete message needs to look like.

<AutoBOD>

<AutoBOD xmlns="schemas.oxlo.com/.../SendFordFile">

<Routing>

<SenderId>999X9999</SenderId>

<DestinationId>FM</DestinationId>

</Routing>

<Body>

<SendFordFile>

<Detail><![CDATA[

1HDR-91378-465-81A378-COMBAT -KA-00000000-6.00-FS -OXLHUB

ENDFAS070101271378ACME AUTOMOTIVE 32154 BENTFORTH ROAD ALMA

CO80020000091378^>

0001000036759 >

0002000002100 >

0003000006319 >

0004000001500 >

0005000000100 >

0006000000100 >

0007000000000 >

0008000106060 >

7967000000025 >

7968000000075 >

7969000000125 >

7970000000021 >

7975000002434 >

1EOF-FS11010602-03064-292143333-465-

]]></Detail>

<FileName>O1125328.F465</FileName>

</SendFordFile>

</Body>

</AutoBOD>

As another example, I need to "wrap" this message within a CDATA section like the example above.

$CUD-06336-136-000000-COMBAT  -KA-00000000-3.21NCD01011601-         -                 CD2300101160100000007     00000000CUD3.21NUSA01v.1.0.0  00136COMBAT  KA00000000DDPCUNXD>
U1F01695    20151230C          246             2GNALBEK0D6301695038412M5N1ED28T63C672552158542M          UMALONIE                       GFLORES                             3814 SUNDOWN TRL                                            GRANBURY                      TX                            76049                                                                                                                                                                                                                                              PURCHASE       CASH           USED                                    USA>
U1F30946    20151231M          341             5NMSH13E49H330946109675M1FTSX21526EA99992158001M          UGERALD                        LBENCH                              517 A DRUMMOND RD                                           ABILENE                       TX                            79605    3258643604    3258643604                                                                                                                                                                                                                  PURCHASE       MISCELLANEOUS  USED                                    USA>
U1F35040    20151115R          246             KNDJJ741295035040091331M                 000000M          UWILLIAM                       HGILLENTINE                         1478 CR 2480                                                HICO                          TX                            76457    2543867353    9725645525                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F57108    20151231R          246             1FT7W2BT1FEA57108049452M1FTFW1ET4DKG43804062250M          UHUBERT                        LTRAWICK                            P.O. BOX 1711                                               MARTINSBURG                   WV                            25402    9363554519    9036096779                                                                                                                                                                                                                  PURCHASE       RETAIL         USED                                    USA>
U1F79785    20151231R          247             3C6UR5HJ2EG279785031120M1C6RR7GT8ES149961063242M          UFREIDA                        DJANUARY                            1776 REMINGTON CR                                           WEATHERFORD                   TX                            76086    9407450350                                                                                                                                                                                                                                PURCHASE       RETAIL         USED                                    USA>
$EOF-321N06336     USA0101160100000007D>

I've never had to do this before and I'm having trouble trying to think through it.

I would really appreciate any assistance you have to offer.  Thank You.  Russell Haile.


#XMLCDATA

You can do (2) using XML TRANSFORM FILE and an XSL that uses text output (specified in <xsl:output>)..

Exporting exceptionally large data usually requires some modest effort.  A lot depends on the way the data is structured.  Later versions of RM/COBOL have removed a lot of size restrictions, so that one can define a record area of about 4 gigabytes, but element lengths are still limited to 65280.  So, getting data in and out may require some finesse.