<?xml version="1.0" ?>

<!-- List of the external resources that we are referencing -->
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
	xmlns:mt="http://www.tiews.info/office/2008/bibliography">

<!-- <<<TestMode>>> =============================================================================================================
	param to enable Testmode, when using msxsl.exe - you have to add TestMode_HFH="XXX" 
	Possible values:
		Debug -> Enables complete output of Bibliography and citiations for a given sources.xml
		
	Sample command line to use this stylesheet with msxsl.exe and set the TestMode param:
		msxsl.exe -o complete_bib_cit.html "%appdata%\Microsoft\Bibliography\Sources.xml" HFH.xsl TestMode_HFH="Debug"
	
-->
<xsl:param name="TestMode_HFH" select="InProduction" /> 

<xsl:template match="mt:IsDebug">
        <xsl:if test="$TestMode_HFH='Debug'">
                <xsl:apply-templates />
        </xsl:if>
</xsl:template>

<xsl:template match="b:Sources">
	<mt:IsDebug>
		<html xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:t="http://www.microsoft.com/temp" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
		<head>
			<style>
				p.MsoBibliography, li.MsoBibliography, div.MsoBibliography
		    </style>
		</head>
		<body>
			<b><u>Bibliography</u></b><br/>
			<xsl:call-template name="Bibliography_Internal"/>
			<b><u>Citation</u></b><br/><br/>
			<xsl:for-each select="b:Source">
				<xsl:call-template name="Citation_Internal"/>
				<br/><br/>
			</xsl:for-each>
		</body>
		</html>
	</mt:IsDebug>
</xsl:template>  
<!-- <<<///TestMode>>> ============================================================================================================= -->

<!-- <<<GlobalHelper>>> ============================================================================================================= -->
<xsl:template name="PrintError">
	<xsl:param name="ErrorMessage"/>
	<b>
	<xsl:text>##FEHLER:</xsl:text>
		<xsl:value-of select="$ErrorMessage"/>
	<xsl:text>##</xsl:text>
	</b>
</xsl:template>  
<!-- <<<///GlobalHelper>>> ============================================================================================================= -->

<!-- When the bibliography or citation is in your document, it's just HTML -->
<xsl:output method="html" encoding="us-ascii"/>

<!-- Match the root element, and dispatch to its children -->
<xsl:template match="/">
	<xsl:apply-templates select="*" />
</xsl:template>

<!--Set an optional version number for this style-->

<xsl:template match="b:version">
	<xsl:text>2008.04.19</xsl:text>
</xsl:template> 

<!-- Defines the name of the style in the References dropdown -->
<xsl:template match="b:StyleName">
	<xsl:text>HFH</xsl:text>
</xsl:template> 


<!-- <<<Important Fields>>> =============================================================================================================-->
<!-- Book / Buch -->
<xsl:template match="b:GetImportantFields[b:SourceType = 'Book']">
	<b:ImportantFields>
		<b:ImportantField><xsl:text>b:Author/b:Author/b:NameList</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Year</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Title</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Volume</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Edition</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:City</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Publisher</xsl:text></b:ImportantField> 
	</b:ImportantFields>
</xsl:template>

<!-- BookSection / Buchabschnitt-->
<xsl:template match="b:GetImportantFields[b:SourceType = 'BookSection']">
	<b:ImportantFields>
		<b:ImportantField><xsl:text>b:Author/b:Author/b:NameList</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Year</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Title</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Volume</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Edition</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:City</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Publisher</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Pages</xsl:text></b:ImportantField> 
	</b:ImportantFields>
</xsl:template>

