Skip to content

Instantly share code, notes, and snippets.

@JanKoppe
Last active December 9, 2019 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JanKoppe/1018fcfe33667df5c0bb313a7502ea9c to your computer and use it in GitHub Desktop.
Save JanKoppe/1018fcfe33667df5c0bb313a7502ea9c to your computer and use it in GitHub Desktop.
36C3: Pretalx XML filter out track
#!/bin/bash
set -euo pipefail
# requires curl and xmlstarlet
/usr/bin/curl https://fahrplan.chaos-west.de/36c3/schedule/export/schedule.xml -s | /usr/bin/xmlstarlet tr /root/filter_fahrplan.xsl - > /mnt/data/files-jankoppe.de/36c3/chaos-west-schedule-filtered.xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:theia="http://www.theia.org.uk/ILR/2011-12/1">
<!-- identity template -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- filter based on track value; omit Klangteppich track events -->
<xsl:template match="schedule/day/room/event[track = 'Klangteppich']"></xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment