diff --git a/lib/Track.hs b/lib/Track.hs index 0bff627..7452fda 100644 --- a/lib/Track.hs +++ b/lib/Track.hs @@ -74,21 +74,12 @@ elToPoint c = >>= child >>= element (tpxNS "TrackPointExtension") >>= child - cadence = - gpxtpx - >>= element (tpxNS "cad") - >>= child - >>= content - hr = - gpxtpx - >>= element (tpxNS "hr") - >>= child - >>= content - power = - gpxtpx - >>= element (Name "PowerInWatts" (Just "http://www.garmin.com/xmlschemas/PowerExtension/v1") Nothing) - >>= child - >>= content + extn n = + gpxtpx >>= element n >>= child >>= content + + cadence = extn (tpxNS "cad") + hr = extn (tpxNS "hr") + power = extn "{http://www.garmin.com/xmlschemas/PowerExtension/v1}PowerInWatts" parsedTime = listToMaybe ts >>= (Data.Time.ISO8601.parseISO8601 . Data.Text.unpack)