Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add ant targets to generate and push member list for website
    See ukf/ukf-meta#258 for details
  • Loading branch information
Alex Stuart committed Mar 29, 2021
1 parent 926dd55 commit 68956dc
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -15,6 +15,7 @@ Thumbs.db
/build/orgnamescope.html
/build/randssps.html
/build/uai.html
/build/dml.html
/build/locations_noports.txt

# /charting/
Expand Down
22 changes: 22 additions & 0 deletions build.xml
Expand Up @@ -2389,6 +2389,7 @@
<fileset dir="${build.dir}">
<include name="orgnamescope.html"/>
<include name="uai.html"/>
<include name="dml.html"/>
</fileset>
</scp>
<scp failonerror="true" remoteTodir="${www.url.stats}" keyfile="~/.ssh/id_rsa" knownhosts="~/.ssh/known_hosts">
Expand Down Expand Up @@ -2816,6 +2817,27 @@
</exec>
</target>

<!--
generate.html.members
Generates a HTML table of member names and comments
bodge-eacute.pl is an awful bodge to fix encodings
-->
<target name="generate.html.members">
<echo>Running generate.html.members XSLT</echo>
<exec executable="xsltproc" failonerror="true">
<arg value="--output" />
<arg value="${build.dir}/dml.html" />
<arg value="${utilities.dir}/memberlist.xsl" />
<arg value="${members.dir}/members.xml" />
</exec>
<exec executable="perl" failonerror="true">
<arg value="${utilities.dir}/bodge-eacute.pl" />
<arg value="${build.dir}/dml.html" />
</exec>
</target>

<!--
generate.html.randssps
Expand Down
44 changes: 44 additions & 0 deletions utilities/memberlist.xsl
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:members="http://ukfederation.org.uk/2007/01/members"
exclude-result-prefixes="xsl xsi members"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes"/>

<xsl:variable name="memberCount" select="count(//members:Member)" />

<xsl:template match="members:Members">
<h1>UK federation member organisations (<xsl:value-of select="$memberCount" />)</h1>
<xsl:text>&#10;</xsl:text>
<table width="80%" cellpadding="4" cellspacing="0" border="1" class="tiger">
<tr valign="top"><th align="left">Member Organisation</th></tr>
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates />
</table>
</xsl:template>

<xsl:template match="members:Member">
<tr class="ind1" valign="top">
<xsl:text>&#10;</xsl:text>
<td align="left">
<xsl:text>&#10;</xsl:text>
<xsl:value-of select="members:Name"/>
<xsl:text>&#10;</xsl:text>
<xsl:choose>
<xsl:when test="members:NameComment">
<br />
<xsl:text>(</xsl:text>
<xsl:value-of select="members:NameComment"/>
<xsl:text>)&#10;</xsl:text>
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:template>

<xsl:template match="text()">
<!-- do nothing -->
</xsl:template>
</xsl:stylesheet>

0 comments on commit 68956dc

Please sign in to comment.