<!-- Aufsatz/Artikel aus Zeitschrift/Magazin -->
<xsl:template match="b:GetImportantFields[b:SourceType = 'ArticleInAPeriodical']">
	<b:ImportantFields>
		<b:ImportantField><xsl:text>b:Author/b:Author/b:NameList</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Year</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Title</xsl:text></b:ImportantField>
		<!-- "in" or "In" -->
		<b:ImportantField><xsl:text>b:PeriodicalTitle</xsl:text></b:ImportantField>
		<!-- Jahrgang -->
		<b:ImportantField><xsl:text>b:Volume</xsl:text></b:ImportantField>
		<!-- Heftnummer -->
		<b:ImportantField><xsl:text>b:Issue</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Pages</xsl:text></b:ImportantField> 
	</b:ImportantFields>
</xsl:template>

<!-- Zeitungsartikel -->
<xsl:template match="b:GetImportantFields[b:SourceType = 'JournalArticle']">
	<b:ImportantFields>
		<b:ImportantField><xsl:text>b:Author/b:Author/b:NameList</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Year</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Month</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Day</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Title</xsl:text></b:ImportantField>
		<!-- "in" or "In" -->
		<b:ImportantField><xsl:text>b:JournalName</xsl:text></b:ImportantField>
		<!-- Heftnummer -->
		<b:ImportantField><xsl:text>b:Issue</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Pages</xsl:text></b:ImportantField> 
	</b:ImportantFields>
</xsl:template>

<!-- Website -->
<xsl:template match="b:GetImportantFields[b:SourceType = 'InternetSite']">
	<b:ImportantFields>
		<b:ImportantField><xsl:text>b:Author/b:Author/b:NameList</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Title</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:URL</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Year</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Month</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Day</xsl:text></b:ImportantField> 
	</b:ImportantFields>
</xsl:template>

<!-- Artikel auf einer Website -->
<xsl:template match="b:GetImportantFields[b:SourceType = 'DocumentFromInternetSite']">
	<b:ImportantFields>
		<b:ImportantField><xsl:text>b:Author/b:Author/b:NameList</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Title</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:URL</xsl:text></b:ImportantField>
		<b:ImportantField><xsl:text>b:Year</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Month</xsl:text></b:ImportantField> 
		<b:ImportantField><xsl:text>b:Day</xsl:text></b:ImportantField> 
	</b:ImportantFields>
</xsl:template>

<!-- <<<///Important Fields>>> =============================================================================================================-->

<!-- <<<ImportantFieldsOutputTypes=========================================================================================================== -->
<xsl:template name="Year">
	
	<xsl:variable name="year" select="b:Year"/>
	
	<xsl:text>(</xsl:text>
		<xsl:choose>
			<xsl:when test="string-length($year) > 0">
				<xsl:value-of select="$year"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>o. J.</xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	<xsl:text>)</xsl:text>
</xsl:template>

<xsl:template name="Title">
	
	<xsl:variable name="title" select="b:Title"/>
	
	<xsl:choose>
		<xsl:when test="string-length($title) > 0">
			<xsl:value-of select="$title"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Titel angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template name="Edition">
	
	<xsl:variable name="edition" select="b:Edition"/>
	
	<xsl:if test="string-length($edition) > 0">
		<xsl:text>, </xsl:text>
		<xsl:value-of select="$edition"/>
	</xsl:if>
</xsl:template>

<xsl:template name="Volume">
	
	<xsl:variable name="volume" select="b:Volume"/>
	
	<xsl:if test="string-length($volume) > 0">
		<xsl:text>, </xsl:text>
		<xsl:value-of select="$volume"/>
	</xsl:if>
</xsl:template>

