<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE stylesheet [
    <!ENTITY nbsp "&#160;">
]>
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <!--* Generate mgp slides *-->

  <output method="text" />

 <!--* strip white space from containers that don't have PCDATA in
     * them; this list may not be complete.
     * XSLT should have a way of doing this based on the DTD.
     *-->
 <strip-space
     elements="talk list slide code item"
 />

  <template match="talk">%include "style/default.mgp"<text>
</text>
<apply-templates/>
<!-- <text>
%page

[end]

</text>-->
</template>

<template name="addtab">
	<param name="count" select="1"/>
	<choose>
	<when test="$count = 1">
		<text>	</text>
	</when>
	<otherwise>
		<text>	</text>
		<call-template name="addtab">
			<with-param name="count" select="$count - 1"/>
		</call-template>
	</otherwise>
	</choose>
</template>

  <!--* *-->
<template match="slide">
	<text>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%page
</text>
	<apply-templates/>
</template>

<!-- slide mode="ofN" -->
<template match="slide" mode="ofN">
	<if test="position() = last()">
		<value-of select="position()"/>
	</if>
</template>

<!-- title -->
<template match="title"><text>
</text>
<!--    <text>Slide </text>
    <number count="slide"/>
    <text> of </text>
    <apply-templates select="//slide" mode="ofN"/>
    <text>: </text>--><apply-templates/><text>
%right
</text>
    <text>Slide </text>
    <number count="slide"/>
    <text> of </text>
    <apply-templates select="//slide" mode="ofN"/>
	<text>  
%leftfill
</text>
</template>

<template match="list"><apply-templates/></template>

<template match="code"><apply-templates/></template>

<template match="tt">
	<text>&#38;TT </text>
	<apply-templates/>
<!--		<if test="not(ancestor::item)">-->
	<text>

</text>
</template>

<!-- item -->
<template match="item">
	<variable name="level" select="count(ancestor::list)"/>
	<if test="../@actuate = 'pause'">
		<text>%pause
</text>
    </if>
    <choose>
	<when test="ancestor::code">
		<text>%font "typewriter"
    </text>
	</when>
	<otherwise>
		<call-template name="addtab">
			<with-param name="count" select="$level"/>
		</call-template>
	</otherwise>
	</choose>
	<apply-templates/>
		<text>

</text>
</template>

<!-- image -->
<template match="image">
	<choose>
	<when test="@align">
		<text>%</text>
		<value-of select="@align"/>
		<text>
</text>
	</when>
	<otherwise>
		<text>%center
</text>
	</otherwise>
	</choose>
	<text>%image "</text>
	<apply-templates/>
	<text>"

</text>
</template>

<!-- run -->
<template match="run">
	<text>%system "</text>
	<apply-templates/>
	<text>"
</text>
</template>

</stylesheet>
