ruby xml blocker
Tue, Mar 10, 2009
I’ve been making progress with Oddbod, to migrate Elgg 0.9 to 1.5 but have come up against a bit of a blocker. REXML has a bug in its printing subsystem. I managed to uncover it when adding profile metadata to an ODD document for the profilephoto_filename, which is a very long string of characters. When REXML sees this string, it tries to split it on the last space after its internal limit of 76. But file paths don’t have spaces normally, so it barfs on the equivalent of a NullPointerException. There doesn’t seem to be a way to specify the width when printing. There is a crap workaround of adding the text as CDATA but there’s no way I’m doing that as I have to parse these ODD docs using PHP in a 1.5 plugin, which I’ve yet to write and I want to keep it as simple as possible. Luckily I can get round it by not specifying the full path, just the start from the ELGG data dir. The bug is documented here. Can’t really complain though, as a) there’s a workaround and b) REXML is superb.