<xsl:template name="CityAndPublisher">
	
	<xsl:text>, </xsl:text>
	
	<xsl:variable name="city" select="b:City"/>
	
	<xsl:choose>
		<xsl:when test="string-length($city) > 0">
			<xsl:value-of select="$city"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:text>o. O.</xsl:text>	
		</xsl:otherwise>
	</xsl:choose>
	
	<xsl:text>: </xsl:text>
	
	<xsl:variable name="publisher" select="b:Publisher"/>
	
	<xsl:choose>
		<xsl:when test="string-length($publisher) > 0">
			<xsl:value-of select="$publisher"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Verleger angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="JournalName">
	
	<xsl:variable name="journalname" select="b:JournalName"/>
	
	<xsl:choose>
		<xsl:when test="string-length($journalname) > 0">
			<xsl:value-of select="$journalname"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Zeitungstitel angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="PeriodicalTitle">
	
	<xsl:variable name="periodicaltitle" select="b:PeriodicalTitle"/>
	
	<xsl:choose>
		<xsl:when test="string-length($periodicaltitle) > 0">
			<xsl:value-of select="$periodicaltitle"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Magazintitel angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="PeriodicalVolume">
	
	<xsl:variable name="volume" select="b:Volume"/>

	<xsl:text>, </xsl:text>
	
	<xsl:choose>
		<xsl:when test="string-length($volume) > 0">
			<xsl:text>Jg. </xsl:text>	
			<xsl:value-of select="$volume"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:text>o. Jg.</xsl:text>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="PeriodicalIssue">
	
	<xsl:variable name="issue" select="b:Issue"/>

	<xsl:text>, </xsl:text>
	
	<xsl:choose>
		<xsl:when test="string-length($issue) > 0">
			<xsl:text>H. </xsl:text>	
			<xsl:value-of select="$issue"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Keine Ausgabe angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="PeriodicalAndJournalPages">
	
	<xsl:variable name="pages" select="b:Pages"/>

	<xsl:text>, </xsl:text>
	
	<xsl:choose>
		<xsl:when test="string-length($pages) > 0">
			<xsl:text>S. </xsl:text>	
			<xsl:value-of select="$pages"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Keine Seite(n) angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="NumberAndDateJournal">
	
	<xsl:variable name="issue" select="b:Issue"/>

	<xsl:text>, </xsl:text>
	
	<xsl:choose>
		<xsl:when test="string-length($issue) > 0">
			<xsl:text>Nr. </xsl:text>	
			<xsl:value-of select="$issue"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Keine Ausgabe angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
	<xsl:text> vom </xsl:text>

	<xsl:variable name="day" select="b:Day"/>
	<xsl:choose>
		<xsl:when test="string-length($day) > 0">
			<xsl:value-of select="$day"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Tag angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>
	<xsl:text>.</xsl:text>
	<xsl:variable name="month" select="b:Month"/>
	<xsl:choose>
		<xsl:when test="string-length($month) > 0">
			<xsl:value-of select="$month"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Monat angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
	<xsl:text>.</xsl:text>
	<xsl:variable name="year" select="b:Year"/>
	<xsl:choose>
		<xsl:when test="string-length($year) > 0">
			<xsl:value-of select="$year"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Jahr angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>		
</xsl:template>

<xsl:template name="Pages">
	
	<xsl:variable name="pages" select="b:Pages"/>

	<xsl:text>, </xsl:text>
	
	<xsl:choose>
		<xsl:when test="string-length($pages) > 0">
			<xsl:text>S. </xsl:text>	
			<xsl:value-of select="$pages"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Keine Seite(n) angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
</xsl:template>

<xsl:template name="OnlineURL">
	
	
</xsl:template>

<xsl:template name="OnlineUrlAndDate">
	
	
	<xsl:text>. Online in Internet: "</xsl:text>
	
	<xsl:variable name="url" select="b:URL"/>
	<xsl:choose>
		<xsl:when test="string-length($url) > 0">
			<xsl:value-of select="$url"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Keine URL angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
	
	<xsl:text> [Stand: </xsl:text>

	<xsl:variable name="day" select="b:Day"/>
	<xsl:choose>
		<xsl:when test="string-length($day) > 0">
			<xsl:value-of select="$day"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Tag angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>
	<xsl:text>.</xsl:text>
	<xsl:variable name="month" select="b:Month"/>
	<xsl:choose>
		<xsl:when test="string-length($month) > 0">
			<xsl:value-of select="$month"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Monat angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	
	<xsl:text>.</xsl:text>
	<xsl:variable name="year" select="b:Year"/>
	<xsl:choose>
		<xsl:when test="string-length($year) > 0">
			<xsl:value-of select="$year"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'Kein Jahr angegeben'"/>
			</xsl:call-template>	
		</xsl:otherwise>
	</xsl:choose>	

	<xsl:text>]"</xsl:text>
	
