Wouldn't it be easier to use HDR.SUP?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Keith Johnson
(DSLWN)
Sent: 08 May 2008 01:27 AM
To: [email protected]
Subject: [U2] Universe XML is not to standard

The software I am supporting has a user screen which builds and saves
enquiry statements (English/Access/Recall).  I recently created another
screen to allow users to use the defined statement/report  to output XML to
the &HOLD& file and to transfer the results to their PC.  All well and good,
but then I found that Excel wouldn't pick up the results properly.  The
reason for this is that the XML output is not quite to the standard.  For
example, the command

>LIST VOC 'VOC' F1 F2 TOXML

gives the result
------------------------------------------


<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<VOC _ID = "VOC" F1 = "F" F2 = "VOC"/>
</ROOT>
------------------------------------------

While the command

>LIST VOC 'VOC' F1 F2 TOXML HEADING "WAHOO 'D'"

gives the result
------------------------------------------
WAHOO 08 May 2008

<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<VOC _ID = "VOC" F1 = "F" F2 = "VOC"/>
</ROOT>
------------------------------------------

It's not absolutely clear from the W3C standard itself, but it is very clear
from the examples given with it; that the output must start with the string
"<?xml ".  That is to say, although line feeds and spaces are effectively
ignored within XML, they are not catered for before the "<?xml " string.
And while the traditional Pick 'thing' is to "make-it-work-if-possible",
Excel follows the (arguably more standard) convention of
"holy-heck-that's-not-right-do-nothing"


What I had to put in place was an extra bit of code to read in the output,
delete any lines before the "<?xml " string, and re-write the output (which,
by the way, I'm unsure will work for very, very, very
large reports).  That's not at all satisfactory in my opinion.   I think
that the header lines should have been dropped completely, or put in after
the "<?xml " string as a comment something like this:

------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<-- report heading follows
WAHOO 08 May 2008

-->
<ROOT>
<VOC _ID = "VOC" F1 = "F" F2 = "VOC"/>
</ROOT>
------------------------------------------

Does anyone else agree with me?  Ought IBM change this?  What do you think?


Regards, Keith
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/



--
No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.10/1421 - Release Date: 2008/05/07
05:23 PM
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to