Tag Archives: W3C

lua & timezones by name

A bit hard to puzzle due to scarce documentation. #!/usr/bin/env lua local luatz = require ‚luatz‘ — https://github.com/daurnimator/luatz/   local tz_name = ‚Europe/Berlin‘ local ts_loc = luatz.time({year=2014, month=12, day=31, hour=23, min=59})   — %z isn’t supported yet: https://github.com/daurnimator/luatz/blob/523b2e0f1ece77c569f6db4c040886ed3124512e/luatz/strftime.lua#L178 local function tz_off_iso8601(tz_offset_seconds) local separator = “ — 8601 %z compliant — separator = ‚:‘ — 8601 […]

Why PHP is utterly broken

tl;dr: neither does DATE_RFC1123 produce a rfc1123-date, nor does DATE_RFC850 a rfc850-date. What sense does that make? This example may look scrupulous but seems typical. Mind the mandatory word ‚GMT‚ at the end of rfc1123-date. While DATE_RFC1123 renders something ending with +0000. Which is the same timezone but not the same string. So DATE_RFC1123 is useless for HTTP headers (RFC2616). I wonder what else […]

Validate GPX

$ xmllint –noout –schema http://www.topografix.com/GPX/1/1/gpx.xsd <gpx file or url>

iPhone: libxml2 & RELAX NG validation

Having a validating parser in place can reduce the required code to parse XML a lot – you know very well what you actually get. As mentioned in my last post about RELAX NG & trang, I prefer RELAX NG over W3C XML Schema – which doesn’t matter anyway because Apple’s suggested XML parser doesn’t […]

XML Toolbox: RELAX NG & trang

e.g. when handling RESTful APIs you may want to validate the response XML – a custom one in most cases. I typically use tools already installed on every Mac and fire a http GET request with curl and immediately check it with xmllint like $ curl http://www.heise.de/newsticker/heise-atom.xml | xmllint –format –schema myschema.xsd -$ curl http://www.heise.de/newsticker/heise-atom.xml […]