</xsl:template>
<!-- <<<///ImportantFieldsOutputTypes=========================================================================================================== -->

<!-- <<<///GlobalFieldsHelper=========================================================================================================== -->
<xsl:template name="AuthorList">
	<xsl:param name="ShortList"/>
	<xsl:param name="UpperCase"/>
	
	<xsl:variable name="NoOfAuthors" select="count(b:Author/b:Author/b:NameList/b:Person)"/>
	  
	<xsl:choose>
		<xsl:when test="$NoOfAuthors = 0">
			<xsl:text>O. V.</xsl:text>	
		</xsl:when>
		<xsl:when test="$NoOfAuthors &lt; 3">
			<xsl:for-each select="b:Author/b:Author/b:NameList/b:Person">
				<xsl:call-template name="AuthorName">
					<xsl:with-param name="LotMoreAuthors" select="false()"/>
					<xsl:with-param name="IncludeFirstName" select="not($ShortList)"/>
					<xsl:with-param name="UpperCase" select="$UpperCase"/>
				</xsl:call-template>
				<xsl:choose>
					<xsl:when test="position() = $NoOfAuthors">
					</xsl:when>
					<xsl:otherwise>
						<xsl:text>/</xsl:text>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</xsl:when>
		<xsl:otherwise>
			<xsl:for-each select="b:Author/b:Author/b:NameList/b:Person[1]">
				<xsl:call-template name="AuthorName">
					<xsl:with-param name="LotMoreAuthors" select="true()"/>
					<xsl:with-param name="IncludeFirstName" select="not($ShortList)"/>
					<xsl:with-param name="UpperCase" select="$UpperCase"/>
				</xsl:call-template>
			</xsl:for-each>	
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>	

<xsl:template name="AuthorName">
	<xsl:param name="LotMoreAuthors"/>
	<xsl:param name="IncludeFirstName"/>
	<xsl:param name="UpperCase"/>
	
	<!-- Capitalize or UpperCase -->
	<xsl:element name="span">
	<xsl:choose>
		<xsl:when test="$UpperCase = true()">
			<xsl:attribute name="style">
				<xsl:text>text-transform:uppercase;</xsl:text>
			</xsl:attribute>
		</xsl:when>
		<xsl:otherwise>
			<xsl:attribute name="style">
				<xsl:text>font-variant:small-caps;</xsl:text>
			</xsl:attribute>
		</xsl:otherwise>
	</xsl:choose>
	
	
	<!-- last name -->	
	<xsl:choose>
		<xsl:when test="string-length(b:Last) = 0">
			<xsl:call-template name="PrintError">
				<xsl:with-param name="ErrorMessage" select="'empty last name'"/>
			</xsl:call-template>	
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="b:Last"/>
		</xsl:otherwise>
	</xsl:choose>
	
	<!-- first name -->
	<xsl:if test="$IncludeFirstName = true()">
		<xsl:choose>
			<xsl:when test="string-length(b:First) = 0">
				<xsl:call-template name="PrintError">
					<xsl:with-param name="ErrorMessage" select="'empty first name'"/>
				</xsl:call-template>	
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>, </xsl:text>
				<xsl:value-of select="substring(b:First,1,1)"/>
				<xsl:text>.</xsl:text>
			</xsl:otherwise>
		</xsl:choose>	
	</xsl:if>
	
	</xsl:element>
	
	<!-- more authors -->
	<xsl:if test="$LotMoreAuthors = true()">
		<xsl:text> u.a.</xsl:text>
	</xsl:if>
	
