elif [ ${STATIONDATA_COUNT} -eq 0 ]&& \
[ ${AL_MONTH_COUNT} -gt 0 ]
then
- echo "${REPLY}: Almanac data not compatible yet. Ignoring." >&2
- continue
+ STYLESHEET_PATH='almanac_to_commons.xslt'
DESTINATION_PATH="${DESTINATION}/weather.gc.ca/Almanac/${STATION_ID}.tab"
else
echo "${REPLY}: Cannot detect file type. Exiting."
echo "Processing ${REPLY} to ${DESTINATION_PATH}…" >&2
mkdir -p "$(dirname "${DESTINATION_PATH}")"
- xmlstarlet tr "${STYLESHEET_PATH}" "${REPLY}" > "${DESTINATION_PATH}"
+ xmlstarlet tr "${STYLESHEET_PATH}" "${REPLY}" | jq > "${DESTINATION_PATH}"
done 9< <( find "${SOURCE}" -type f -name '*.xml' -print0 )