Error when converting Google Calendar

View: New views
5 Messages — Rating Filter:   Alert me  

Error when converting Google Calendar

by Alexandre Passant :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

When trying to convert a calendar [1] created with Google Calendar
using fromIcal.py [2] script, I have an error with the following line:

ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Al
 exandre Passant;X-NUM-GUESTS=0:MAILTO:apassant@...

(even with --x option)

It can be solved adding X-NUM-GUEST at line 642 of the script, but I
don't think this is the most elegant way.
BTW, does this line is ok regarding iCal specs ?

Best,

Alex.

[1] http://www.google.com/calendar/ical/apassant@.../public/basic.ics
[2] http://www.w3.org/2002/12/cal/fromIcal.py


iCalendar to XML transform

by Tim Hare-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've worked out an XSL transform which I believe will convert any iCalendar
file to an XML document that has a node for each component and property in
the input file, with attributes on component elements which are the
parameters on the properites input.

One issue, remains, however: the only way I could find to bring in the
iCalendar file was as a defined SYSTEM entity in the XSL stylesheet itself.
It's not, as near as I can tell in testing, possible to use it as the
original document, or to use the document() function because that causes
whitespace to be stripped, including the CR-LF sequence needed to determine
the end of an iCalendar property line.

If anyone has insight into how to process a text file as input in this kind
of process, please let me know. I am willing to share the stylesheet if you
like. I'm sure there are issues possibly remaining regarding quoted or
escaped characters and the like.


Tim Hare
Interested Bystander, Non-Inc.






Re: iCalendar to XML transform

by Norman Walsh-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

/ "Tim Hare" <TimHare@...> was heard to say:
| One issue, remains, however: the only way I could find to bring in the
| iCalendar file was as a defined SYSTEM entity in the XSL stylesheet itself.

Right. The iCal format is text, not XML. XSLT 2.0 has an "unparsed-text()"
function that could load the file. An easier solution might be to write
a simple pre-processor in your favorite scripting language to turn the
.iCal into trivial XML. You could just wrap the whole document in a tag
or you could try to be more clever.

                                        Be seeing you,
                                          norm

--
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.


attachment0 (194 bytes) Download Attachment

Re: iCalendar to XML transform

by Dan Connolly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, 2006-11-12 at 21:11 -0500, Tim Hare wrote:
> I've worked out an XSL transform which I believe will convert any iCalendar
> file to an XML document that has a node for each component and property in
> the input file, with attributes on component elements which are the
> parameters on the properites input.
>
> One issue, remains, however: the only way I could find to bring in the
> iCalendar file was as a defined SYSTEM entity in the XSL stylesheet itself.

What prompted you to try using XSLT for parsing .ics files?

My approach to reading iCalendar has been to use python and build
JSON-shaped structures, and then convert to various XML formats
using Kid templates.
http://www.w3.org/2002/12/cal/icslex.py
http://www.w3.org/2002/12/cal/icsxml.py

Hmm... not much documentation in those modules. I wrote
an couple items on a similar exercise involving quicken data...
Getting my Personal Finance data back with hCalendar and hCard
Submitted by connolly on Wed, 2006-03-08
http://dig.csail.mit.edu/breadcrumbs/node/96
using JSON and templates to produce microformat data
Submitted by connolly on Sun, 2006-03-19
http://dig.csail.mit.edu/breadcrumbs/node/99

--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E



RE: iCalendar to XML transform

by Tim Hare-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Simple: I have XT at home, I don't have Python; and I wanted to see if I
could do it purely in XSLT. I've done XML-to-iCal in XSLT so this seemed
like a logical challenge. Professionally, I'm a mainframe jock, so you're
lucky I didn't just write it in COBOL <grin> - the new variants contain XML
input and output capabilities - parsing, not validating.


Tim Hare
Interested Bystander, Non-Inc.

-----Original Message-----
From: www-rdf-calendar-request@...
[mailto:www-rdf-calendar-request@...] On Behalf Of Dan Connolly
Sent: Monday, November 13, 2006 9:55 AM
To: Tim Hare
Cc: www-rdf-calendar@...; ietf-caldav@...
Subject: Re: iCalendar to XML transform


On Sun, 2006-11-12 at 21:11 -0500, Tim Hare wrote:
> I've worked out an XSL transform which I believe will convert any
> iCalendar file to an XML document that has a node for each component
> and property in the input file, with attributes on component elements
> which are the parameters on the properites input.
>
> One issue, remains, however: the only way I could find to bring in the
> iCalendar file was as a defined SYSTEM entity in the XSL stylesheet
itself.

What prompted you to try using XSLT for parsing .ics files?

My approach to reading iCalendar has been to use python and build
JSON-shaped structures, and then convert to various XML formats using Kid
templates.
http://www.w3.org/2002/12/cal/icslex.py
http://www.w3.org/2002/12/cal/icsxml.py

Hmm... not much documentation in those modules. I wrote an couple items on a
similar exercise involving quicken data...
Getting my Personal Finance data back with hCalendar and hCard Submitted by
connolly on Wed, 2006-03-08
http://dig.csail.mit.edu/breadcrumbs/node/96
using JSON and templates to produce microformat data Submitted by connolly
on Sun, 2006-03-19
http://dig.csail.mit.edu/breadcrumbs/node/99

--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E