</xsl:template>
<!-- <<<///GlobalFieldsHelper=========================================================================================================== -->

<!-- <<<DifferentOutputTypes=========================================================================================================== -->
<xsl:template match="b:Source[b:SourceType = 'Book']">
	<p class="MsoBibliography">
		<xsl:call-template name="AuthorList">
			<xsl:with-param name="ShortList" select="false()"/>
			<xsl:with-param name="UpperCase" select="false()"/>
		</xsl:call-template>
		<xsl:text> </xsl:text>
		<xsl:call-template name="Year"/>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="Title"/>
		<xsl:call-template name="Volume"/>
		<xsl:call-template name="Edition"/>
		<xsl:call-template name="CityAndPublisher"/>
		<xsl:text>.</xsl:text>
	</p>
</xsl:template>

<xsl:template match="b:Source[b:SourceType = 'BookSection']">
	<p class="MsoBibliography">
		<xsl:call-template name="AuthorList">
			<xsl:with-param name="ShortList" select="false()"/>
			<xsl:with-param name="UpperCase" select="false()"/>
		</xsl:call-template>
		<xsl:text> </xsl:text>
		<xsl:call-template name="Year"/>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="Title"/>
		<xsl:call-template name="Volume"/>
		<xsl:call-template name="Edition"/>
		<xsl:call-template name="CityAndPublisher"/>
		<xsl:call-template name="Pages"/>
		<xsl:text>.</xsl:text>
	</p>
</xsl:template>

<xsl:template match="b:Source[b:SourceType = 'ArticleInAPeriodical']">
	<p class="MsoBibliography">
		<xsl:call-template name="AuthorList">
			<xsl:with-param name="ShortList" select="false()"/>
			<xsl:with-param name="UpperCase" select="false()"/>
		</xsl:call-template>
		<xsl:text> </xsl:text>
		<xsl:call-template name="Year"/>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="Title"/>
		<xsl:text>. In: </xsl:text>
		<xsl:call-template name="PeriodicalTitle"/>
		<xsl:call-template name="PeriodicalVolume"/>
		<xsl:call-template name="PeriodicalIssue"/>
		<xsl:call-template name="PeriodicalAndJournalPages"/>
		<xsl:text>.</xsl:text>
	</p>
</xsl:template>

<xsl:template match="b:Source[b:SourceType = 'JournalArticle']">
	<p class="MsoBibliography">
		<xsl:call-template name="AuthorList">
			<xsl:with-param name="ShortList" select="false()"/>
			<xsl:with-param name="UpperCase" select="false()"/>
		</xsl:call-template>
		<xsl:text> </xsl:text>
		<xsl:call-template name="Year"/>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="Title"/>
		<xsl:text>. In: </xsl:text>
		<xsl:call-template name="JournalName"/>
		<xsl:call-template name="NumberAndDateJournal"/>
		<xsl:call-template name="PeriodicalAndJournalPages"/>
		<xsl:text>.</xsl:text>
	</p>
</xsl:template>

<xsl:template match="b:Source[b:SourceType = 'InternetSite']">
	<p class="MsoBibliography">
		<xsl:call-template name="AuthorList">
			<xsl:with-param name="ShortList" select="false()"/>
			<xsl:with-param name="UpperCase" select="false()"/>
		</xsl:call-template>
		<xsl:text> </xsl:text>
		<xsl:call-template name="Year"/>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="Title"/>
		<xsl:call-template name="OnlineUrlAndDate"/>
		<xsl:text>.</xsl:text>
	</p>
</xsl:template>

<xsl:template match="b:Source[b:SourceType = 'DocumentFromInternetSite']">
	<p class="MsoBibliography">
		<xsl:call-template name="AuthorList">
			<xsl:with-param name="ShortList" select="false()"/>
			<xsl:with-param name="UpperCase" select="false()"/>
		</xsl:call-template>
		<xsl:text> </xsl:text>
		<xsl:call-template name="Year"/>
		<xsl:text>: </xsl:text>
		<xsl:call-template name="Title"/>
		<xsl:call-template name="OnlineUrlAndDate"/>
		<xsl:text>.</xsl:text>
	</p>
