<?xml version='1.0'?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="titles">
	<Titles>
		<xsl:apply-templates select="title"/>
	</Titles>
</xsl:template>

<xsl:template match="title">
	<xsl:variable name="t1">
		<xsl:if test="contains(title, '&#xA;')">
			<xsl:value-of select="tokenize(title, '&#xA;')"/>
		</xsl:if>
	</xsl:variable>

<!-- Error: on line 21 column 4 of file:///c:/Users/dbp/DOCUME~1/GUTENB~1/COMMUN~1/TITLES~1.XSL:   
SXXP0003: Error reported by XML parser: The element type "xsl:template" must be terminated by 
the matching end-tag "</xsl:template>".
	<xsl:variable name="t2" select="tokenize(title, '&#xA;')"/>
		<xsl:if test="count($t2) > 1"> {line 21}
			<xsl:value-of select="$t2"/>
		</xsl:if>
	</xsl:variable> -->

	<xsl:for-each select=".">
		<xsl:choose>
			<xsl:when test="contains(title, '&#xA;')">
				<title>
					<xsl:value-of select="$t1[1]"/>
				</title>
				<subtitle>
					<xsl:value-of select="concat($t1[2], $t1[3], $t1[4])"/>
				</subtitle>

			</xsl:when>
			<xsl:when test="not(contains(title, '&#xA;'))">
				<title>
					<xsl:value-of select="."/>
				</title>
			</xsl:when>
		</xsl:choose>
	</xsl:for-each>
	
</xsl:template>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2009. Progress Software Corporation. All rights reserved.

<metaInformation>
	<scenarios>
		<scenario default="yes" name="test variables" userelativepaths="yes" externalpreview="no" url="titles.xml" htmlbaseurl="" outputurl="titlesOuput.xml" processortype="saxon8" useresolver="yes" profilemode="0" profiledepth="" profilelength=""
		          urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal"
		          customvalidator="">
			<advancedProp name="sInitialMode" value=""/>
			<advancedProp name="bXsltOneIsOkay" value="true"/>
			<advancedProp name="bSchemaAware" value="true"/>
			<advancedProp name="bXml11" value="false"/>
			<advancedProp name="iValidation" value="0"/>
			<advancedProp name="bExtensions" value="true"/>
			<advancedProp name="iWhitespace" value="0"/>
			<advancedProp name="sInitialTemplate" value=""/>
			<advancedProp name="bTinyTree" value="true"/>
			<advancedProp name="bWarnings" value="true"/>
			<advancedProp name="bUseDTD" value="false"/>
			<advancedProp name="iErrorHandling" value="fatal"/>
		</scenario>
	</scenarios>
	<MapperMetaTag>
		<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
		<MapperBlockPosition></MapperBlockPosition>
		<TemplateContext></TemplateContext>
		<MapperFilter side="source"></MapperFilter>
	</MapperMetaTag>
</metaInformation>
-->