| 76 | | <xsl:choose> |
|---|
| 77 | | <xsl:when test="/bedework/appvar/key = 'filter'"> |
|---|
| 78 | | <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/> |
|---|
| 79 | | <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/> |
|---|
| 80 | | <!-- Define filters here: --> |
|---|
| 81 | | <xsl:choose> |
|---|
| 82 | | <xsl:when test="$filterName = 'grpAndCats'"> |
|---|
| 83 | | <xsl:call-template name="processGrpAndCats"><xsl:with-param name="list" select="$filterVal"/></xsl:call-template> |
|---|
| 84 | | <xsl:apply-templates select="/bedework/events/event[creator = $filterVal]"/> |
|---|
| 85 | | </xsl:when> |
|---|
| 86 | | <xsl:otherwise> |
|---|
| 87 | | <!-- Filter name not defined? Turn off filtering. --> |
|---|
| 88 | | <xsl:apply-templates select="/bedework/events/event"/> |
|---|
| 89 | | </xsl:otherwise> |
|---|
| 90 | | </xsl:choose> |
|---|
| 91 | | </xsl:when> |
|---|
| 92 | | <xsl:otherwise> |
|---|
| 93 | | <xsl:apply-templates select="/bedework/events/event"/> |
|---|
| 94 | | </xsl:otherwise> |
|---|
| 95 | | </xsl:choose> |
|---|
| | 76 | <xsl:apply-templates select="/bedework/events/event"/> |
|---|
| 100 | | <xsl:template name="processGrpAndCats"> |
|---|
| 101 | | <xsl:param name="list" /> |
|---|
| 102 | | <xsl:variable name="group" select="substring-before($list, '~')" /> |
|---|
| 103 | | <xsl:variable name="remaining" select="substring-after($list, '~')" /> |
|---|
| 104 | | <xsl:call-template name="processCategories"> |
|---|
| 105 | | <xsl:with-param name="group" select="$group" /> |
|---|
| 106 | | <xsl:with-param name="list" select="$remaining" /> |
|---|
| 107 | | </xsl:call-template> |
|---|
| 108 | | </xsl:template> |
|---|
| 109 | | |
|---|
| 110 | | <xsl:template name="processCategories"> |
|---|
| 111 | | <xsl:param name="group" /> |
|---|
| 112 | | <xsl:param name="list" /> |
|---|
| 113 | | <xsl:choose> |
|---|
| 114 | | <xsl:when test="contains($list, '~')"> |
|---|
| 115 | | <!-- Grab the first off the list and process --> |
|---|
| 116 | | <xsl:variable name="catid" select="substring-before($list, '~')" /> |
|---|
| 117 | | <xsl:variable name="remaining" select="substring-after($list, '~')" /> |
|---|
| 118 | | <xsl:choose> |
|---|
| 119 | | <xsl:when test="$group = 'all'"> |
|---|
| 120 | | <xsl:apply-templates select="/bedework/events/event[categories/category/id = $catid]" /> |
|---|
| 121 | | </xsl:when> |
|---|
| 122 | | <xsl:otherwise> |
|---|
| 123 | | <xsl:apply-templates select="/bedework/events/event[categories/category/id = $catid]" /> |
|---|
| 124 | | </xsl:otherwise> |
|---|
| 125 | | </xsl:choose> |
|---|
| 126 | | |
|---|
| 127 | | <!-- now use recursion to process the remaining categories --> |
|---|
| 128 | | <xsl:call-template name="processCategories"> |
|---|
| 129 | | <xsl:with-param name="list" select="$remaining" /> |
|---|
| 130 | | </xsl:call-template> |
|---|
| 131 | | </xsl:when> |
|---|
| 132 | | <xsl:otherwise> |
|---|
| 133 | | <!-- No more tildes, so this is the last category. Process it --> |
|---|
| 134 | | <xsl:choose> |
|---|
| 135 | | <xsl:when test="$group = 'all'"> |
|---|
| 136 | | <xsl:choose> |
|---|
| 137 | | <xsl:when test="$list = 'all'"> |
|---|
| 138 | | <xsl:apply-templates select="/bedework/events/event" /> |
|---|
| 139 | | </xsl:when> |
|---|
| 140 | | <xsl:otherwise> |
|---|
| 141 | | <xsl:apply-templates select="/bedework/events/event[categories/category/id = $list]" /> |
|---|
| 142 | | </xsl:otherwise> |
|---|
| 143 | | </xsl:choose> |
|---|
| 144 | | </xsl:when> |
|---|
| 145 | | <xsl:otherwise> |
|---|
| 146 | | <xsl:choose> |
|---|
| 147 | | <xsl:when test="$list = 'all'"> |
|---|
| 148 | | <xsl:apply-templates select="/bedework/events/event[creator = $group]" /> |
|---|
| 149 | | </xsl:when> |
|---|
| 150 | | <xsl:otherwise> |
|---|
| 151 | | <xsl:choose> |
|---|
| 152 | | <xsl:when test="/bedework/events/events/creator = $group"> |
|---|
| 153 | | <xsl:apply-templates select="/bedework/events/event[categories/category/id = $list]" /> |
|---|
| 154 | | </xsl:when> |
|---|
| 155 | | </xsl:choose> |
|---|
| 156 | | </xsl:otherwise> |
|---|
| 157 | | </xsl:choose> |
|---|
| 158 | | </xsl:otherwise> |
|---|
| 159 | | </xsl:choose> |
|---|
| 160 | | </xsl:otherwise> |
|---|
| 161 | | </xsl:choose> |
|---|
| 162 | | </xsl:template> |
|---|
| 163 | | |
|---|
| | 81 | |
|---|