[Gambas-user] gb.xml questions

Ron ron at ...1740...
Fri Oct 10 16:35:38 CEST 2008


Benoit Minisini schreef:
> On vendredi 10 octobre 2008, Ron wrote:
>   
>> Hi,
>>
>> Im trying to read the rss from gmail:
>> it looks like this:
>> ---
>> <?xml version="1.0" encoding="UTF-8"?>
>> <feed version="0.3" xmlns="http://purl.org/atom/ns#">
>> <title>Gmail - Inbox for ron at ...1740...</title>
>> <tagline>New messages in your Gmail Inbox</tagline>
>> <fullcount>1</fullcount>
>> <link rel="alternate" href="http://mail.google.com/mail" type="text/html"
>> /> <modified>2008-10-10T09:56:10Z</modified>
>> <entry>
>> <title>DomotiGa: Test e-mail</title>
>> <summary>If you read this, e-mail support is working! - Powered by
>> DomotiGa V0.0.121</summary>
>> <link rel="alternate"
>> href="http://mail.google.com/mail?account_id=bla%40bla.nl&message_id=21
>> ce61dc985d425d&view=conv&extsrc=atom" type="text/html" />
>> <modified>2008-10-10T09:37:03Z</modified>
>> <issued>2008-10-10T09:37:03Z</issued>
>> <id>tag:gmail.google.com,2004:1283070543924118109</id>
>> <author>
>> <name>domotiga</name>
>> <email>domotiga at ...1992...</email>
>> </author>
>> </entry>
>> </feed>
>> ---
>> gb.xml and XmlReader doesn't grok these <link rel= "alternate" href=
>> lines, it's aborts after the :// is this correct behaviour?
>> also during parsing it dumps this to console, so I guess debugging
>> message print are still enabled in the component.
>> The rest of the fields and doc is parsed 100% ok.
>> ---
>>
>> :6: parser error : AttValue: ' expected
>>
>> <link rel="alternate" href="http://
>>                                                ^
>>
>> :6: parser error : attributes construct error
>>
>> <link rel="alternate" href="http://
>>                                                ^
>>
>> :6: parser error : Couldn't find end of Start Tag link
>>
>> <link rel="alternate" href="http://
>>                                                ^
>>
>> :1: parser error : Document is empty
>>
>> mail.google.com/mail" type="text/html" />
>> ^
>>
>> :1: parser error : Document is empty
>> ://mail.google.com/mail?account_id=bla%40bla.nl&message_id=21ce61dc98
>>
>> ^
>>
>> :1: parser error : Document is empty
>>
>> 43924118109</id>
>> ---
>>
>> Can someone please fix this, or if google is misusing the rss specs, add
>> support for this?
>>
>> Gambas 2.9 svn yesterday
>> Thanks.
>>
>> Regards,
>> Ron_2nd
>>
>>     
>
> I'm currently busy with my job, but when I have time, I will look at it.
>
> Regards,
>   

Benoit,

I have found the problem, so you can use your sparse free time for 
something else ;-)
I have noticed the first http:// occured around +/- 256 chars, then I 
have noticed the code I copied and pasted was not working ok.
Didn't notice it at first because the debug print output was ok (because 
of the ; which concatinated the string), but in the string which was 
sent to the parsefeed routine, cr/lfs where inserted...

It was:

  READ #LAST, sXml, -256

Changed it to:

  READ #LAST, sXml, Lof(LAST)

Now it works ok.

Some code I have used is from this page
http://gambasdoc.org/help/lang/shell?

Wrongly thinking that reading with read -256 is the same as Lof(LAST)

My small test project is attached... the main bulk of the code is coming 
from xmlviewer from gambasforge.net
Change user and password to your gmail account in the code and run.

Regards,
Ron_2nd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlviewer-0.0.10.tar.gz
Type: application/gzip
Size: 9541 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20081010/8974b135/attachment.gz>


More information about the User mailing list