On Sat, Jun 10, 2017 at 4:26 PM, Lizette Koehler <stars...@mindspring.com>
wrote:

> I am not unix or xml savvy.  So any guidance will be appreciated.
>
> I was supplied with an xml file to use to install a product.  When it runs
> it fails with the following error message.  This is done on the mainframe
> in the OMVS function.
>
> SEVERE: java.text.ParseException: javax.xml.stream.XMLStreamException: An
> invalid XML character (Unicode: 0x4c) was found in the prolog of the
> document.
>
> the first few lines of the XML are:
>
> ​​
> <?xml version="1.0" encoding="UTF-8"?>
> <Metadata>
>   <Group Id="$group:1" Name="SAS Plan File for Company Name" Desc="">
>     <Properties>
>       <Property Id="$grpprop:1" Name="AsOfDate" DefaultValue="2017-02-22"
> />
>       <Property Id="$grpprop:2" Name="ConfigDirectory"
> DefaultValue="Config" />
>
> it is very long xml, over 3600 lines of code.
>
> I am thinking it may have something to do with the code page for my PC or
> maybe the CUNI for LE.  Not sure.
>
> Also, when I have the xml on my PC it looks fine, when I transferred it up
> to the mainframe it looked wrapped.  Should it be more line items or
> wrapped for it to work?  Just curious.  It was suggested to go into wordpad
> and then save it.  Then the wrap on the mainframe would be more line items
> (code).  Does that create any issues?
>
>
>
> So any thoughts?
>
> Thanks
>
> Lizette
>
>
​Hum, 0x4c in UTF-8 is an "L". In EBCDIC CP-037 (et al.) it is a "<". If
you look at the first line:

​
<?xml version="1.0" encoding="UTF-8" ?>

the phrase: encoding="UTF-8" says that the rest of the data is in UTF-8.
But it's actually in EBCDIC. So the XML parser "sees" the "<" (in EBCDIC,
this is 0x4c, as in error) as a UTF-8 value of "L", which is not what it
wants at this point.

I'm not totally sure, but I think you need the first line to look like:

<?xml version="1.0" encoding="IBM037" ?>

or maybe even just, leaving off the encoding entirely,

<?xml version="1.0" ?>
​
a good source of information on XML on z/OS:
http://www.redbooks.ibm.com/redbooks/pdfs/sg247810.pdf section 1.4 on
"Encoding".


-- 
Veni, Vidi, VISA: I came, I saw, I did a little shopping.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to