Importing UDCF

Discussion of the macOS applications DiveLogDT and Dive Log Manager
Post Reply
ATJ
Posts: 10
Joined: Fri Jul 16, 2010 5:30 pm

Importing UDCF

Post by ATJ » Fri Jul 16, 2010 5:38 pm

G'day,

I'm trying to use Dive Log Manager on 10.6.4 to import my dives which are in UDCF. Unfortunately, both versions of Dive Log Manager (1.3 and 2 beta) ignore the date and time information in the UDCF file so the dives end up with the current date and no time information.

Am I doing something wrong or is this a bug?

It basically makes Dive Log on my iPod next to useless.

support
Posts: 712
Joined: Wed Mar 31, 2010 4:35 pm

Re: Importing UDCF

Post by support » Sat Jul 17, 2010 8:58 am

Hi ATJ,

Sorry that you're having a problem with UDCF. I doubt that you are doing anything wrong, but sometimes these file formats are finicky. The format includes a date and time field so you "shouldn't" be getting the current time in your log entries.

Two things - can you let us know what program created the UDCF? And second, please send your UDCF file to support (at) moremobilesoftware (dot) com so that we can take a look at it. There could certainly be a bug in Dive Log Manager that has not yet been found and your file happens to be the first ....

Thanks!
Janice

ATJ
Posts: 10
Joined: Fri Jul 16, 2010 5:30 pm

Re: Importing UDCF

Post by ATJ » Sat Jul 17, 2010 3:35 pm

OK. I worked out what the problem was.

The UDCF file I am generating myself. My current dive log application is a home grown Lotus Notes application. I can code any kind of export I want and have been experimenting with different formats to see which one will give me the most data in DLM and so Dive Log for iPhone. UDCF appears to be the simplest and best defined, although it is missing quite a bit of data.

Being XML, I had assumed that the order of subfields wasn't important and so for date, I had the following:
<DATE><DAY>1</DAY><MONTH>5</MONTH><YEAR>2010</YEAR></DATE>
Once I changed it to:
<DATE><YEAR>2010</YEAR><MONTH>5</MONTH><DAY>1</DAY></DATE>
the files are imported without problems. Interestingly, Diving Log 5.0 (I have an eval copy), imports with the dates in either order.

support
Posts: 712
Joined: Wed Mar 31, 2010 4:35 pm

Re: Importing UDCF

Post by support » Mon Jul 19, 2010 10:00 am

I know it's odd, but the UDCF spec says:
"The elements inside <date> are: < year>, < month> and < day>, exactly in this order."

and the spec for the time keyword has similar language about the order of it's elements.

Yeah, seems kind of weird, but ...

Glad you were able to figure it out on your own. I suppose we could be more liberal in our importer but we haven't run across any "new" UDCF generators lately so we'll just leave it for now.

Cheers,
Janice

daniel_m
Posts: 2
Joined: Thu Jul 15, 2010 12:04 pm

Re: Importing UDCF

Post by daniel_m » Mon Jul 19, 2010 11:45 am

From an XML point of view everything depends on how your parser validates the XML, especially if you use an XML to whatever class library...

If you use a DTD then the order of the fields is not imperative, but with an XSD it is.
This would 'maybe' explain why Diving Log 5.0 is less restrictive...

But I am maybe completely wrong ;)

just my 2 cents
Daniel

ATJ
Posts: 10
Joined: Fri Jul 16, 2010 5:30 pm

Re: Importing UDCF

Post by ATJ » Mon Jul 19, 2010 8:39 pm

support wrote:I know it's odd, but the UDCF spec says:
"The elements inside <date> are: < year>, < month> and < day>, exactly in this order."
D'oh! I missed that completely. Thanks.

Post Reply