Ronald Weinger wrote:
> I'm new to this list and somewhat new to XML.
Welcome to the wonderful world of XML :-)
> We are using Websphere MQ to transport an XML message from a UNIX box to a
> LE COBOL application on Z/OS. The XML message is built in ASCII with
> encoding=UTF-8. When the MQGET is issued by the LECOBOL program the
> message is converted from ASCII to EBCDIC, but the encoding declaration in
> the XML message remains UTF-8. That causes the LECOBOL XML parser to
> generate an exception conditon.
Which component is doing the UTF8-to-EBCDIC translation?
It is correct for the XML Declaration to remain in UTF8 (in effect,
ASCII, because it contains only the string
<?XML version="1.0" encoding="whatever-the-EBCDIC-encoding-name-is"?>
Only once this has been received and processed can the consuming
process start to operate in EBCDIC on the remainder of the document.
What exactly is the LECOBOL parser complaining about? That the XML
declaration isn't in EBCDIC?
> If the ASCII message is built with encoding=IBM-1140 the parsing will
> work, but then we would have the reverse problem if the message has to be
> sent to a UNIX box.
You mean that the Unix system wouldn't understand the encoding generated
> If the MQGET is done without the convert the LECOBOL program has to parse
> an ASCII message, equally unappealing,
Does LECOBOL actually gag on ASCII completely? Have you tried it with
one of the more common encodings like ISO-8859-1?
> Is there a relatively standard method of handling this?
It's been a very long time indeed since I handled any EBCDIC, certainly
before the days of XML, I'm afraid.
> If the sending process needs to know the encoding capabilities of the
> target before building the message it would appear to defeat the
> universality of XML.
No, it certainly shouldn't need to know them in advance, but parsers are
not required to support every encoding in existence, and I suspect most
parser-writers may not have provided support for EBCDIC encoding.
Have you asked this question on comp.text.xml?