</xsl:template>
<!-- <<<///DifferentOutputTypes=========================================================================================================== -->

<!-- <<<Complete_Bibliography>>> =============================================================================================================
	Defines the output of the entire Bibliography -->
<xsl:template match="b:Bibliography">
	<html xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:t="http://www.microsoft.com/temp" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
	<head>
		<style>
			p.MsoBibliography, li.MsoBibliography, div.MsoBibliography
	    </style>
	</head>
	<body>
		<xsl:call-template name="Bibliography_Internal"/>
	</body>
	</html>
</xsl:template> 

<xsl:template name="Bibliography_Internal">
	<xsl:apply-templates select ="*">
		<xsl:sort select="b:Author/*/b:NameList/b:Person"/>
    </xsl:apply-templates>
</xsl:template> 

<b:SortingString>
      <xsl:value-of select="b:Author/*/b:NameList/b:Person"/>
</b:SortingString>
<!-- <<<///Complete_Bibliography>>> ============================================================================================================= -->

<!-- <<<CitationOutput>>> =============================================================================================================
	Defines the output of the Citation -->
<xsl:template match="b:Citation/b:Source">
	<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
		<head>
		</head>
		<body>
			<xsl:call-template name="Citation_Internal"/>
		</body>
	</html>
</xsl:template> 

<xsl:template name="Citation_Internal">
	
	<xsl:text>(</xsl:text>
	
	<xsl:choose>
		<xsl:when test="../b:NoTitle">
			<xsl:text>vgl. </xsl:text>
		</xsl:when>
	</xsl:choose>
	
	<!-- Author(s) -->
	<xsl:choose>
		<xsl:when test="../b:NoAuthor">
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="AuthorList">
				<xsl:with-param name="ShortList" select="true()"/>
				<xsl:with-param name="IncludeFirstName" select="false()"/>
				<xsl:with-param name="UpperCase" select="true()"/>
			</xsl:call-template>
		</xsl:otherwise>
	</xsl:choose>
	
	<!-- Year -->
	<xsl:choose>
		<xsl:when test="../b:NoYear">
		</xsl:when>
		<xsl:otherwise>
			<xsl:text> </xsl:text>
			<xsl:value-of select="b:Year"/>
		</xsl:otherwise>
	</xsl:choose>
	
	<!-- Pages -->
	<!-- can be set by using the context menu of an individual citation -->
	<xsl:variable name="mainpages" select="../b:Pages"/>
	<xsl:choose>
		<xsl:when test="$mainpages!='0' and string-length($mainpages)>0">
			<xsl:text>, </xsl:text>
			<xsl:value-of select="$mainpages"/>
		</xsl:when>	
		<xsl:otherwise>
			<!-- page from the bibliography itself -->
			<xsl:variable name="pages" select="b:Pages"/>
			<xsl:if test="$pages!='0' and string-length($pages)>0">
				<xsl:text>, </xsl:text>
				<xsl:value-of select="$pages"/>
			</xsl:if>
		</xsl:otherwise>
	</xsl:choose>
	
	<!--
	<xsl:for-each select="*">
		<xsl:text> ##.##</xsl:text>
		<xsl:value-of select="local-name()"/>
		<xsl:value-of select="."/>
		<xsl:text># </xsl:text>
	</xsl:for-each>
	<xsl:for-each select="../*">
		<xsl:text> ##..##</xsl:text>
		<xsl:value-of select="local-name()"/>
		<xsl:value-of select="."/>
		<xsl:text># </xsl:text>
	</xsl:for-each>
	-->
	
	<xsl:text>)</xsl:text>
	
</xsl:template> 
<!-- <<<///CitationOutput>>> =============================================================================================================-->

<xsl:template match="text()" />
</xsl:stylesheet> 
