bug-gift
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-GIFT] Problem with placement of comments in gift-log.mrml


From: Wolfgang Müller
Subject: Re: [bug-GIFT] Problem with placement of comments in gift-log.mrml
Date: Fri, 16 Jul 2004 08:29:40 +0000
User-agent: KMail/1.6.2

On Friday 16 July 2004 02:21, David Squire wrote:
> Hi folks,
Hi David,
> I have recently revived some code which parses the gift-log.mrml file
> for long-term learning purposes. I have discovered that in some gift
> version that has been released since I last used this stuff, code has

This must be *quite* a while ago :-D

> been introduced that writes a comment block to the gift-log.mrml each
> time the server is started or a message is send, e.g.:
>
> <!-- This instance of the GIFT was started on -->
> <!-- Fri Jul 16 12:12:06 2004
>  -->
> <!-- PID 2388 -->
>
>
> <!-- The following message was sent by
> Peer INET Address: 127.0.0.1
> At: Fri Jul 16 12:12:26 2004
>  -->
>
>
> Unfortunately there is a problem. These comment blocks appear *before* the
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>
> line, which must start an XML document. Consequently they cause Perl's
> XML parser to choke. Could this order please be reversed?

The answer is: No, unfortunately not.

The GIFT log contains the message as it was received, i.e. *unparsed*. In 
other words, the string received. If I where to put the said comment after 
the <?xml ...?> line, I would have to analyze the structure first, add a 
comment to the structure and than write out what I have parsed. While this is 
feasible, I find it is not in accord with what the log is supposed to be 
(IMHO, among other things): a debugging tool.

The solution to your problem is very simple (I have used it already). Grep for 
something matching the diverse versions of the <?xml... line, then feed what 
you want to the parser.

Cheers,
Wolfgang

-- 
Dr. Wolfgang Müller
LS AI 1
Universität Bayreuth




reply via email to

[Prev in Thread] Current Thread [Next in Thread]