| |
---|
| | * the immediately preceding week /is/ a holiday. |
---|
| | |
---|
| | (YOUR HEAD ASPLODE.) |
---|
| | --> |
---|
| | <xsl:if test="child::section |
---|
| | and ( ( ( count( ../preceding-sibling::week ) > 0 ) |
---|
| | and ( not( ../preceding-sibling::week[1]/@holiday ) ) |
---|
| | ) |
---|
| | or ( ( position() > 1 ) |
---|
| | and ( ( count( ../preceding-sibling::week ) = 0 ) |
---|
| | or ( ../preceding-sibling::week[1]/@holiday ) |
---|
| | ) |
---|
| | ) |
---|
| | )"> |
---|
| | <xsl:if test=" child::section |
---|
| | and ( ( ( count( ../preceding-sibling::week ) > 0 ) |
---|
| | and ( not( ../preceding-sibling::week[1]/@holiday ) ) |
---|
| | ) |
---|
| | or ( ( position() > 1 ) |
---|
| | and ( ( count( ../preceding-sibling::week ) = 0 ) |
---|
| | or ( ../preceding-sibling::week[1]/@holiday ) |
---|
| | ) |
---|
| | ) |
---|
| | )"> |
---|
| | <xsl:text>\cline{3-3}</xsl:text> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <!-- Output the week number and dates columns, but only on the first row of the week. --> |
---|
| |
---|
| | <xsl:apply-templates select="assessment" /> |
---|
| | |
---|
| | <!-- Note assumption that a lecture is always a single row. --> |
---|
| | <xsl:text> \\</xsl:text> |
---|
| | <!-- TODO: Need horrible logic similar to sections above. --> |
---|
| | <xsl:if test="( count( ../following-sibling::week ) > 0 ) and ( not( ../following-sibling::week[1]/@holiday ) )"> |
---|
| | <!-- |
---|
| | Put a border beneath a lecture. The horrible XPath logic is as follows: |
---|
| | |
---|
| | * either |
---|
| | * there is at least one week following the current week; and |
---|
| | * the immediately following week /isn't/ a holiday; |
---|
| | * or |
---|
| | * this is not the last row of the current week; and |
---|
| | * the current week is the last week in the calendar; or |
---|
| | * the immediately following week /is/ a holiday. |
---|
| | |
---|
| | (YOUR HEAD ASPLODE AGAIN.) |
---|
| | --> |
---|
| | <xsl:if test=" ( ( count( ../following-sibling::week ) > 0 ) |
---|
| | and ( not( ../following-sibling::week[1]/@holiday ) ) |
---|
| | ) |
---|
| | or ( ( position() < last() ) |
---|
| | and ( ( count( ../following-sibling::week ) = 0 ) |
---|
| | or ( ../following-sibling::week[1]/@holiday ) |
---|
| | ) |
---|
| | )"> |
---|
| | <xsl:text> \cline{4-5}</xsl:text> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <!-- |
---|
| | <xsl:if test="position() = ancestor::calendar/@lectures-per-week"> |
---|
| | <!-- |
---|
| | Underline laboratory and tutorial cells. Logic is as above, plus a test whether this is the last row of the week. (KER-SPLODEY.) |
---|
| | --> |
---|
| | <xsl:if test=" ( position() = ancestor::calendar/@lectures-per-week ) |
---|
| | and ( ( ( count( ../following-sibling::week ) > 0 ) |
---|
| | and ( not( ../following-sibling::week[1]/@holiday ) ) |
---|
| | ) |
---|
| | or ( ( position() < last() ) |
---|
| | and ( ( count( ../following-sibling::week ) = 0 ) |
---|
| | or ( ../following-sibling::week[1]/@holiday ) |
---|
| | ) |
---|
| | ) |
---|
| | )"> |
---|
| | <xsl:text>\cline{1-2}\cline{6-6}\cline{11-11}</xsl:text> |
---|
| | <xsl:if test="not( preceding::row[1]/laboratory/@rows )"> |
---|
| | <xsl:if test="not( ../row[1]/laboratory/@rows )"> |
---|
| | <xsl:text>\cline{7-8}</xsl:text> |
---|
| | </xsl:if> |
---|
| | <xsl:if test="not( preceding::row[1]/tutorial/@rows )"> |
---|
| | <xsl:if test="not( ../row[1]/tutorial/@rows )"> |
---|
| | <xsl:text>\cline{9-10}</xsl:text> |
---|
| | </xsl:if> |
---|
| | </xsl:if> |
---|
| | --> |
---|
| | |
---|
| | <xsl:call-template name="newline-internal" /> |
---|
| | </xsl:for-each> |
---|
| | </common> |
---|
| |
---|
|