rendered paste body<?xml version="1.0"?><!-- ============================================================= --><!-- MODULE: Scribus View of NLM Journal Article --><!-- VERSION: 0.10 --><!-- DATE: March 2008 --><!-- AUTHOR: Tarek Loubani / GPLv3 or later --><!-- ============================================================= --><xsl:transform version="1.0" id="ViewNLM-v2-04.xsl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:util="http://dtd.nlm.nih.gov/xsl/util" xmlns:mml="http://www.w3.org/1998/Math/MathML" exclude-result-prefixes="util xsl xlink mml"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:strip-space elements="*"/> <xsl:preserve-space elements="preformat"/> <!-- Run-time parameters --> <!-- This stylesheet accepts no run-time parameters. --> <!-- Keys --> <!-- To reduce dependency on a DTD for processing, we declare a key to use in lieu of the id() function. --> <xsl:key name="element-by-id" match="*[@id]" use="@id"/> <!-- Conversely, we can retrieve referencing elements from the node they reference. --> <xsl:key name="element-by-rid" match="*[@rid]" use="@rid"/> <!-- Lookup table for person-type strings used in nlm-citations --> <xsl:variable name="person-strings" select="document('')/*/util:map[@id='person-strings']/item"/> <util:map id="person-strings"> <item source="editor" singular="editor" plural="editors"/> <item source="assignee" singular="assignee" plural="assignees"/> <item source="translator" singular="translator" plural="translators"/> <item source="transed" singular="translator and editor" plural="translators and editors"/> <item source="guest-editor" singular="guest editor" plural="guest editors"/> <item source="compiler" singular="compiler" plural="compilers"/> <item source="inventor" singular="inventor" plural="inventors"/> <!-- value 'allauthors' puts no string out --> </util:map> <!-- ============================================================= --> <!-- 2. ROOT TEMPLATE - HANDLES HTML FRAMEWORK --> <!-- ============================================================= --> <xsl:template match="/"> <SCRIBUSUTF8NEW Version="1.3.5svn"> <DOCUMENT ANZPAGES="5" DPbla="1" GuideRad="10" SHOWLINK="0" TextLineColor="None" rulerYoffset="0" KEYWORDS="" SnapToGrid="0" COMMENTS="" rulerXoffset="0" DISc="1" WIDTH="1" MAJGRID="100" DPIn2="sRGB IEC61966-2.1" DOCIDENT="" ScratchTop="20" DPIn3="Fogra27L CMYK Coated Press" DPSo="0" PENLINE="Black" StartArrow="0" StrikeThruPos="-1" AUTHOR="" AUTOTEXT="1" PAGEHEIGHT="792.0000000000001" AutoSaveTime="600000" VHOCHSC="100" AUTOCHECK="0" ScratchBottom="20" DOCRIGHTS="" TabFill="" VKAPIT="75" SHOWControl="0" MAGMIN="10" showBleed="1" HYCOUNT="2" BORDERLEFT="40" LANGUAGE="English" PASPECT="1" BleedRight="0" BRUSH="Black" PICTSHADE="100" MINORC="#00ff00" PEN="Black" WIDTHLINE="1" SnapToGuides="0" BORDERTOP="40" BleedBottom="0" GUIDELOCK="0" ORIENTATION="0" BaseC="#c0c0c0" DOCTYPE="" PAGEWIDTH="612" DPgam="0" STIL="1" SHOWPICT="1" DOCSOURCE="" HCMS="0" TextBackGround="None" DPuse="0" PENSHADE="100" VTIEF="33" PICTSCX="1" PICTSCY="1" SHOWBASE="0" BleedTop="0" showcolborders="0" TextBackGroundShade="100" BORDERRIGHT="40" DPInCMYK="Fogra27L CMYK Coated Press" DPIn="sRGB IEC61966-2.1" TabWidth="36" BRUSHSHADE="100" DIIm="0" TITLE="" RANDF="0" ScratchLeft="100" BASEO="0" CPICT="None" MAJORC="#00ff00" GuideC="#000080" LINESHADE="100" StrikeThruWidth="-1" BleedLeft="0" PENTEXT="Black" DOCRELATION="" PAGEC="#ffffff" MINGRID="20" DOCLANGINFO="" ALAYER="0" GRAB="4" constrain="15" MINWORDLEN="3" AUTOSPALTEN="2" GuideZ="10" ABSTSPALTEN="19.84251968503937" MARGC="#0000ff" SHOWFRAME="1" EmbeddedPath="0" PAGESIZE="Letter" SHOWGRID="0" TextPenShade="100" FIRSTNUM="1" DOCDATE="" DPMo="sRGB IEC61966-2.1" DSIZE="12" ScratchRight="100" PUBLISHER="" DOCCOVER="" MAGMAX="3200" TextLineShade="100" SHOWGUIDES="0" DCOL="1" dispX="10" BASEGRID="14.4" VTIEFSC="100" dispY="10" GROUPC="1" UNITS="4" DPSFo="0" BORDERBOTTOM="40" DOCCONTRIB="" UnderlineWidth="-1" DFONT="Times New Roman Regular" showrulers="1" UnderlinePos="-1" BOOK="0" SHOWLAYERM="0" DOCFORMAT="" MAGSTEP="200" POLYFD="0" TextStrokeShade="100" DGAP="0" AUTOL="20" currentProfile="PostScript" EndArrow="0" AutoSave="0" GapHorizontal="0" SHOWMARGIN="1" DPPr="Fogra27L CMYK Coated Press" PSCALE="1" StrokeText="Black" BACKG="1" AUTOMATIC="1" POLYC="4" POLYF="0.707107" rulerMode="1" STILLINE="1" POLYR="0" POLYS="0" GapVertical="0" VHOCH="33" HalfRes="1" > <CheckProfile autoCheck="1" maxResolution="4800" checkTransparency="1" checkRasterPDF="1" checkOrphans="1" ignoreErrors="0" checkGlyphs="1" Name="PDF 1.3" checkPictures="1" checkOverflow="1" minResolution="72" checkForGIF="1" ignoreOffLayers="0" checkResolution="1" checkAnnotations="0" /> <CheckProfile autoCheck="1" maxResolution="4800" checkTransparency="0" checkRasterPDF="1" checkOrphans="1" ignoreErrors="0" checkGlyphs="1" Name="PDF 1.4" checkPictures="1" checkOverflow="1" minResolution="72" checkForGIF="1" ignoreOffLayers="0" checkResolution="1" checkAnnotations="0" /> <CheckProfile autoCheck="1" maxResolution="2400" checkTransparency="0" checkRasterPDF="1" checkOrphans="1" ignoreErrors="0" checkGlyphs="1" Name="PDF 1.5" checkPictures="1" checkOverflow="1" minResolution="72" checkForGIF="1" ignoreOffLayers="0" checkResolution="1" checkAnnotations="0" /> <CheckProfile autoCheck="1" maxResolution="4800" checkTransparency="1" checkRasterPDF="1" checkOrphans="1" ignoreErrors="0" checkGlyphs="1" Name="PDF/X-3" checkPictures="1" checkOverflow="1" minResolution="144" checkForGIF="1" ignoreOffLayers="0" checkResolution="1" checkAnnotations="1" /> <CheckProfile autoCheck="1" maxResolution="4800" checkTransparency="1" checkRasterPDF="1" checkOrphans="1" ignoreErrors="0" checkGlyphs="1" Name="PostScript" checkPictures="1" checkOverflow="1" minResolution="72" checkForGIF="1" ignoreOffLayers="0" checkResolution="1" checkAnnotations="0" /> <COLOR Spot="0" Register="0" NAME="Black" CMYK="#000000ff" /> <COLOR Spot="0" RGB="#875700" Register="0" NAME="OM Gold" /> <COLOR Spot="0" RGB="#870000" Register="0" NAME="OM Red" /> <COLOR Spot="0" Register="0" NAME="White" CMYK="#00000000" /> <HYPHEN/> <STYLE DROPDIST="0" ALIGN="0" LINESP="15" VOR="0" RMARGIN="0" NACH="0" DROPLIN="2" LINESPMode="0" INDENT="0" FIRST="0" NAME="Default Paragraph Style" DROP="0" /> <STYLE LINESP="32.4" DROPLIN="2" NACH="42.5197" FONTSIZE="18" NAME="Title" FCOLOR="OM Red" FONT="Trebuchet MS Bold" /> <STYLE LINESP="14.4" TXTSHY="-5" DROPLIN="2" NACH="42.5197" FONTSIZE="12" NAME="Byline" FCOLOR="OM Gold" FONT="Copperplate Light" /> <STYLE ALIGN="3" LINESP="12" DROPLIN="2" FONTSIZE="10" NAME="Text - Section paragraph" FCOLOR="Black" FONT="Georgia Regular" /> <STYLE LINESP="9.6" DROPLIN="2" NACH="8.50394" FONTSIZE="8" NAME="Front Matter" FCOLOR="Black" FONT="Trebuchet MS Regular" /> <STYLE ALIGN="3" LINESP="12" VOR="42.5197" DROPLIN="3" FONTSIZE="10" NAME="Text - First Paragraph" FCOLOR="Black" DROP="1" FONT="Georgia Regular" /> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="3" TXTSHX="5" BASE="0" LINESP="12" TXTSHY="-5" VOR="0" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="0" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="14.1732" INDENT="0" FONTSIZE="10" NAME="Article Text" FCOLOR="Black" SCALEH="100" TXTOUT="1" DROP="0" FONT="Georgia Regular" TXTSTP="-0.1" TXTULW="-0.1" /> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="0" TXTSHX="5" BASE="0" LINESP="13.2" TXTSHY="-5" VOR="8.50394" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="2.83465" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="0" INDENT="0" FONTSIZE="11" NAME="Title in Body" FCOLOR="OM Red" SCALEH="100" TXTOUT="1" DROP="0" FONT="Trebuchet MS Bold" TXTSTP="-0.1" TXTULW="-0.1" /> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="3" TXTSHX="5" BASE="0" LINESP="9.6" TXTSHY="-5" VOR="0" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="22.6772" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="0" INDENT="0" FONTSIZE="8" NAME="Bio" FCOLOR="Black" SCALEH="100" TXTOUT="1" DROP="0" FONT="Trebuchet MS Regular" TXTSTP="-0.1" TXTULW="-0.1" /> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="0" TXTSHX="5" BASE="0" LINESP="10.8" TXTSHY="-5" VOR="28.3465" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="5.66929" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="0" INDENT="0" FONTSIZE="9" NAME="Reference Header" FCOLOR="OM Gold" SCALEH="100" TXTOUT="1" DROP="0" FONT="Copperplate Light" TXTSTP="-0.1" TXTULW="-0.1" /> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="3" TXTSHX="5" BASE="0" LINESP="12" TXTSHY="-5" VOR="0" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="0" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="-28.3465" INDENT="28.3465" FONTSIZE="10" NAME="References list" FCOLOR="Black" SCALEH="100" TXTOUT="1" DROP="0" FONT="Georgia Regular" TXTSTP="-0.1" TXTULW="-0.1" > <Tabs Fill="" Type="0" Pos="28.3465" /> </STYLE> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="1" TXTSHX="5" BASE="0" LINESP="14.4" TXTSHY="-5" VOR="0" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="0" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="0" INDENT="0" FONTSIZE="12" NAME="Footer" FCOLOR="OM Gold" SCALEH="100" TXTOUT="1" DROP="0" FONT="Copperplate Light" TXTSTP="-0.1" TXTULW="-0.1" /> <STYLE EFFECT="0" SCOLOR="Black" ALIGN="0" TXTSHX="5" BASE="0" LINESP="14.4" TXTSHY="-5" VOR="0" TXTSTW="-0.1" DROPLIN="2" KERN="0" FSHADE="100" LINESPMode="0" BASEO="0" TXTULP="-0.1" NACH="0" SSHADE="100" SCALEV="100" DROPDIST="0" FIRST="0" INDENT="0" FONTSIZE="12" NAME="Header" FCOLOR="OM Gold" SCALEH="100" TXTOUT="1" DROP="0" FONT="Copperplate Light" TXTSTP="-0.1" TXTULW="-0.1" > <Tabs Fill="" Type="1" Pos="515.906" /> </STYLE> <CHARSTYLE CNAME="Default Character Style" SCALEV="100" SCOLOR="Black" TXTSTP="-0.1" TXTSHX="5" TXTSHY="-5" FSHADE="100" TXTSTW="-0.1" FCOLOR="Black" TXTULP="-0.1" SCALEH="100" TXTULW="-0.1" KERN="0" FONT="Times New Roman Regular" SSHADE="100" FONTSIZE="12" FEATURES="inherit" TXTOUT="1" BASEO="0" /> <LAYERS SICHTBAR="1" NUMMER="0" TRANS="1" LAYERC="#000000" EDIT="1" NAME="Background" FLOW="1" LEVEL="0" DRUCKEN="1" BLEND="0" OUTL="0" /> <Printer colorMarks="1" firstUse="1" useICC="1" mirrorV="1" registrationMarks="1" PSLevel="3" useColor="1" bleedMarks="1" doOverprint="1" outputSeparations="1" cropMarks="1" markOffset="1.79186412638629e-264" filename="" printerCommand="" printer="" toFile="1" useSpotColors="1" setDevParam="1" BleedBottom="0" PDLanguage="3" BleedRight="0" doGCR="1" mirrorH="1" useAltPrintCommand="1" BleedTop="0" doClip="1" separationName="" BleedLeft="0" /> <PDF BTop="0" Bookmarks="0" BLeft="0" bleedMarks="0" BRight="0" displayFullscreen="0" PicRes="300" cropMarks="0" Intent="1" Articles="0" Intent2="0" RGBMode="1" RotateDeg="0" MirrorH="0" ImagePr="0" PrintP="Fogra27L CMYK Coated Press" UseProfiles2="0" UseLayers="0" doMultiFile="0" Clip="0" Compress="1" docInfoMarks="0" UseLpi="0" CMethod="0" Grayscale="0" BBottom="0" PassOwner="" doOverprint="0" ImageP="sRGB IEC61966-2.1" MirrorV="0" UseProfiles="0" Permissions="-4" Encrypt="0" SolidP="sRGB IEC61966-2.1" markOffset="0" PageLayout="0" RecalcPic="0" Version="14" hideMenuBar="0" PresentMode="0" Thumbnails="0" colorMarks="0" InfoString="" Resolution="300" UseSpotColors="1" hideToolBar="0" firstUse="1" useDocBleeds="0" PassUser="" fitWindow="0" registrationMarks="0" displayThumbs="0" Quality="0" displayBookmarks="0" Binding="0" displayLayers="0" openAction="" > <LPI Angle="45" Frequency="75" Color="Black" SpotFunction="2" /> <LPI Angle="105" Frequency="75" Color="Cyan" SpotFunction="2" /> <LPI Angle="75" Frequency="75" Color="Magenta" SpotFunction="2" /> <LPI Angle="90" Frequency="75" Color="Yellow" SpotFunction="2" /> </PDF> <DocItemAttributes/> <TablesOfContents/> <PageSets> <Set Columns="1" Rows="1" Name="Single Page" FirstPage="0" /> <Set Columns="2" Rows="1" Name="Double Sided" FirstPage="1" > <PageNames Name="Left Page" /> <PageNames Name="Right Page" /> </Set> <Set Columns="3" Rows="1" Name="3-Fold" FirstPage="0" > <PageNames Name="Left Page" /> <PageNames Name="Middle" /> <PageNames Name="Right Page" /> </Set> <Set Columns="4" Rows="1" Name="4-Fold" FirstPage="0" > <PageNames Name="Left Page" /> <PageNames Name="Middle Left" /> <PageNames Name="Middle Right" /> <PageNames Name="Right Page" /> </Set> </PageSets> <Sections> <Section Active="1" Number="0" From="0" Type="Type_1_2_3" To="4" Name="0" Start="1" Reversed="0" /> </Sections> <MASTERPAGE Orientation="0" AGverticalAutoGap="0" AGverticalAutoRefer="0" AGhorizontalAutoRefer="0" HorizontalGuides="" PAGEHEIGHT="792.0000000000001" AGhorizontalAutoGap="0" BORDERBOTTOM="40" Size="Letter" VerticalGuides="" BORDERTOP="40" LEFT="0" AGSelection="0 nan 0 nan" AGverticalAutoCount="0" PAGEWIDTH="612" PAGEYPOS="20" NUM="0" BORDERLEFT="40" BORDERRIGHT="40" PAGEXPOS="100" NAM="Normal" AGhorizontalAutoCount="0" MNAM="" /> <PAGE Orientation="0" AGverticalAutoGap="0" AGverticalAutoRefer="0" AGhorizontalAutoRefer="0" HorizontalGuides="" PAGEHEIGHT="792.0000000000001" AGhorizontalAutoGap="0" BORDERBOTTOM="40" Size="Letter" VerticalGuides="" BORDERTOP="40" LEFT="0" AGSelection="0 nan 0 nan" AGverticalAutoCount="0" PAGEWIDTH="612" PAGEYPOS="20" NUM="0" BORDERLEFT="40" BORDERRIGHT="40" PAGEXPOS="100" NAM="" AGhorizontalAutoCount="0" MNAM="Normal" /> <PAGE Orientation="0" AGverticalAutoGap="0" AGverticalAutoRefer="0" AGhorizontalAutoRefer="0" HorizontalGuides="" PAGEHEIGHT="792.0000000000001" AGhorizontalAutoGap="0" BORDERBOTTOM="40" Size="Letter" VerticalGuides="" BORDERTOP="40" LEFT="0" AGSelection="0 nan 0 nan" AGverticalAutoCount="0" PAGEWIDTH="612" PAGEYPOS="812.0000000000001" NUM="1" BORDERLEFT="40" BORDERRIGHT="40" PAGEXPOS="100" NAM="" AGhorizontalAutoCount="0" MNAM="Normal" /> <PAGE Orientation="0" AGverticalAutoGap="0" AGverticalAutoRefer="0" AGhorizontalAutoRefer="0" HorizontalGuides="" PAGEHEIGHT="792.0000000000001" AGhorizontalAutoGap="0" BORDERBOTTOM="40" Size="Letter" VerticalGuides="" BORDERTOP="40" LEFT="0" AGSelection="0 nan 0 nan" AGverticalAutoCount="0" PAGEWIDTH="612" PAGEYPOS="1604" NUM="2" BORDERLEFT="40" BORDERRIGHT="40" PAGEXPOS="100" NAM="" AGhorizontalAutoCount="0" MNAM="Normal" /> <PAGE Orientation="0" AGverticalAutoGap="0" AGverticalAutoRefer="0" AGhorizontalAutoRefer="0" HorizontalGuides="" PAGEHEIGHT="792.0000000000001" AGhorizontalAutoGap="0" BORDERBOTTOM="40" Size="Letter" VerticalGuides="" BORDERTOP="40" LEFT="0" AGSelection="0 nan 0 nan" AGverticalAutoCount="0" PAGEWIDTH="612" PAGEYPOS="2396" NUM="3" BORDERLEFT="40" BORDERRIGHT="40" PAGEXPOS="100" NAM="" AGhorizontalAutoCount="0" MNAM="Normal" /> <PAGE Orientation="0" AGverticalAutoGap="0" AGverticalAutoRefer="0" AGhorizontalAutoRefer="0" HorizontalGuides="" PAGEHEIGHT="792.0000000000001" AGhorizontalAutoGap="0" BORDERBOTTOM="40" Size="Letter" VerticalGuides="" BORDERTOP="40" LEFT="0" AGSelection="0 nan 0 nan" AGverticalAutoCount="0" PAGEWIDTH="612" PAGEYPOS="3188" NUM="4" BORDERLEFT="40" BORDERRIGHT="40" PAGEXPOS="100" NAM="" AGhorizontalAutoCount="0" MNAM="Normal" /> <PAGEOBJECT POCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " ANNAME="" RADRECT="0" GRTYP="0" PCOLOR="None" WIDTH="532" BACKITEM="-1" gXpos="-3.137028795956963e-195" XPOS="140" EXTRA="0" PFILE="" isInline="0" TopLine="0" NEXTITEM="1" PRINTABLE="1" HEIGHT="712.0000000000001" gWidth="-3.137028795953848e-195" LAYER="0" gHeight="5.347624170747834e-315" BASEOF="0" isTableItem="0" TEXTFLOWMODE="0" TransBlendS="0" textPathFlipped="0" BottomLine="0" PLINEEND="0" BEXTRA="0" GROUPS="" TransBlend="0" NAMEDLST="" AUTOTEXT="1" startArrowIndex="0" gYpos="5.347614052283407e-315" PICART="1" YPOS="60" isGroupControl="0" NUMCO="16" OnMasterPage="" LOCALSCX="1" LOCK="0" LOCALSCY="1" PRFILE="" TransValueS="0" doOverprint="0" IRENDER="1" ImageRes="1" fillRule="1" TEXTRA="0" ROT="0" textPathType="0" RATIO="1" PLINEART="1" PCOLOR2="None" COLUMNS="2" PTYPE="4" OwnPage="0" ANNOTATION="0" PLTSHOW="0" DASHS="" BOOKMARK="0" REXTRA="0" LOCKR="0" DASHOFF="0" LOCALX="0" CLIPEDIT="0" ImageClip="" LOCALY="0" EPROF="" FLIPPEDH="0" SHADE2="100" LeftLine="0" PLINEJOIN="0" NUMDASH="0" PFILE2="" PFILE3="" PWIDTH="1" COCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " FLIPPEDV="0" RightLine="0" TEXTFLOW="0" SHADE="100" NUMGROUP="0" endArrowIndex="0" COLGAP="19.84251968503937" SCALETYPE="1" EMBEDDED="1" TEXTFLOW2="0" TEXTFLOW3="0" TransValue="0" REVERS="0" FRTYPE="0" NUMPO="16" > <xsl:apply-templates/> <xsl:call-template name="nl-1"/> <PageItemAttributes/> </PAGEOBJECT> <PAGEOBJECT POCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " ANNAME="" RADRECT="0" GRTYP="0" PCOLOR="None" WIDTH="532" BACKITEM="0" gXpos="-3.137028795956963e-195" XPOS="140" EXTRA="0" PFILE="" isInline="0" TopLine="0" NEXTITEM="2" PRINTABLE="1" HEIGHT="712.0000000000001" gWidth="-3.137028795953848e-195" LAYER="0" gHeight="5.347502749174712e-315" BASEOF="0" isTableItem="0" TEXTFLOWMODE="0" TransBlendS="0" textPathFlipped="0" BottomLine="0" PLINEEND="0" BEXTRA="0" GROUPS="" TransBlend="0" NAMEDLST="" AUTOTEXT="1" startArrowIndex="0" gYpos="5.347492630710285e-315" PICART="1" YPOS="852.0000000000001" isGroupControl="0" NUMCO="16" OnMasterPage="" LOCALSCX="1" LOCK="0" LOCALSCY="1" PRFILE="" TransValueS="0" doOverprint="0" IRENDER="1" ImageRes="1" fillRule="1" TEXTRA="0" ROT="0" textPathType="0" RATIO="1" PLINEART="1" PCOLOR2="None" COLUMNS="2" PTYPE="4" OwnPage="1" ANNOTATION="0" PLTSHOW="0" DASHS="" BOOKMARK="0" REXTRA="0" LOCKR="0" DASHOFF="0" LOCALX="0" CLIPEDIT="0" ImageClip="" LOCALY="0" EPROF="" FLIPPEDH="0" SHADE2="100" LeftLine="0" PLINEJOIN="0" NUMDASH="0" PFILE2="" PFILE3="" PWIDTH="1" COCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " FLIPPEDV="0" RightLine="0" TEXTFLOW="0" SHADE="100" NUMGROUP="0" endArrowIndex="0" COLGAP="19.84251968503937" SCALETYPE="1" EMBEDDED="1" TEXTFLOW2="0" TEXTFLOW3="0" TransValue="0" REVERS="0" FRTYPE="0" NUMPO="16" > <PageItemAttributes/> </PAGEOBJECT> <PAGEOBJECT POCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " ANNAME="" RADRECT="0" GRTYP="0" PCOLOR="None" WIDTH="532" BACKITEM="1" gXpos="-3.137028795956963e-195" XPOS="140" EXTRA="0" PFILE="" isInline="0" TopLine="0" NEXTITEM="3" PRINTABLE="1" HEIGHT="712.0000000000001" gWidth="-3.137028795953848e-195" LAYER="0" gHeight="5.34738132760159e-315" BASEOF="0" isTableItem="0" TEXTFLOWMODE="0" TransBlendS="0" textPathFlipped="0" BottomLine="0" PLINEEND="0" BEXTRA="0" GROUPS="" TransBlend="0" NAMEDLST="" AUTOTEXT="1" startArrowIndex="0" gYpos="5.347371209137163e-315" PICART="1" YPOS="1644" isGroupControl="0" NUMCO="16" OnMasterPage="" LOCALSCX="1" LOCK="0" LOCALSCY="1" PRFILE="" TransValueS="0" doOverprint="0" IRENDER="1" ImageRes="1" fillRule="1" TEXTRA="0" ROT="0" textPathType="0" RATIO="1" PLINEART="1" PCOLOR2="None" COLUMNS="2" PTYPE="4" OwnPage="2" ANNOTATION="0" PLTSHOW="0" DASHS="" BOOKMARK="0" REXTRA="0" LOCKR="0" DASHOFF="0" LOCALX="0" CLIPEDIT="0" ImageClip="" LOCALY="0" EPROF="" FLIPPEDH="0" SHADE2="100" LeftLine="0" PLINEJOIN="0" NUMDASH="0" PFILE2="" PFILE3="" PWIDTH="1" COCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " FLIPPEDV="0" RightLine="0" TEXTFLOW="0" SHADE="100" NUMGROUP="0" endArrowIndex="0" COLGAP="19.84251968503937" SCALETYPE="1" EMBEDDED="1" TEXTFLOW2="0" TEXTFLOW3="0" TransValue="0" REVERS="0" FRTYPE="0" NUMPO="16" > <PageItemAttributes/> </PAGEOBJECT> <PAGEOBJECT POCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " ANNAME="" RADRECT="0" GRTYP="0" PCOLOR="None" WIDTH="532" BACKITEM="2" gXpos="-3.137028795956963e-195" XPOS="140" EXTRA="0" PFILE="" isInline="0" TopLine="0" NEXTITEM="4" PRINTABLE="1" HEIGHT="712.0000000000001" gWidth="-3.137028795953848e-195" LAYER="0" gHeight="5.347259906028468e-315" BASEOF="0" isTableItem="0" TEXTFLOWMODE="0" TransBlendS="0" textPathFlipped="0" BottomLine="0" PLINEEND="0" BEXTRA="0" GROUPS="" TransBlend="0" NAMEDLST="" AUTOTEXT="1" startArrowIndex="0" gYpos="5.347249787564041e-315" PICART="1" YPOS="2436" isGroupControl="0" NUMCO="16" OnMasterPage="" LOCALSCX="1" LOCK="0" LOCALSCY="1" PRFILE="" TransValueS="0" doOverprint="0" IRENDER="1" ImageRes="1" fillRule="1" TEXTRA="0" ROT="0" textPathType="0" RATIO="1" PLINEART="1" PCOLOR2="None" COLUMNS="2" PTYPE="4" OwnPage="3" ANNOTATION="0" PLTSHOW="0" DASHS="" BOOKMARK="0" REXTRA="0" LOCKR="0" DASHOFF="0" LOCALX="0" CLIPEDIT="0" ImageClip="" LOCALY="0" EPROF="" FLIPPEDH="0" SHADE2="100" LeftLine="0" PLINEJOIN="0" NUMDASH="0" PFILE2="" PFILE3="" PWIDTH="1" COCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " FLIPPEDV="0" RightLine="0" TEXTFLOW="0" SHADE="100" NUMGROUP="0" endArrowIndex="0" COLGAP="19.84251968503937" SCALETYPE="1" EMBEDDED="1" TEXTFLOW2="0" TEXTFLOW3="0" TransValue="0" REVERS="0" FRTYPE="0" NUMPO="16" > <PageItemAttributes/> </PAGEOBJECT> <PAGEOBJECT POCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " ANNAME="" RADRECT="0" GRTYP="0" PCOLOR="None" WIDTH="532" BACKITEM="3" gXpos="-3.137028795956963e-195" XPOS="140" EXTRA="0" PFILE="" isInline="0" TopLine="0" NEXTITEM="-1" PRINTABLE="1" HEIGHT="712.0000000000001" gWidth="-3.137028795953848e-195" LAYER="0" gHeight="5.347138484455346e-315" BASEOF="0" isTableItem="0" TEXTFLOWMODE="0" TransBlendS="0" textPathFlipped="0" BottomLine="0" PLINEEND="0" BEXTRA="0" GROUPS="" TransBlend="0" NAMEDLST="" AUTOTEXT="1" startArrowIndex="0" gYpos="5.347128365990919e-315" PICART="1" YPOS="3228" isGroupControl="0" NUMCO="16" OnMasterPage="" LOCALSCX="1" LOCK="0" LOCALSCY="1" PRFILE="" TransValueS="0" doOverprint="0" IRENDER="1" ImageRes="1" fillRule="1" TEXTRA="0" ROT="0" textPathType="0" RATIO="1" PLINEART="1" PCOLOR2="None" COLUMNS="2" PTYPE="4" OwnPage="4" ANNOTATION="0" PLTSHOW="0" DASHS="" BOOKMARK="0" REXTRA="0" LOCKR="0" DASHOFF="0" LOCALX="0" CLIPEDIT="0" ImageClip="" LOCALY="0" EPROF="" FLIPPEDH="0" SHADE2="100" LeftLine="0" PLINEJOIN="0" NUMDASH="0" PFILE2="" PFILE3="" PWIDTH="1" COCOOR="0 0 0 0 532 0 532 0 532 0 532 0 532 712 532 712 532 712 532 712 0 712 0 712 0 712 0 712 0 0 0 0 " FLIPPEDV="0" RightLine="0" TEXTFLOW="0" SHADE="100" NUMGROUP="0" endArrowIndex="0" COLGAP="19.84251968503937" SCALETYPE="1" EMBEDDED="1" TEXTFLOW2="0" TEXTFLOW3="0" TransValue="0" REVERS="0" FRTYPE="0" NUMPO="16" > <PageItemAttributes/> </PAGEOBJECT> </DOCUMENT> </SCRIBUSUTF8NEW> </xsl:template> <!-- ============================================================= --> <!-- 3. DOCUMENT ELEMENT --> <!-- ============================================================= --> <!-- Can add sub-article and response to this match: - "make-a-piece" as required; - adapt the selection of elements that get managed as a set: footnotes, cross-references, tables, and figures. --> <xsl:template match="article"> <xsl:call-template name="make-a-piece"/> </xsl:template> <!-- ============================================================= --> <!-- 3. "make-a-piece" --> <!-- ============================================================= --> <!-- Generalized management of front, body, back, and trailing content, presently oeprates for sub-article and response exactly as for article. --> <!-- Organization of output: make-front make-body make-back make-figs-and-tables make-end-metadata ...then... do the same for any contained sub-article/response--> <!-- initial context node is article --> <xsl:template name="make-a-piece"> <!-- variable to be used in div id's to keep them unique --> <xsl:variable name="which-piece"> <xsl:value-of select="concat(local-name(), '-level-', count(ancestor::*))"/> </xsl:variable> <!-- front matter, in table --> <xsl:call-template name="nl-2"/> <!-- class is repeated on contained table elements --> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-front"/> <xsl:call-template name="nl-1"/> <!-- body --> <xsl:call-template name="nl-2"/> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-body"/> <xsl:call-template name="nl-1"/> <xsl:call-template name="nl-2"/> <!-- class is repeated on contained table elements --> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-back"/> <xsl:call-template name="nl-1"/> <!-- figures and tables --> <xsl:call-template name="nl-2"/> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-figs-and-tables"/> <xsl:call-template name="nl-1"/> <!-- retrieval metadata, at end --> <xsl:call-template name="nl-2"/> <!-- class is repeated on contained table element --> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-end-metadata"/> <xsl:call-template name="nl-1"/> <!-- sub-article or response: calls this very template --> <!-- change context node --> <!-- <xsl:for-each select="sub-article | response"> <xsl:call-template name="make-a-piece"/> </xsl:for-each> <hr class="part-rule"/> <xsl:call-template name="nl-1"/> --> </xsl:template> <!-- ============================================================= --> <!-- 4. UTILITIES --> <!-- ============================================================= --> <!-- ============================================================= --> <!-- "capitalize" Capitalize a string --> <!-- ============================================================= --> <xsl:template name="capitalize"> <xsl:param name="str"/> <xsl:value-of select="translate($str, 'abcdefghjiklmnopqrstuvwxyz', 'ABCDEFGHJIKLMNOPQRSTUVWXYZ')" /> </xsl:template> <!-- ============================================================= --> <!-- "language" --> <!-- ============================================================= --> <xsl:template name="language"> <xsl:param name="lang"/> <xsl:choose> <xsl:when test="$lang='fr' or $lang='FR'"> (Fre).</xsl:when> <xsl:when test="$lang='jp' or $lang='JP'"> (Jpn).</xsl:when> <xsl:when test="$lang='ru' or $lang='RU'"> (Rus).</xsl:when> <xsl:when test="$lang='de' or $lang='DE'"> (Ger).</xsl:when> <xsl:when test="$lang='se' or $lang='SE'"> (Swe).</xsl:when> <xsl:when test="$lang='it' or $lang='IT'"> (Ita).</xsl:when> <xsl:when test="$lang='he' or $lang='HE'"> (Heb).</xsl:when> <xsl:when test="$lang='sp' or $lang='SP'"> (Spa).</xsl:when> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- "cleantitle" --> <!-- ============================================================= --> <xsl:template name="cleantitle"> <xsl:param name="str"/> <xsl:value-of select="translate($str,'. ,-_','')"/> </xsl:template> <!-- ============================================================= --> <!-- "newlines" --> <!-- ============================================================= --> <!-- produces newlines in output, to increase legibility of XML --> <xsl:template name="nl-1"> <xsl:text>
</xsl:text> </xsl:template> <xsl:template name="nl-2"> <xsl:text>
</xsl:text> <xsl:text>
</xsl:text> </xsl:template> <!-- ============================================================= --> <!-- make-id, make-src, make-href, make-email, make-anchor --> <!-- ============================================================= --> <xsl:template name="make-id"> <xsl:if test="@id"> <xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template name="make-src"> <xsl:if test="@xlink:href"> <xsl:attribute name="src"> <xsl:value-of select="@xlink:href"/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template name="make-href"> <xsl:if test="@xlink:href"> <xsl:attribute name="href"> <xsl:value-of select="@xlink:href"/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template name="make-email"> <xsl:if test="@xlink:href"> <xsl:attribute name="href"> <xsl:value-of select="concat('mailto:', @xlink:href)"/> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template name="make-anchor"> <xsl:if test="@id"> <a name="{@id}"/> </xsl:if> </xsl:template> <!-- ============================================================= --> <!-- display-id --> <!-- ============================================================= --> <xsl:template name="display-id"> <xsl:variable name="display-phrase"> <xsl:choose> <xsl:when test="self::disp-formula"> <xsl:text>Formula ID</xsl:text> </xsl:when> <xsl:when test="self::chem-struct-wrapper"> <xsl:text>Chemical Structure Wrapper ID</xsl:text> </xsl:when> <xsl:when test="self::chem-struct"> <xsl:text>Chemical Structure ID</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>ID</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="@id"> <span class="gen"> <xsl:text>[</xsl:text> <xsl:value-of select="$display-phrase"/> <xsl:text>: </xsl:text> </span> <xsl:value-of select="@id"/> <span class="gen"> <xsl:text>]</xsl:text> </span> </xsl:if> </xsl:template> <!-- ============================================================= --> <!-- "table-setup": left column wide or narrow --> <!-- ============================================================= --> <xsl:template name="table-setup-l-wide"> <xsl:call-template name="nl-1"/> <tr> <td width="30%"/> <td/> </tr> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template name="table-setup-l-narrow"> <xsl:call-template name="nl-1"/> <tr> <td width="10%"/> <td/> </tr> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template name="table-setup-even"> <xsl:call-template name="nl-1"/> <tr> <td width="50%"/> <td/> </tr> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- "make-figs-and-tables" --> <!-- ============================================================= --> <!-- initial context node is article --> <xsl:template name="make-figs-and-tables"> <xsl:if test="body//fig[not(parent::fig-group)] | back//fig[not(parent::fig-group)]"> <xsl:call-template name="nl-1"/> <div class="Title1">Figures</div> <xsl:call-template name="nl-1"/> <xsl:apply-templates select="body//fig | back//fig" mode="put-at-end"/> </xsl:if> <xsl:if test="body//table-wrap | back//table-wrap"> <xsl:call-template name="nl-1"/> <div class="Title1">Tables</div> <xsl:call-template name="nl-1"/> <xsl:apply-templates select="body//table-wrap | back//table-wrap" mode="put-at-end"/> <xsl:call-template name="nl-1"/> </xsl:if> </xsl:template> <!-- ============================================================= --> <!-- 6. SUPPRESSED ELEMENTS --> <!-- ============================================================= --> <!-- suppressed in no-mode (processed in mode "front") --> <xsl:template match="journal-meta | article-meta"/> <!-- not handled by this transform --> <xsl:template match="sub-article | response"/> <!-- xlink attributes are generally suppressed; note however that @xlink:href is used in some element templates. --> <xsl:template match="@xlink:*"/> <!-- Tables and figures are displayed at the end of the document, using mode "put-at-end". So, in no-mode, we suppress them: --> <xsl:template match="fig | fig-group | table-wrap | table-wrap-group"/> <!-- ============================================================= --> <!-- CALLED TEMPLATES FOR ARTICLE PARTS --> <!-- ============================================================= --> <!-- ============================================================= --> <!-- 8. MAKE-FRONT --> <!-- ============================================================= --> <!-- initial context node is /article --> <xsl:template name="make-front"> <xsl:call-template name="nl-1"/> <!-- Titles and author group --> <!-- All data comes from front/article-meta --> <!-- change context to front/article-meta (again) --> <xsl:for-each select="front/article-meta"> <xsl:apply-templates select="title-group" mode="front"/> <xsl:call-template name="nl-1"/> <!-- each contrib makes a row: name at left, details at right --> <xsl:for-each select="contrib-group/contrib"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates select="name | collab" mode="front"/> </a> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="name | collab" mode="front"/> <xsl:variable name="nodetotal" select="count(../*)"/> <xsl:variable name="position" select="position()"/> <xsl:choose> <xsl:when test="$nodetotal=$position"/> <xsl:otherwise>, </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <para PARENT="Byline" /> <!-- the name element handles any contrib/xref and contrib/degrees --> <xsl:apply-templates select="*[not(self::name) and not(self::collab) and not(self::xref) and not(self::degrees)]" mode="front"/> <xsl:call-template name="nl-1"/> <xsl:call-template name="nl-1"/> </xsl:for-each> <!-- end of contrib --> <!-- author notes --> <xsl:if test="author-notes"> <tr> <td/> <td valign="top"> <xsl:apply-templates select="author-notes" mode="front"/> </td> </tr> <xsl:call-template name="nl-1"/> </xsl:if> <!-- abstract(s) --> <xsl:if test="abstract | trans-abstract"> <!-- rule separates title+authors from abstract(s) --> <tr> <td colspan="2" valign="top"> <hr class="section-rule"/> </td> </tr> <xsl:call-template name="nl-1"/> <xsl:for-each select="abstract | trans-abstract"> <!-- title in left column, content (paras, secs) in right --> <tr> <td valign="top"> <span class="tl-main-part"> <!-- if there's no title, create one --> <xsl:call-template name="words-for-abstract-title"/> </span> </td> <xsl:call-template name="nl-1"/> <td valign="top"> <xsl:apply-templates select="*[not(self::title)]"/> </td> <xsl:call-template name="nl-1"/> </tr> <xsl:call-template name="nl-1"/> </xsl:for-each> <!-- end of abstract or trans-abstract --> </xsl:if> <!-- end of dealing with abstracts --> <!-- end of the titles-and-authors context; return to previous context --> </xsl:for-each><!-- Insert Competing Interests --><xsl:for-each select="back/fn-group/fn[@fn-type='conflict']"> <div id="CompetingInterests"> <xsl:call-template name="make-id"/> <span class="subTitle2">Competing interests: </span> <xsl:value-of select="."/> </div></xsl:for-each> <xsl:call-template name="nl-2"/> <!-- end of big front-matter pull --> </xsl:template> <!-- ============================================================= --> <!-- 9. MAKE-BODY --> <!-- ============================================================= --> <!-- initial context node is article --> <xsl:template name="make-body"> <!-- change context node --> <xsl:for-each select="body"> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </xsl:for-each> </xsl:template> <!-- ============================================================= --> <!-- 10. MAKE-BACK --> <!-- ============================================================= --> <!-- initial context node is article --> <xsl:template name="make-back"> <xsl:call-template name="nl-1"/> <!-- change context node to back --> <xsl:for-each select="back"> <xsl:apply-templates select="title"/> <xsl:if test="preceding-sibling::body//fn-group[not(self::fn-group/fn[@fn-type='conflict'])] | .//fn-group[not(self::fn-group/fn[@fn-type='conflict'])]"> <span class="tl-main-part">Footnotes</span> <xsl:apply-templates select="preceding-sibling::body//fn-group | .//fn-group"/> <xsl:call-template name="nl-1"/> </xsl:if> <xsl:apply-templates select="*[not(self::title) and not(self::fn-group)]"/> <xsl:call-template name="nl-1"/> </xsl:for-each> </xsl:template> <!-- ============================================================= --> <!-- 11. MAKE-POST-PUBLICATION --> <!-- ============================================================= --> <!-- At present the transform does not support subarticles and responses. To include that support in the present structure, fill out this template, call the "make-a-piece" template to ensure the details are handled in the same way and by the same templates as for the main article body. --> <!-- ============================================================= --> <!-- 12. MAKE-END-METADATA --> <!-- ============================================================= --> <!-- This metadata is displayed after the back and figs-and-tables because (when it it exists) it will be too long to display with the other metadata that is displayed before the body. --> <!-- It is metadata for retrieval: categories, keywords, etc. --> <!-- The context node when this template is called is the article or, when supported, the sub-article or response. --> <xsl:template name="make-end-metadata"> <!-- change context node --> <xsl:for-each select="front/article-meta"> <xsl:if test="kwd-group | related-article | conference"> <hr class="part-rule"/> <table width="100%" class="fm"> <xsl:call-template name="table-setup-l-wide"/> <xsl:call-template name="nl-1"/> <tr> <xsl:call-template name="nl-1"/> <td colspan="2" valign="top"> <!-- keyword group --> <xsl:apply-templates select="kwd-group"/> <!-- related article --> <xsl:apply-templates select="related-article"/> <!-- conference information --> <xsl:apply-templates select="conference"/> </td> <xsl:call-template name="nl-1"/> </tr> <xsl:call-template name="nl-1"/> </table> <xsl:call-template name="nl-1"/> </xsl:if> </xsl:for-each> </xsl:template> <!-- ============================================================= --> <!-- Keywords --> <!-- ============================================================= --> <!-- kwd-group and its kwd occur only in article-meta --> <xsl:template match="kwd-group"> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Keywords: </xsl:text> </span> <xsl:apply-templates/> <br/> </xsl:template> <xsl:template match="kwd"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> <xsl:call-template name="make-keyword-punct"/> </xsl:template> <xsl:template name="make-keyword-punct"> <xsl:choose> <xsl:when test="following-sibling::kwd"> <xsl:text>, </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>.</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- Related article --> <!-- ============================================================= --> <xsl:template match="related-article"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <span class="gen"> <xsl:text>Related Article(s): </xsl:text> </span> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Related Article(s): </xsl:text> </span> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> <br/> </xsl:template> <!-- ============================================================= --> <!-- Conference --> <!-- ============================================================= --> <xsl:template match="conference"> <span class="gen"> <xsl:text>Conference: </xsl:text> </span> <xsl:call-template name="make-conference"/> <br/> </xsl:template> <!-- doesn't use conf-num, conf-sponsor, conf-theme --> <xsl:template name="make-conference"> <xsl:apply-templates select="conf-acronym" mode="add-period"/> <xsl:apply-templates select="conf-name" mode="add-period"/> <xsl:apply-templates select="conf-loc" mode="add-period"/> <xsl:apply-templates select="conf-date" mode="add-period"/> </xsl:template> <xsl:template match="*" mode="add-period"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <!-- ============================================================= --> <!-- NARRATIVE CONTENT AND COMMON STRUCTURES --> <!-- ============================================================= --> <!-- ============================================================= --> <!-- 13. PARAGRAPH WITH ITS SUBTLETIES --> <!-- ============================================================= --><ANKH/><xsl:template match="*"><ITEXT2> <xsl:attribute name="CH"> <xsl:apply-templates/> </xsl:attribute></ITEXT2><para PARENT="Article Text"/></xsl:template> <xsl:template match="p"> <xsl:choose> <xsl:when test="parent::list-item"> <xsl:apply-templates/> <xsl:if test="following-sibling::p"> <br/> </xsl:if> </xsl:when> <xsl:otherwise> <ITEXT> <xsl:attribute name="CH"> <xsl:apply-templates/> </xsl:attribute> </ITEXT> <para PARENT="Article Text"/> </xsl:otherwise> </xsl:choose> <xsl:call-template name="nl-1"/> </xsl:template> <!-- The first p in a footnote displays the fn symbol or, if no symbol, the fn ID --> <xsl:template match="fn/p[1]"> <p> <xsl:call-template name="make-id"/> <xsl:choose> <xsl:when test="preceding-sibling::label"> <span class="fn-label"> <xsl:value-of select="preceding-sibling::label"/> </span> </xsl:when> <xsl:when test="../@symbol"> <span class="fn-label"> <xsl:value-of select="../@symbol"/> </span> </xsl:when> <xsl:when test="../@id"> <span class="fn-label"> <xsl:value-of select="../@id"/> </span> </xsl:when> </xsl:choose> <xsl:apply-templates/> </p> </xsl:template> <xsl:template match="speech/p[1]"> <p> <xsl:call-template name="make-id"/> <xsl:apply-templates select="preceding-sibling::speaker" mode="show-it-here"/> <xsl:text> </xsl:text> <xsl:apply-templates/> </p> </xsl:template> <!-- prevent the first def/p from causing a p tag which would display an unwanted break --> <xsl:template match="def/p[1]"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:template> <!-- ============================================================= --> <!-- 14. SECTION --> <!-- ============================================================= --> <!-- the first body/sec puts out no rule at its top, because body already puts out a part-rule at its top; subsequent body/secs do put out a section-rule --> <xsl:template match="body/sec"> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- no other level of sec puts out a rule --> <xsl:template match="sec"> <xsl:choose> <xsl:when test="@sec-type='display-objects'"/> <xsl:otherwise> <div> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </div> <xsl:call-template name="nl-1"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 15. LIST and its Internals --> <!-- ============================================================= --> <xsl:template match="list"> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-anchor"/> <xsl:if test="label | title"> <xsl:apply-templates select="label | title"/> </xsl:if> <xsl:choose> <xsl:when test="@list-type='simple' or list-item/label"> <ul style="list-style-type: none;"> <xsl:call-template name="nl-1"/> <xsl:apply-templates select="list-item"/> <xsl:call-template name="nl-1"/> </ul> </xsl:when> <xsl:when test="@list-type='bullet'"> <xsl:call-template name="nl-1"/> <ul> <xsl:call-template name="nl-1"/> <xsl:apply-templates select="list-item"/> <xsl:call-template name="nl-1"/> </ul> </xsl:when> <xsl:otherwise> <xsl:call-template name="nl-1"/> <ol> <xsl:call-template name="nl-1"/> <xsl:apply-templates select="list-item"/> <xsl:call-template name="nl-1"/> </ol> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="list-item"> <xsl:call-template name="nl-1"/> <li> <xsl:apply-templates/> </li> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 16. DISPLAY-QUOTE --> <!-- ============================================================= --> <xsl:template match="disp-quote"> <xsl:call-template name="nl-1"/> <blockquote> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </blockquote> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 17. SPEECH and its internals --> <!-- ============================================================= --> <!-- first p will pull in the speaker in mode "show-it-here" --> <xsl:template match="speech"> <blockquote> <xsl:call-template name="make-id"/> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </blockquote> </xsl:template> <xsl:template match="speaker" mode="show-it-here"> <b> <xsl:apply-templates/> </b> </xsl:template> <!-- in no mode --> <xsl:template match="speaker"/> <!-- ============================================================= --> <!-- 18. STATEMENT and its internals --> <!-- ============================================================= --> <xsl:template match="statement"> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> </div> </xsl:template> <xsl:template match="statement/label | statement/title"> <xsl:call-template name="nl-1"/> <p> <b> <xsl:apply-templates/> </b> </p> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 19. VERSE-GROUP and its internals --> <!-- ============================================================= --> <xsl:template match="verse-group"> <xsl:call-template name="nl-1"/> <blockquote> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </blockquote> </xsl:template> <xsl:template match="verse-line"> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> <br/> </xsl:template> <!-- ============================================================= --> <!-- 20. BOXED-TEXT --> <!-- ============================================================= --> <xsl:template match="boxed-text"> <xsl:call-template name="nl-1"/> <table border="4" cellpadding="10pt" width="100%"> <xsl:call-template name="make-id"/> <!-- the box is achieved by means of a table, and tables don't seem to inherit class attributes, so we repeat the class attribute here --> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="ancestor::front">fm</xsl:when> <xsl:when test="ancestor::body">body</xsl:when> <xsl:when test="ancestor::back">bm</xsl:when> <xsl:otherwise>body</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:call-template name="nl-1"/> <tr> <td valign="top"> <xsl:apply-templates/> </td> </tr> </table> </xsl:template> <!-- ============================================================= --> <!-- 21. PREFORMAT --> <!-- ============================================================= --> <xsl:template match="preformat" name="format-as-line-for-line"> <pre><xsl:call-template name="make-id"/><xsl:apply-templates/></pre> </xsl:template> <!-- ============================================================= --> <!-- 22. SUPPLEMENTARY MATERIAL --> <!-- ============================================================= --> <xsl:template match="supplementary-material"> <xsl:variable name="the-label"> <xsl:choose> <xsl:when test="label"> <xsl:value-of select="label"/> </xsl:when> <xsl:otherwise> <xsl:text>Supplementary Material</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <span class="tl-default"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:value-of select="$the-label"/> </a> </xsl:when> <xsl:otherwise> <xsl:call-template name="make-id"/> <xsl:value-of select="$the-label"/> </xsl:otherwise> </xsl:choose> </span> <xsl:apply-templates select="*[not(self::label)]"/> </xsl:template> <!-- ============================================================= --> <!-- 23. DISPLAY FORMULA, CHEM-STRUCT-WRAPPER --> <!-- ============================================================= --> <!-- both are grouping elements to keep parts together --> <xsl:template match="disp-formula | chem-struct-wrapper"> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:call-template name="display-id"/> <br/> <xsl:apply-templates/> </div> </xsl:template> <!-- ============================================================= --> <!-- 24. FORMATTING ELEMENTS --> <!-- ============================================================= --> <xsl:template match="bold"> <b> <xsl:apply-templates/> </b> </xsl:template> <xsl:template match="italic"> <i> <xsl:apply-templates/> </i> </xsl:template> <xsl:template match="monospace"> <span class="monospace"> <xsl:apply-templates/> </span> </xsl:template> <xsl:template match="overline"> <span class="overline"> <xsl:apply-templates/> </span> </xsl:template> <xsl:template match="sc"> <!-- handle any tags as usual, until we're down to the text strings --> <small> <xsl:apply-templates/> </small> </xsl:template> <xsl:template match="sc//text()"> <xsl:param name="str" select="."/> <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="$str"/> </xsl:call-template> </xsl:template> <xsl:template match="strike"> <s> <xsl:apply-templates/> </s> </xsl:template> <xsl:template match="sub"> <sub> <xsl:apply-templates/> </sub> </xsl:template> <xsl:template match="sup"> <sup> <xsl:apply-templates/> </sup> </xsl:template> <xsl:template match="underline"> <u> <xsl:apply-templates/> </u> </xsl:template> <!-- ============================================================= --> <!-- 25. SEMANTIC ELEMENTS --> <!-- ============================================================= --> <xsl:template match="abbrev"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="inline-graphic"> <xsl:call-template name="nl-1"/> <img> <xsl:call-template name="make-src"/> <xsl:call-template name="make-id"/> </img> </xsl:template> <xsl:template match="inline-formula"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:template> <!-- is meant be a link: we assume the xlink:href attribute is used, although it is not required by the DTD. --> <xsl:template match="inline-supplementary-material"> <xsl:call-template name="nl-1"/> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:template> <xsl:template match="glyph-data"> <xsl:call-template name="nl-1"/> <span class="take-note"> <xsl:call-template name="make-id"/> <xsl:text>[glyph data here: ID=</xsl:text> <xsl:value-of select="@id"/> <xsl:text>]</xsl:text> </span> </xsl:template> <!-- ============================================================= --> <!-- Named Content --> <!-- ============================================================= --> <xsl:template match="named-content"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <span class="gen"> <xsl:text>[</xsl:text> <xsl:value-of select="@content-type"/> <xsl:apply-templates/> <xsl:text>]</xsl:text> </span> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <span class="gen"> <xsl:text>[</xsl:text> <xsl:value-of select="@content-type"/> <xsl:text>: </xsl:text> </span> <xsl:apply-templates/> <span class="gen"> <xsl:text>]</xsl:text> </span> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 26. BREAK AND HORIZONTAL RULE --> <!-- ============================================================= --> <xsl:template match="break" name="make-break"> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="hr" name="make-rule"> <xsl:call-template name="nl-1"/> <hr/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 27. CHEM-STRUCT --> <!-- ============================================================= --> <xsl:template match="chem-struct"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:call-template name="display-id"/> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </span> </xsl:template> <!-- ============================================================= --> <!-- 28. TEX-MATH and MML:MATH --> <!-- ============================================================= --> <xsl:template match="tex-math"> <span class="take-note"> <xsl:text>[</xsl:text> <xsl:copy-of select="."/> <xsl:text>]</xsl:text> </span> </xsl:template> <!-- can presume this is meant to be inline --> <xsl:template match="inline-formula//mml:math"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- we don't -know- mml:math in general to be inline, so treat it as block. Put it in a table to get a pretty border. --> <xsl:template match="mml:math"> <xsl:choose> <xsl:when test="@xlink:href"> <table border="1"> <tr> <td valign="top"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </td> </tr> </table> </xsl:when> <xsl:otherwise> <table border="1"> <tr> <td valign="top"> <span> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </td> </tr> </table> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 29. GRAPHIC and MEDIA --> <!-- ============================================================= --> <xsl:template match="graphic"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:text>view</xsl:text> </a> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="media"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 30. ARRAY --> <!-- ============================================================= --> <xsl:template match="array"> <hr width="40%" align="left" noshade="1"/> <xsl:call-template name="nl-1"/> <table> <xsl:call-template name="make-id"/> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </table> <xsl:call-template name="nl-1"/> <hr width="40%" align="left" noshade="1"/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 31. CAPTIONING --> <!-- ============================================================= --> <!-- the chooses before and after the element content tweak the display as appropriate --> <xsl:template match="alt-text | attrib"> <!-- element-specific handling before content: --> <xsl:choose> <!-- alt-text gets a generated label--> <xsl:when test="self::alt-text"> <xsl:if test="not(ancestor::fig) and not(ancestor::table)"> <br/> </xsl:if> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Alternate Text: </xsl:text> </span> </xsl:when> <!-- attrib is preceded by spaces plus em-dash --> <xsl:when test="self::attrib"> <xsl:text>  —</xsl:text> </xsl:when> </xsl:choose> <xsl:apply-templates/> <xsl:text>. </xsl:text> <!-- element-specific handling after content: --> <xsl:choose> <!-- alt-text and long-desc get a break after --> <xsl:when test="self::alt-text | self::long-desc"> <br/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="label"> <xsl:choose> <xsl:when test="parent::author-notes | parent::corresp"> <span class="au-label"> <xsl:apply-templates/> </span> </xsl:when> <xsl:when test="parent::fn"> <!-- class fn-label = class au-label --> <span class="fn-label"> <xsl:apply-templates/> </span> </xsl:when> <xsl:otherwise> <span class="label"> <xsl:apply-templates/>  </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- These are handled inside ref --> <xsl:template match="label" mode="none"/> <xsl:template match="label" mode="nscitation"/> <xsl:template match="caption"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> <br/> </xsl:template> <!-- mixed-content; used in figures, tables, etc. --> <xsl:template match="long-desc"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> <br/> </xsl:template> <xsl:template match="object-id"> <xsl:choose> <xsl:when test="@pub-id-type"> <xsl:value-of select="@pub-id-type"/> </xsl:when> <xsl:otherwise> <span class="gen"> <xsl:text>Object ID</xsl:text> </span> </xsl:otherwise> </xsl:choose> <xsl:text>: </xsl:text> <xsl:apply-templates/> <xsl:text>. </xsl:text> <br/> </xsl:template> <!-- ============================================================= --> <!-- 32. FIGURE, MODE PUT-AT-END --> <!-- ============================================================= --> <!-- each figure is a row --> <xsl:template match="fig" mode="put-at-end"> <!-- left column: graphic right column: captioning elements - label, caption, etc. --><div class="figure"> <xsl:call-template name="make-id"/> <a href="{graphic/@xlink:href}"> <img src="http://openmedicine.ca/images/figure.png" alt="{@label}" /> </a> <span class="subTitle1"> <xsl:value-of select="label"/> <xsl:text>. </xsl:text> </span> <xsl:value-of select="caption"/> <xsl:text> [</xsl:text> <a href="{graphic/@xlink:href}">view</a> <xsl:text>]</xsl:text> <xsl:call-template name="nl-1"/></div> </xsl:template> <!-- ============================================================= --> <!-- 33. TABLE-WRAP, MODE PUT-AT-END --> <!-- ============================================================= --> <xsl:template match="table-wrap" mode="put-at-end"> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates select="@id"/> <xsl:apply-templates/> <br/> </div> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="table-wrap/@id"> <span class="gen"> <xsl:text>[TableWrap ID: </xsl:text> </span> <xsl:value-of select="."/> <span class="gen"> <xsl:text>] </xsl:text> </span> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="table"> <table width="100%" class="bm"> <xsl:if test="@frame"> <xsl:attribute name="frame"> <xsl:value-of select="@frame"/> </xsl:attribute> </xsl:if> <xsl:if test="@rules"> <xsl:attribute name="rules"> <xsl:value-of select="@rules"/> </xsl:attribute> </xsl:if> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </table> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="thead"> <thead> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </thead> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="th"> <th> <xsl:call-template name="make-id"/> <xsl:for-each select="@*"> <xsl:attribute name="{name(.)}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> <xsl:apply-templates/> </th> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="tr"> <tr> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </tr> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="td"> <td valign="top"> <xsl:call-template name="make-id"/> <xsl:for-each select="@*"> <xsl:attribute name="{name(.)}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> <xsl:apply-templates/> </td> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="tfoot | table-wrap-foot"> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </div> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- MODE front --> <!-- ============================================================= --> <!--<xsl:template match="journal-meta/journal-id | journal-meta/journal-title | journal-meta/journal-abbrev-title | journal-meta/publisher"/>--> <!-- ============================================================= --> <!-- 34) JOURNAL-META (in order of appearance in output) --> <!-- ============================================================= --> <!-- journal-id --> <xsl:template match="journal-id[@journal-id-type]" mode="front"> <span class="gen"> <xsl:text>Journal ID (</xsl:text> </span> <xsl:value-of select="@journal-id-type"/> <span class="gen"> <xsl:text>): </xsl:text> </span> <xsl:value-of select="."/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- abbrev-journal-title --> <xsl:template match="abbrev-journal-title" mode="front"> <span class="gen"> <xsl:text>Journal Abbreviation: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- issn --> <xsl:template match="issn" mode="front"> <span class="gen"> <xsl:text>ISSN: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- publisher --> <!-- required name, optional location --> <xsl:template match="publisher" mode="front"> <xsl:apply-templates mode="front"/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="publisher-name" mode="front"> <span class="gen"> <xsl:text>Publisher: </xsl:text> </span> <xsl:apply-templates/> </xsl:template> <xsl:template match="publisher-loc" mode="front"> <!-- if present, follows a publisher-name, so produces a comma --> <xsl:text>, </xsl:text> <xsl:apply-templates/> </xsl:template> <!-- notes --> <xsl:template match="notes" mode="front"> <span class="gen">Notes: </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 35) ARTICLE-META (in order of appearance in output) --> <!-- ============================================================= --> <!-- ext-link --> <xsl:template match="ext-link" mode="front"> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Link: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- supplementary-material --> <!-- Begins with: Object Identifier <object-id>, zero or more Label (Of a Figure, Reference, Etc.) <label>, zero or one Caption of a Figure, Table, Etc. <caption>, zero or one Any combination of: All the accessibility elements: Alternate Title Text (For a Figure, Etc.) <alt-text> Long Description <long-desc> All the address linking elements: Email Address <email> External Link <ext-link> Uniform Resource Indicator (URI) <uri> Then an ordinary combination of para-level elements Ending with: Any combination of: Attribution <attrib> Copyright Statement <copyright-statement>--> <xsl:template match="supplementary-material" mode="front"> <span class="gen"> <xsl:text>Supplementary Material:</xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- self-uri --> <xsl:template match="self-uri" mode="front"> <span class="gen"> <xsl:text>Self URI: </xsl:text> </span> <a href="{@xlink:href}"> <xsl:choose> <xsl:when test="*|text()"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@xlink:href"/> </xsl:otherwise> </xsl:choose> </a> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- product --> <!-- uses mode="product" within --> <xsl:template match="product" mode="front"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <span class="gen"> <xsl:text>Product Information: </xsl:text> </span> <xsl:apply-templates mode="product"/> </a> </xsl:when> <xsl:otherwise> <span class="gen"> <xsl:text>Product Information: </xsl:text> </span> <xsl:apply-templates mode="product"/> </xsl:otherwise> </xsl:choose> <br/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- The product element allows a mixed-content model, but perhaps sometimes only element nodes will be used. Rough test: - if the next sibling is another element, add a space to make the content somewhat legible. --> <xsl:template match="*" mode="product"> <xsl:apply-templates/> <xsl:if test="generate-id(following-sibling::node()[1]) =generate-id(following-sibling::*[1])"> <xsl:text> </xsl:text> </xsl:if> </xsl:template> <!-- copyright-statement, copyright-year, copyright-holder --> <xsl:template match="copyright-statement | copyright-year | copyright-holder" mode="front"> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- license whether or not part of permissions --> <xsl:template match="license" mode="front"> <br/> <xsl:choose> <xsl:when test="@license-type"> <span class="gen"><xsl:value-of select="@license-type"/>: </span> </xsl:when> <xsl:otherwise> <span class="gen">License: </span> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="p/* | p/text()"/> </xsl:template> <!-- history --> <xsl:template match="history/date" mode="front"> <xsl:variable name="the-type"> <xsl:choose> <xsl:when test="@date-type='accepted'">Accepted</xsl:when> <xsl:when test="@date-type='received'">Received</xsl:when> <xsl:when test="@date-type='rev-request'">Revision Requested</xsl:when> <xsl:when test="@date-type='rev-recd'">Revision Received</xsl:when> </xsl:choose> </xsl:variable> <xsl:if test="@date-type"> <span class="gen"> <xsl:value-of select="$the-type"/> <xsl:text> </xsl:text> </span> </xsl:if> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- pub-date --> <xsl:template match="pub-date" mode="front"> <xsl:choose> <xsl:when test="@pub-type='ppub'"> <span class="gen">Print </span> </xsl:when> <xsl:when test="@pub-type='epub'"> <span class="gen">Electronic </span> </xsl:when> <xsl:otherwise> <xsl:value-of select="@pub-type"/> </xsl:otherwise> </xsl:choose> <span class="gen"> <xsl:text> publication date: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- volume --> <xsl:template match="volume" mode="front"> <span class="gen"> <xsl:text>Volume: </xsl:text> </span> <xsl:apply-templates/> <xsl:if test="../issue"> <xsl:text> </xsl:text> </xsl:if> </xsl:template> <!-- issue --> <xsl:template match="issue" mode="front"> <span class="gen"> <xsl:text>Issue: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- elocation-id --> <xsl:template match="elocation-id" mode="front"> <span class="gen"> <xsl:text>E-location ID: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- fpage, lpage --> <xsl:template match="fpage" mode="front"> <span class="gen"> <xsl:text>First Page: </xsl:text> </span> <xsl:apply-templates/> <xsl:choose> <xsl:when test="../lpage"> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> <br/> <xsl:call-template name="nl-1"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="lpage" mode="front"> <span class="gen"> <xsl:text>Last Page: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- article-id --> <xsl:template match="article-id"> <xsl:choose> <xsl:when test="@pub-id-type='coden'"> <span class="gen"> <xsl:text>Coden: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='doi'"> <span class="gen"> <xsl:text>DOI: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='medline'"> <span class="gen"> <xsl:text>Medline Id: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='pii'"> <span class="gen"> <xsl:text>Publisher Item Identifier: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='pmid'"> <span class="gen"> <xsl:text>PubMed Id: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='publisher-id'"> <span class="gen"> <xsl:text>Publisher Id: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='sici'"> <span class="gen"> <xsl:text>Serial Item and Contribution Identifier: </xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='doaj'"> <span class="gen"> <xsl:text>Directory of Open Access Journals</xsl:text> </span> </xsl:when> <xsl:when test="@pub-id-type='other'"> <span class="gen"> <xsl:text>Article Id: </xsl:text> </span> </xsl:when> <xsl:otherwise> <span class="gen"> <xsl:text>ID: </xsl:text> </span> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- contract-num, contract-sponsor --> <xsl:template match="contract-num | contract-sponsor" mode="front"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> <br/> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> <br/> </xsl:otherwise> </xsl:choose> <xsl:call-template name="nl-1"/> </xsl:template> <!-- custom-meta-wrap --> <xsl:template match="custom-meta-wrap"> <xsl:for-each select="custom-meta"> <span class="gen"> <xsl:value-of select="meta-name"/> <xsl:text>: </xsl:text> </span> <xsl:value-of select="meta-value"/> <br/> </xsl:for-each> </xsl:template> <!-- ============================================================= --> <!-- 36) TITLE-GROUP --> <!-- ============================================================= --> <!-- title-group --> <!-- Appears only in article-meta --> <!-- The fn-group, if any, is output in the "back" of the HTML page, together with any other fn-group. --> <xsl:template match="title-group" mode="front"> <ITEXT> <xsl:attribute name="CH"> <xsl:value-of select="article-title"/> </xsl:attribute> </ITEXT> <para PARENT="Title" /> </xsl:template> <!-- ============================================================= --> <!-- 37) PARTS OF CONTRIB --> <!-- ============================================================= --> <!-- collab --> <!-- A mixed-content model; process it as given --> <xsl:template match="collab" mode="front"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- name --> <!-- uses mode="contrib" within --> <xsl:template match="name" mode="front"> <ITEXT> <xsl:attribute name="CH"> <xsl:apply-templates select="prefix" mode="contrib"/> <xsl:apply-templates select="given-names" mode="contrib"/> <xsl:apply-templates select="surname" mode="contrib"/> <xsl:apply-templates select="suffix" mode="contrib"/> </xsl:attribute> </ITEXT> </xsl:template> <xsl:template match="prefix | given-names" mode="contrib"> <xsl:apply-templates/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="surname" mode="contrib"> <xsl:apply-templates/> </xsl:template> <xsl:template match="suffix" mode="contrib"> <xsl:text>, </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="degrees" mode="contrib"> <xsl:text>, </xsl:text> <xsl:apply-templates/> </xsl:template> <!-- the formatting is sometimes in the source XML, e.g., <sup><italic>a</italic></sup> --> <xsl:template match="xref[@ref-type='author-notes']" mode="contrib"> <span class="au-label"> <a href="#{@rid}"> <xsl:choose> <xsl:when test="child::node()"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@rid"/> </xsl:otherwise> </xsl:choose> </a> </span> </xsl:template> <!-- the formatting is sometimes in the source XML, e.g., <sup><italic>a</italic></sup> --> <xsl:template match="xref[@ref-type='aff']" mode="contrib"> <span class="au-label"> <a href="#{@rid}"> <xsl:choose> <xsl:when test="child::node()"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@rid"/> </xsl:otherwise> </xsl:choose> </a> </span> </xsl:template> <!-- author-comment --> <!-- optional title, one-or-more paras --> <xsl:template match="author-comment | bio" mode="front"> <xsl:variable name="the-title"> <xsl:choose> <xsl:when test="title"> <xsl:apply-templates select="title" mode="front"/> </xsl:when> <xsl:when test="self::author-comment"> <xsl:text>Author Comment: </xsl:text> </xsl:when> <!-- no logical otherwise --> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:value-of select="$the-title"/> </a> </xsl:when> <xsl:otherwise> <xsl:call-template name="make-id"/> <xsl:value-of select="$the-title"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="*[not(self::title)]" mode="front"/> </xsl:template> <xsl:template match="author-comment/title" mode="front"> <xsl:apply-templates/> </xsl:template> <xsl:template match="bio/p" mode="front"> <ITEXT> <xsl:attribute name="CH"> <xsl:apply-templates/> </xsl:attribute> </ITEXT> <para PARENT="Bio" /> <xsl:call-template name="nl-1"/> </xsl:template> <!-- author-comment/p and bio/p in HTML give too much vertical space for the display situation; so we force them to produce only breaks. --> <xsl:template match="author-comment/p" mode="front"> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- parts of contrib: address --> <xsl:template match="address" mode="front"> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Address: </xsl:text> </span> <xsl:apply-templates mode="front"/> <br/> </xsl:template> <xsl:template match="institution" mode="front"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:otherwise> </xsl:choose> <xsl:if test="following-sibling::*"> <xsl:text> </xsl:text> </xsl:if> </xsl:template> <xsl:template match="address/*" mode="front"> <xsl:apply-templates/> <xsl:if test="following-sibling::*"> <xsl:text> </xsl:text> </xsl:if> </xsl:template> <!-- aff --> <!-- These affs are inside a contrib element --> <xsl:template match="aff" mode="front"> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Affiliation: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- aff --> <!-- These affs are NOT inside a contrib element --> <xsl:template match="aff" mode="aff-outside-contrib"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- on-behalf-of --> <xsl:template match="on-behalf-of" mode="front"> <span class="gen"> <xsl:text>On behalf of: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- role --> <xsl:template match="role" mode="front"> <span class="gen"> <xsl:text>Role: </xsl:text> </span> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- email --> <xsl:template match="email" mode="front"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-href"/> <span class="gen"> <xsl:text>Email: </xsl:text> </span> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="gen"> <xsl:text>Email: </xsl:text> </span> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> <xsl:call-template name="nl-1"/> </xsl:template> <!-- author-notes --> <xsl:template match="author-notes" mode="front"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates mode="front"/> </span> </xsl:template> <!-- author-notes/title --> <xsl:template match="author-notes/title" mode="front"> <b> <xsl:apply-templates/> </b> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- author-notes/corresp --> <!-- mixed-content; process it as given --> <xsl:template match="author-notes/corresp" mode="front"> <xsl:if test="not(label)"> <span class="gen"> <xsl:call-template name="make-id"/> <xsl:text>Correspondence: </xsl:text> </span> </xsl:if> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- author-notes/fn --> <!-- optional label, one or more paras --> <!-- unmoded (author-notes only appears in article-meta) --> <xsl:template match="author-notes/fn" mode="front"> <xsl:apply-templates/> <br/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- author-notes/fn/label --> <xsl:template match="author-notes/fn/label"> <span class="au-label"> <xsl:apply-templates/> </span> </xsl:template> <!-- author-notes/fn/p[1] --> <xsl:template match="author-notes/fn/p[1]" priority="2"> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:choose> <xsl:when test="preceding-sibling::label"/> <xsl:when test="parent::fn/@symbol"> <sup> <xsl:value-of select="parent::fn/@symbol"/> </sup> <xsl:text> </xsl:text> </xsl:when> <xsl:when test="parent::fn/@fn-type='com'"> <span class="gen"> <xsl:text>Communicated by footnote: </xsl:text> </span> </xsl:when> <xsl:when test="parent::fn/@fn-type='con'"> <span class="gen"> <xsl:text>Contributed by footnote: </xsl:text> </span> </xsl:when> <xsl:when test="parent::fn/@fn-type='cor'"> <span class="gen"> <xsl:text>Correspondence: </xsl:text> </span> </xsl:when> <xsl:when test="parent::fn/@fn-type='financial-disclosure'"> <span class="gen"> <xsl:text>Financial Disclosure: </xsl:text> </span> </xsl:when> <xsl:when test="parent::fn/@fn-type"> <span class="gen"> <xsl:text>[</xsl:text> <xsl:value-of select="parent::fn/@fn-type"/> <xsl:text>]</xsl:text> <xsl:text> </xsl:text> </span> </xsl:when> </xsl:choose> <xsl:apply-templates/> </span> </xsl:template> <!-- author-notes/fn/p processed as ordinary unmoded p--> <!-- abstract and trans-abstract are handled entirely within the make-front template --> <!-- ============================================================= --> <!-- BACK (unmoded templates) --> <!-- ============================================================= --> <!-- ============================================================= --> <!-- 38. BACK MATTER: ACKNOWLEDGEMENTS --> <!-- ============================================================= --> <xsl:template match="ack"> <xsl:call-template name="nl-1"/> <xsl:if test="position()>1"> <hr class="section-rule"/> </xsl:if> <xsl:call-template name="nl-1"/> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:if test="not(title)"> <div class="Title1">Acknowledgments</div> <xsl:call-template name="nl-1"/> </xsl:if> <xsl:apply-templates/> </div> </xsl:template> <!-- ============================================================= --> <!-- 39. BACK-MATTER: APPENDIX --> <!-- ============================================================= --> <xsl:template match="app"> <xsl:text>
</xsl:text><div class="figure"> <xsl:call-template name="make-id"/> <a href="{media/@xlink:href}"> <img src="http://openmedicine.ca/images/figure.png" alt="{@label}" /> </a> <span class="subTitle1"> <xsl:value-of select="label"/> <xsl:text>. </xsl:text> </span> <xsl:value-of select="title"/> <xsl:text> [</xsl:text> <a href="{media/@xlink:href}">view</a> <xsl:text>]</xsl:text> <xsl:call-template name="nl-1"/></div> </xsl:template> <!-- ============================================================= --> <!-- 40. BACK-MATTER: FOOTNOTE-GROUP and FN --> <!-- ============================================================= --> <xsl:template match="fn-group"> <xsl:call-template name="nl-1"/> <xsl:if test="position()>1"> <hr class="section-rule"/> </xsl:if> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- Footnote --> <!-- ============================================================= --> <!-- symbol or id is displayed by the first para within the fn --> <xsl:template match="fn"> <div> <xsl:if test="@id"> <xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute> </xsl:if> <xsl:apply-templates select="p"/> </div> </xsl:template> <!-- ============================================================= --> <!-- 41. BACK-MATTER: NOTES --> <!-- ============================================================= --> <xsl:template match="notes"> <xsl:call-template name="nl-1"/> <xsl:if test="position()>1"> <hr class="section-rule"/> </xsl:if> <xsl:call-template name="nl-1"/> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:if test="not(title)"> <span class="tl-main-part">Notes</span> <xsl:call-template name="nl-1"/> </xsl:if> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </div> </xsl:template> <xsl:template match="note"> <span class="capture-id"> <xsl:call-template name="make-id"/> <small> <xsl:apply-templates/> </small> </span> </xsl:template> <!-- ============================================================= --> <!-- 42. BACK MATTER: GLOSSARY --> <!-- ============================================================= --> <xsl:template match="glossary"> <xsl:call-template name="nl-1"/> <xsl:if test="position()>1"> <hr class="section-rule"/> </xsl:if> <xsl:call-template name="nl-1"/> <div class="capture-id"> <xsl:call-template name="make-id"/> <xsl:if test="not(title)"> <span class="tl-main-part"> <xsl:call-template name="make-id"/> <xsl:text>Glossary</xsl:text> </span> <xsl:call-template name="nl-1"/> </xsl:if> <xsl:apply-templates/> </div> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="gloss-group"> <xsl:call-template name="nl-1"/> <xsl:if test="not(title)"> <span class="tl-main-part">Glossary</span> <xsl:call-template name="nl-1"/> </xsl:if> <xsl:apply-templates/> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="def-list"> <xsl:call-template name="nl-1"/> <xsl:call-template name="make-anchor"/> <table width="60%" cellpadding="2" class="bm"> <xsl:call-template name="nl-1"/> <xsl:call-template name="table-setup-l-wide"/> <xsl:if test="title"> <tr> <th colspan="2" align="left"> <b><xsl:apply-templates select="title"/></b> </th> </tr> </xsl:if> <xsl:if test="term-head|def-head"> <tr> <td valign="top" align="right"> <i> <xsl:apply-templates select="term-head"/> </i> </td> <td valign="top"> <i> <xsl:apply-templates select="def-head"/> </i> </td> </tr> <xsl:call-template name="nl-1"/> </xsl:if> <xsl:apply-templates select="def-item"/> <xsl:call-template name="nl-1"/> </table> <xsl:if test="def-list"> <br/> <xsl:apply-templates select="def-list"/> </xsl:if> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="def-item"> <tr> <xsl:call-template name="make-id"/> <xsl:call-template name="nl-1"/> <xsl:apply-templates/> </tr> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="term"> <td valign="top" align="right"> <xsl:call-template name="make-id"/> <b> <xsl:apply-templates/> </b> </td> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="def"> <td valign="top"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </td> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 43. TARGET OF A REFERENCE --> <!-- ============================================================= --> <xsl:template match="target"> <a> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:template> <!-- ============================================================= --> <!-- 44. XREFS --> <!-- ============================================================= --> <!-- xref for fn, table-fn, or bibr becomes a superior number --> <!-- Displays the @rid, not the element content (if any) --> <xsl:template match="xref[@ref-type='fn'] | xref[@ref-type='table-fn'] | xref[@ref-type='bibr']"> <span class="xref"> <xsl:call-template name="make-id"/> <sup> <!-- if immediately-preceding sibling was an xref, punctuate (otherwise assume desired punctuation is in the source).--> <xsl:if test="local-name(preceding-sibling::node()[1])='xref'"> <span class="gen"> <xsl:text>, </xsl:text> </span> </xsl:if> <a href="#{@rid}"> <xsl:choose> <xsl:when test="child::node()"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@rid"/> </xsl:otherwise> </xsl:choose> </a> </sup> </span> </xsl:template> <xsl:template match="text()[normalize-space(.)='-']"> <xsl:choose> <!-- if a hyphen is the only thing in a text node and it's between two xrefs, we conclude that it's expressing a range, and we superscript it --> <xsl:when test="local-name(following-sibling::node()[1])='xref' and local-name(preceding-sibling::node()[1])='xref'"> <sup>-</sup> </xsl:when> <xsl:otherwise> <xsl:text>-</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="text()[normalize-space(.)=',']"> <xsl:choose> <!-- if a comma is the only thing in a text node and it's between two xrefs, we conclude that it's expressing a range, and we superscript it --> <xsl:when test="local-name(following-sibling::node()[1])='xref' and local-name(preceding-sibling::node()[1])='xref'"> <sup>,</sup> </xsl:when> <xsl:otherwise> <xsl:text>,</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- In xref of type fig or of type table, the element content is the figure/table number and typically part of a sentence, so -not- a superior number. --> <xsl:template match="xref[@ref-type='fig'] | xref[@ref-type='table']"> <span class="xref"> <xsl:call-template name="make-id"/> <a href="#{@rid}"> <xsl:choose> <!-- if xref not empty --> <xsl:when test="child::node()"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <!-- if empty --> <xsl:value-of select="@rid"/> </xsl:otherwise> </xsl:choose> </a> </span> </xsl:template> <!-- default: if none of the above ref-types --> <xsl:template match="xref"> <span class="xref"> <xsl:call-template name="make-id"/> <a href="#{@rid}"> <xsl:choose> <!-- if xref not empty --> <xsl:when test="child::node()"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <!-- if empty --> <xsl:value-of select="@rid"/> </xsl:otherwise> </xsl:choose> </a> </span> </xsl:template> <!-- ============================================================= --> <!-- 45. EXTERNAL LINKS --> <!-- ============================================================= --> <!-- xlink:href attribute makes a link --> <xsl:template match="ext-link | uri"> <xsl:choose> <xsl:when test="@xlink:href"> <a target="xrefwindow" > <xsl:call-template name="make-href"/> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:apply-templates/> </span> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- xlink:href attribute makes a link --> <xsl:template match="mailto"> <xsl:choose> <xsl:when test="@xlink:href"> <a> <xsl:call-template name="make-email"/> <xsl:apply-templates/> </a> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 46. TITLES: MAIN ARTICLE DIVISIONS --> <!-- ============================================================= --> <!-- main or top-level divisions --> <xsl:template match="abstract/title | body/sec/title | back/title | app-group/title | app/title | glossary/title | ack/title | ref-list/title | back/notes/title"> <xsl:call-template name="nl-1"/> <ITEXT> <xsl:attribute name="CH"> <xsl:apply-templates/> </xsl:attribute> </ITEXT> <para PARENT="Title 1"/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 47. TITLES: FIRST-LEVEL DIVISIONS AND DEFAULT --> <!-- ============================================================= --> <!-- first-level divisions and default --> <xsl:template match="body/sec/sec/title | ack/sec/title | app/sec/title | boxed-text/title | gloss-group/title | notes/sec/title"> <xsl:call-template name="nl-1"/> <span class="subTitle1"> <xsl:apply-templates/> </span> <xsl:call-template name="nl-1"/> </xsl:template> <xsl:template match="list/title"> <span class="li-title"> <xsl:apply-templates/> </span> </xsl:template> <xsl:template match="def-list/title"> <b><xsl:apply-templates/></b> </xsl:template> <!-- default: any other titles found --> <xsl:template match="title"> <xsl:call-template name="nl-1"/> <span class="subTitle1"> <xsl:apply-templates/> </span> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 48. TITLES: MAKE-ABSTRACT-TITLE --> <!-- ============================================================= --> <!-- called by template for abstract and trans-abstract --> <xsl:template name="words-for-abstract-title"> <xsl:choose> <!-- if there's a title, use it --> <xsl:when test="title"> <xsl:apply-templates select="title"/> </xsl:when> <!-- abstract with no title --> <xsl:when test="self::abstract"> <span class="gen"> <xsl:text>Abstract</xsl:text> </span> </xsl:when> <!-- trans-abstract with no title --> <xsl:when test="self::trans-abstract"> <span class="gen"> <xsl:text>Abstract, Translated</xsl:text> </span> </xsl:when> <!-- there is no logical otherwise --> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 49. UNMODED DATA ELEMENTS: MISCELLANEOUS --> <!-- ============================================================= --> <!-- epage --> <xsl:template match="epage"> <span class="gen"> <xsl:text>Electronic Page: </xsl:text> </span> <xsl:apply-templates/> <br/> </xsl:template> <!-- series --> <xsl:template match="series"> <xsl:text> (</xsl:text> <xsl:apply-templates/> <xsl:text>).</xsl:text> </xsl:template> <!-- comment --> <xsl:template match="comment"> <xsl:if test="not(self::node()='.')"> <xsl:text> </xsl:text> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:if> </xsl:template> <!-- annotation --> <xsl:template match="annotation"> <br/> <xsl:text> [</xsl:text> <xsl:apply-templates/> <xsl:text>]</xsl:text> <br/> </xsl:template> <!-- permissions --> <xsl:template match="permissions"> <xsl:choose> <xsl:when test="copyright-statement"> <xsl:apply-templates select="copyright-statement"/> </xsl:when> <xsl:otherwise> <xsl:if test="copyright-year"> <p> <span class="gen"> <xsl:text>Copyright: </xsl:text> </span> <xsl:apply-templates select="copyright-year"/> <xsl:apply-templates select="copyright-holder"/> </p> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- copyright-statement whether or not part of permissions --> <xsl:template match="copyright-statement"> <p> <xsl:apply-templates/> </p> </xsl:template> <!-- license whether or not part of permissions --> <xsl:template match="license"> <p> <xsl:if test="@license-type"> <span class="gen">[<xsl:value-of select="@license-type"/>] </span> </xsl:if> <xsl:apply-templates select="p/* | p/text()"/> </p> </xsl:template> <!-- ============================================================= --> <!-- 50. UNMODED DATA ELEMENTS: PARTS OF A DATE --> <!-- ============================================================= --> <xsl:template match="day"> <span class="gen"> <xsl:text>Day: </xsl:text> </span> <xsl:apply-templates/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="month"> <span class="gen"> <xsl:text>Month: </xsl:text> </span> <xsl:apply-templates/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="season"> <span class="gen"> <xsl:text>Season: </xsl:text> </span> <xsl:apply-templates/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="year"> <span class="gen"> <xsl:text>Year: </xsl:text> </span> <xsl:apply-templates/> </xsl:template> <xsl:template match="stringdate"> <span class="gen"> <xsl:text>Stringdate: </xsl:text> </span> <xsl:apply-templates/> </xsl:template> <!-- ============================================================= --> <!-- 51. UNMODED DATA ELEMENTS: PARTS OF A NAME --> <!-- ============================================================= --> <xsl:template match="name"> <xsl:variable name="nodetotal"> <xsl:choose> <xsl:when test="count(../*) < 7"> <xsl:value-of select="count(../*)" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="7" /> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="position" select="position()"/> <xsl:if test="position()=7"> <xsl:text>et al.</xsl:text> </xsl:if> <xsl:if test="position()<7"> <xsl:choose> <xsl:when test="given-names"> <xsl:apply-templates select="surname"/> <xsl:text> </xsl:text> <xsl:apply-templates select="given-names"/> <xsl:if test="suffix"> <xsl:text> </xsl:text> <xsl:apply-templates select="suffix"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="surname"/> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="following-sibling::aff"/> <xsl:otherwise> <xsl:choose> <xsl:when test="$nodetotal=$position"> <xsl:choose> <xsl:when test="parent::person-group/@person-group-type"> <xsl:choose> <xsl:when test="parent::person-group/@person-group-type='author'"> <xsl:text>. </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise>, </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> <xsl:template match="aff"> <xsl:variable name="nodetotal" select="count(../*)"/> <xsl:variable name="position" select="position()"/> <span class="capture-id"> <xsl:call-template name="make-id"/> <xsl:text> (</xsl:text> <xsl:apply-templates/> <xsl:text>)</xsl:text> </span> <xsl:choose> <xsl:when test="$nodetotal=$position">. </xsl:when> <xsl:otherwise>, </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="etal"> <xsl:text>et al.</xsl:text> <xsl:choose> <xsl:when test="parent::person-group/@person-group-type"> <xsl:choose> <xsl:when test="parent::person-group/@person-group-type='author'"> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise/> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- CITATION AND NLM-CITATION --> <!-- ============================================================= --> <!-- NLM Archiving DTD: - citation uses mode nscitation. NLM Publishing DTD: - nlm-citation uses several modes, including book, edited-book, conf, and "none".--> <!-- ============================================================= --> <!-- 52. BACK MATTER: REF-LIST --> <!-- ============================================================= --> <xsl:template match="ref-list"> <xsl:choose> <xsl:when test="not(title)"> <ITEXT CH="References"/> <para PARENT="Reference header"/> <xsl:call-template name="nl-1"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="title"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="*[not(self::title)]"/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- suppress the ref-list title so it doesn't reappear --> <xsl:template match="ref-list/title" mode="nscitation"/> <!-- ============================================================= --> <!-- 53. REF --> <!-- ============================================================= --> <!-- If ref/label, ref is a table row; If count(ref/citation) > 1, each citation is a table row --> <xsl:template match="ref"> <ITEXT> <xsl:attribute name="CH"> <xsl:value-of select="label"/> <xsl:text>.</xsl:text> </xsl:attribute> </ITEXT> <tab/> <xsl:apply-templates select="citation|nlm-citation"/> <para PARENT="References list"/> <xsl:call-template name="nl-1"/> </xsl:template> <!-- ============================================================= --> <!-- 54. CITATION (for NLM Archiving DTD) --> <!-- ============================================================= --> <!-- The citation model is mixed-context, so it is processed with an apply-templates (as for a paragraph) -except- if there is no PCDATA (only elements), spacing and punctuation also must be supplied = mode nscitation. --> <xsl:template match="ref/citation"> <xsl:choose> <!-- if has no significant text content, presume that punctuation is not supplied in the source XML = transform will supply it. --> <xsl:when test="not(text()[normalize-space()])"> <xsl:apply-templates mode="none"/> </xsl:when> <!-- mixed-content, processed as paragraph --> <xsl:otherwise> <xsl:apply-templates mode="nscitation"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 55. NLM-CITATION (for NLM Publishing DTD) --> <!-- ============================================================= --> <!-- The nlm-citation model allows only element content, so it takes a pull template and adds punctuation. --> <!-- Processing of nlm-citation uses several modes, including citation, book, edited-book, conf, inconf, and mode "none". --> <!-- Each citation-type is handled in its own template. --> <!-- Book or thesis --> <xsl:template match="ref/nlm-citation[@citation-type='book'] | ref/nlm-citation[@citation-type='thesis']"> <xsl:variable name="augroupcount" select="count(person-group) + count(collab)"/> <xsl:choose> <xsl:when test="$augroupcount>1 and person-group[@person-group-type!='author'] and article-title "> <xsl:apply-templates select="person-group[@person-group-type='author']" mode="book"/> <xsl:apply-templates select="collab" mode="book"/> <xsl:apply-templates select="article-title" mode="editedbook"/> <xsl:text>In: </xsl:text> <xsl:apply-templates select="person-group[@person-group-type='editor'] | person-group[@person-group-type='allauthors'] | person-group[@person-group-type='translator'] | person-group[@person-group-type='transed'] " mode="book"/> <xsl:apply-templates select="source" mode="book"/> <xsl:apply-templates select="edition" mode="book"/> <xsl:apply-templates select="volume" mode="book"/> <xsl:apply-templates select="trans-source" mode="book"/> <xsl:apply-templates select="publisher-name | publisher-loc" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="fpage | lpage" mode="book"/> </xsl:when> <xsl:when test="person-group[@person-group-type='author'] or person-group[@person-group-type='compiler']"> <xsl:apply-templates select="person-group[@person-group-type='author'] | person-group[@person-group-type='compiler']" mode="book"/> <xsl:apply-templates select="collab" mode="book"/> <xsl:apply-templates select="source" mode="book"/> <xsl:apply-templates select="edition" mode="book"/> <xsl:apply-templates select="person-group[@person-group-type='editor'] | person-group[@person-group-type='translator'] | person-group[@person-group-type='transed'] " mode="book"/> <xsl:apply-templates select="volume" mode="book"/> <xsl:apply-templates select="trans-source" mode="book"/> <xsl:apply-templates select="publisher-name | publisher-loc" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="article-title | fpage | lpage" mode="book"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="person-group[@person-group-type='editor'] | person-group[@person-group-type='translator'] | person-group[@person-group-type='transed'] | person-group[@person-group-type='guest-editor']" mode="book"/> <xsl:apply-templates select="collab" mode="book"/> <xsl:apply-templates select="source" mode="book"/> <xsl:apply-templates select="edition" mode="book"/> <xsl:apply-templates select="volume" mode="book"/> <xsl:apply-templates select="trans-source" mode="book"/> <xsl:apply-templates select="publisher-name | publisher-loc" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="article-title | fpage | lpage" mode="book"/> </xsl:otherwise> </xsl:choose> <xsl:call-template name="citation-tag-ends"/> </xsl:template> <!-- Conference proceedings --> <xsl:template match="ref/nlm-citation[@citation-type='confproc']"> <xsl:variable name="augroupcount" select="count(person-group) + count(collab)"/> <xsl:choose> <xsl:when test="$augroupcount>1 and person-group[@person-group-type!='author']"> <xsl:apply-templates select="person-group[@person-group-type='author']" mode="book"/> <xsl:apply-templates select="collab"/> <xsl:apply-templates select="article-title" mode="inconf"/> <xsl:text>In: </xsl:text> <xsl:apply-templates select="person-group[@person-group-type='editor'] | person-group[@person-group-type='allauthors'] | person-group[@person-group-type='translator'] | person-group[@person-group-type='transed'] " mode="book"/> <xsl:apply-templates select="source" mode="conf"/> <xsl:apply-templates select="conf-name | conf-date | conf-loc" mode="conf"/> <xsl:apply-templates select="publisher-loc" mode="none"/> <xsl:apply-templates select="publisher-name" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="fpage | lpage" mode="book"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="person-group" mode="book"/> <xsl:apply-templates select="collab" mode="book"/> <xsl:apply-templates select="article-title" mode="conf"/> <xsl:apply-templates select="source" mode="conf"/> <xsl:apply-templates select="conf-name | conf-date | conf-loc" mode="conf"/> <xsl:apply-templates select="publisher-loc" mode="none"/> <xsl:apply-templates select="publisher-name" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="fpage | lpage" mode="book"/> </xsl:otherwise> </xsl:choose> <xsl:call-template name="citation-tag-ends"/> </xsl:template> <!-- Government and other reports, other, web, and commun --> <xsl:template match="ref/nlm-citation[@citation-type='gov'] | ref/nlm-citation[@citation-type='web'] | ref/nlm-citation[@citation-type='commun'] | ref/nlm-citation[@citation-type='other']"> <xsl:apply-templates select="person-group" mode="book"/> <xsl:apply-templates select="collab"/> <xsl:choose> <xsl:when test="publisher-loc | publisher-name"> <xsl:apply-templates select="source" mode="book"/> <xsl:choose> <xsl:when test="@citation-type='web'"> <xsl:apply-templates select="edition" mode="none"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="edition"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="publisher-loc" mode="none"/> <xsl:apply-templates select="publisher-name" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="article-title|gov" mode="none"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="article-title|gov" mode="book"/> <xsl:apply-templates select="source" mode="book"/> <xsl:apply-templates select="edition"/> <xsl:apply-templates select="publisher-loc" mode="none"/> <xsl:apply-templates select="publisher-name" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="fpage | lpage" mode="book"/> <xsl:call-template name="citation-tag-ends"/> </xsl:template> <!-- Patents --> <xsl:template match="ref/nlm-citation[@citation-type='patent']"> <xsl:apply-templates select="person-group" mode="book"/> <xsl:apply-templates select="collab" mode="book"/> <xsl:apply-templates select="article-title | trans-title" mode="none"/> <xsl:apply-templates select="source" mode="none"/> <xsl:apply-templates select="patent" mode="none"/> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="fpage | lpage" mode="book"/> <xsl:call-template name="citation-tag-ends"/> </xsl:template> <!-- Discussion --> <xsl:template match="ref/nlm-citation[@citation-type='discussion']"> <xsl:apply-templates select="person-group" mode="book"/> <xsl:apply-templates select="collab"/> <xsl:apply-templates select="article-title" mode="editedbook"/> <xsl:text>In: </xsl:text> <xsl:apply-templates select="source" mode="none"/> <xsl:if test="publisher-name | publisher-loc"> <xsl:text> [</xsl:text> <xsl:apply-templates select="publisher-loc" mode="none"/> <xsl:value-of select="publisher-name"/> <xsl:text>]; </xsl:text> </xsl:if> <xsl:apply-templates select="year | month | time-stamp | season | access-date" mode="book"/> <xsl:apply-templates select="fpage | lpage" mode="book"/> <xsl:call-template name="citation-tag-ends"/> </xsl:template> <!-- If none of the above citation-types applies, use mode="none". This generates punctuation. --> <!-- (e.g., citation-type="journal" --> <xsl:template match="nlm-citation"> <xsl:apply-templates select="*[not(self::annotation) and not(self::edition) and not(self::lpage) and not(self::comment)]|text()" mode="none"/> <xsl:call-template name="citation-tag-ends"/> </xsl:template> <!-- ============================================================= --> <!-- person-group, mode=book --> <!-- ============================================================= --> <xsl:template match="person-group" mode="book"> <!-- XX needs fix, value is not a nodeset on the when --> <!-- <xsl:choose> <xsl:when test="@person-group-type='editor' | @person-group-type='assignee' | @person-group-type='translator' | @person-group-type='transed' | @person-group-type='guest-editor' | @person-group-type='compiler' | @person-group-type='inventor' | @person-group-type='allauthors'"> <xsl:call-template name="make-persons-in-mode"/> <xsl:call-template name="choose-person-type-string"/> <xsl:call-template name="choose-person-group-end-punct"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="book"/> </xsl:otherwise> </xsl:choose>--> <xsl:call-template name="make-persons-in-mode"/> <xsl:call-template name="choose-person-type-string"/> <xsl:call-template name="choose-person-group-end-punct"/> </xsl:template> <!-- if given names aren't all-caps, use book mode --> <xsl:template name="make-persons-in-mode"> <xsl:variable name="gnms" select="string(descendant::given-names)"/> <xsl:variable name="GNMS" select="translate($gnms, 'abcdefghjiklmnopqrstuvwxyz', 'ABCDEFGHJIKLMNOPQRSTUVWXYZ')"/> <xsl:choose> <xsl:when test="$gnms=$GNMS"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="book"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="choose-person-type-string"> <xsl:variable name="person-group-type"> <xsl:value-of select="@person-group-type"/> </xsl:variable> <xsl:choose> <!-- allauthors is an exception to the usual choice pattern --> <xsl:when test="$person-group-type='allauthors'"/> <!-- the usual choice pattern: singular or plural? --> <xsl:when test="count(name) > 1 or etal "> <xsl:value-of select="($person-strings[@source=$person-group-type]/@plural)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="($person-strings[@source=$person-group-type]/@singular)"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="choose-person-group-end-punct"> <xsl:choose> <!-- compiler is an exception to the usual choice pattern --> <xsl:when test="@person-group-type='compiler'"> <xsl:text>.!! </xsl:text> </xsl:when> <!-- the usual choice pattern: semi-colon or period? --> <xsl:when test="following-sibling::person-group"> <xsl:text>; </xsl:text> </xsl:when> <xsl:otherwise/> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- 56. Citation subparts (mode "none" separately at end) --> <!-- ============================================================= --> <!-- names --> <xsl:template match="name" mode="nscitation"> <xsl:value-of select="surname"/> <xsl:text>, </xsl:text> <xsl:value-of select="given-names"/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="name" mode="book"> <xsl:variable name="nodetotal" select="count(../*)"/> <xsl:variable name="penult" select="count(../*)-1"/> <xsl:variable name="position" select="position()"/> <xsl:choose> <!-- if given-names --> <xsl:when test="given-names"> <xsl:apply-templates select="surname"/> <xsl:text>, </xsl:text> <xsl:call-template name="firstnames"> <xsl:with-param name="nodetotal" select="$nodetotal"/> <xsl:with-param name="position" select="$position"/> <xsl:with-param name="names" select="given-names"/> <xsl:with-param name="pgtype"> <xsl:choose> <xsl:when test="parent::person-group[@person-group-type]"> <xsl:value-of select="parent::person-group/@person-group-type"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="'author'"/> </xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:call-template> <xsl:if test="suffix"> <xsl:text>, </xsl:text> <xsl:apply-templates select="suffix"/> </xsl:if> </xsl:when> <!-- if no given-names --> <xsl:otherwise> <xsl:apply-templates select="surname"/> </xsl:otherwise> </xsl:choose> <xsl:choose> <!-- if have aff --> <xsl:when test="following-sibling::aff"/> <!-- if don't have aff --> <xsl:otherwise> <xsl:choose> <!-- if part of person-group --> <xsl:when test="parent::person-group/@person-group-type"> <xsl:choose> <!-- if author --> <xsl:when test="parent::person-group/@person-group-type='author'"> <xsl:choose> <xsl:when test="$nodetotal=$position">. </xsl:when> <xsl:when test="$penult=$position"> <xsl:choose> <xsl:when test="following-sibling::etal">, </xsl:when> <xsl:otherwise>; </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise>; </xsl:otherwise> </xsl:choose> </xsl:when> <!-- if not author --> <xsl:otherwise> <xsl:choose> <xsl:when test="$nodetotal=$position"/> <xsl:when test="$penult=$position"> <xsl:choose> <xsl:when test="following-sibling::etal">, </xsl:when> <xsl:otherwise>; </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise>; </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- if not part of person-group --> <xsl:otherwise> <xsl:choose> <xsl:when test="$nodetotal=$position">. </xsl:when> <xsl:when test="$penult=$position"> <xsl:choose> <xsl:when test="following-sibling::etal">, </xsl:when> <xsl:otherwise>; </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise>; </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="collab" mode="book"> <xsl:apply-templates/> <xsl:if test="@collab-type='compilers'"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:if test="@collab-type='assignee'"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="etal" mode="book"> <xsl:text>et al.</xsl:text> <xsl:choose> <xsl:when test="parent::person-group/@person-group-type"> <xsl:choose> <xsl:when test="parent::person-group/@person-group-type='author'"> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise/> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- affiliations --> <xsl:template match="aff" mode="book"> <xsl:variable name="nodetotal" select="count(../*)"/> <xsl:variable name="position" select="position()"/> <xsl:text> (</xsl:text> <xsl:apply-templates/> <xsl:text>)</xsl:text> <xsl:choose> <xsl:when test="$nodetotal=$position">. </xsl:when> <xsl:otherwise>, </xsl:otherwise> </xsl:choose> </xsl:template> <!-- publication info --> <xsl:template match="article-title" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <xsl:template match="article-title" mode="book"> <xsl:apply-templates/> <xsl:choose> <xsl:when test="../fpage or ../lpage"> <xsl:text>; </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="article-title" mode="editedbook"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="article-title" mode="conf"> <xsl:apply-templates/> <xsl:choose> <xsl:when test="../conf-name"> <xsl:text>. </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>; </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="article-title" mode="inconf"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="source" mode="nscitation"> <i> <xsl:apply-templates/> </i> </xsl:template> <xsl:template match="source" mode="book"> <xsl:choose> <xsl:when test="../trans-source"> <i><xsl:apply-templates/></i> <xsl:choose> <xsl:when test="../volume | ../edition"> <xsl:text>. </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <i><xsl:apply-templates/></i> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="source" mode="conf"> <xsl:apply-templates/> <xsl:text>; </xsl:text> </xsl:template> <xsl:template match="trans-source" mode="book"> <xsl:text> [</xsl:text> <xsl:apply-templates/> <xsl:text>]. </xsl:text> </xsl:template> <xsl:template match="volume" mode="nscitation"> <xsl:text> </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="volume | edition" mode="book"> <xsl:apply-templates/> <xsl:if test="@collab-type='compilers'"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:if test="@collab-type='assignee'"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:text>. </xsl:text> </xsl:template> <!-- dates --> <xsl:template match="month" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <xsl:template match="month" mode="book"> <xsl:variable name="month" select="."/> <xsl:choose> <xsl:when test="$month='01' or $month='1' or $month='January'">Jan</xsl:when> <xsl:when test="$month='02' or $month='2' or $month='February'">Feb</xsl:when> <xsl:when test="$month='03' or $month='3' or $month='March'">Mar</xsl:when> <xsl:when test="$month='04' or $month='4' or $month='April'">Apr</xsl:when> <xsl:when test="$month='05' or $month='5' or $month='May'">May</xsl:when> <xsl:when test="$month='06' or $month='6' or $month='June'">Jun</xsl:when> <xsl:when test="$month='07' or $month='7' or $month='July'">Jul</xsl:when> <xsl:when test="$month='08' or $month='8' or $month='August'">Aug</xsl:when> <xsl:when test="$month='09' or $month='9' or $month='September'">Sep</xsl:when> <xsl:when test="$month='10' or $month='October'">Oct</xsl:when> <xsl:when test="$month='11' or $month='November'">Nov</xsl:when> <xsl:when test="$month='12' or $month='December'">Dec</xsl:when> <xsl:otherwise> <xsl:value-of select="$month"/> </xsl:otherwise> </xsl:choose> <xsl:if test="../day"> <xsl:text> </xsl:text> <xsl:value-of select="../day"/> </xsl:if> <xsl:choose> <xsl:when test="../time-stamp"> <xsl:text>, </xsl:text> <xsl:value-of select="../time-stamp"/> <xsl:text> </xsl:text> </xsl:when> <xsl:when test="../access-date"/> <xsl:otherwise> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="day" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <xsl:template match="year" mode="nscitation"> <xsl:text> </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="year" mode="book"> <xsl:choose> <xsl:when test="../month or ../season or ../access-date"> <xsl:apply-templates/> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="time-stamp" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <xsl:template match="time-stamp" mode="book"/> <xsl:template match="access-date" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <xsl:template match="access-date" mode="book"> <xsl:text> [</xsl:text> <xsl:apply-templates/> <xsl:text>]. </xsl:text> </xsl:template> <xsl:template match="season" mode="book"> <xsl:apply-templates/> <xsl:if test="@collab-type='compilers'"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:if test="@collab-type='assignee'"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:text>. </xsl:text> </xsl:template> <!-- pages --> <xsl:template match="fpage" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <xsl:template match="fpage" mode="book"> <xsl:text>p. </xsl:text> <xsl:apply-templates/> <xsl:if test="../lpage"> <xsl:text>.</xsl:text> </xsl:if> </xsl:template> <xsl:template match="lpage" mode="book"> <xsl:choose> <xsl:when test="../fpage"> <xsl:text>-</xsl:text> <xsl:apply-templates/> <xsl:text>.</xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> <xsl:text> p.</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="lpage" mode="nscitation"> <xsl:apply-templates/> </xsl:template> <!-- misc stuff --> <xsl:template match="pub-id" mode="nscitation"> <xsl:apply-templates select="." mode="none"/> <xsl:text> [</xsl:text> <xsl:value-of select="@pub-id-type"/> <xsl:text>: </xsl:text> <xsl:apply-templates/> <xsl:text>]</xsl:text> </xsl:template> <xsl:template match="pub-id" mode="none"> <xsl:variable name="pub-id" select="."/> <xsl:variable name="href"> <xsl:choose> <xsl:when test="@pub-id-type='medline' or @pub-id-type='pmid'"> <xsl:value-of select="'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=abstract&list_uids='"/> </xsl:when> <xsl:when test="@pub-id-type='doi'"> <xsl:value-of select="'http://dx.doi.org/'"/> </xsl:when> </xsl:choose> </xsl:variable> <xsl:if test="$href!=''"> <xsl:text> [</xsl:text> <a> <xsl:attribute name="href"> <xsl:value-of select="concat($href,$pub-id)"/> </xsl:attribute> <xsl:choose> <xsl:when test="@pub-id-type='medline' or @pub-id-type='pmid'"> <xsl:text>PubMed</xsl:text> </xsl:when> <xsl:when test="@pub-id-type='doi'"> <xsl:text>CrossRef</xsl:text> </xsl:when> </xsl:choose> </a> <xsl:text>] </xsl:text> </xsl:if> </xsl:template> <xsl:template match="annotation" mode="nscitation"> <blockquote> <xsl:apply-templates/> </blockquote> </xsl:template> <xsl:template match="comment" mode="nscitation"> <xsl:if test="not(self::node()='.')"> <br/> <small> <xsl:apply-templates/> </small> </xsl:if> </xsl:template> <xsl:template match="conf-name | conf-date" mode="conf"> <xsl:apply-templates/> <xsl:text>; </xsl:text> </xsl:template> <xsl:template match="conf-loc" mode="conf"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <!-- All formatting elements in citations processed normally --> <xsl:template match="bold | italic | monospace | overline | sc | strike | sub |sup | underline" mode="nscitation"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="bold | italic | monospace | overline | sc | strike | sub |sup | underline" mode="none"> <xsl:apply-templates select="."/> </xsl:template> <!-- ============================================================= --> <!-- "firstnames" --> <!-- ============================================================= --> <!-- called by match="name" in book mode, as part of citation handling when given-names is not all-caps --> <xsl:template name="firstnames"> <xsl:param name="nodetotal"/> <xsl:param name="position"/> <xsl:param name="names"/> <xsl:param name="pgtype"/> <xsl:variable name="length" select="string-length($names)-1"/> <xsl:variable name="gnm" select="substring($names,$length,2)"/> <xsl:variable name="GNM"> <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="substring($names,$length,2)"/> </xsl:call-template> </xsl:variable> <!--<xsl:text>Value of $names = [</xsl:text><xsl:value-of select="$names"/><xsl:text>]</xsl:text><xsl:text>Value of $length = [</xsl:text><xsl:value-of select="$length"/><xsl:text>]</xsl:text><xsl:text>Value of $gnm = [</xsl:text><xsl:value-of select="$gnm"/><xsl:text>]</xsl:text><xsl:text>Value of $GNM = [</xsl:text><xsl:value-of select="$GNM"/><xsl:text>]</xsl:text>--> <xsl:if test="$names"> <xsl:choose> <xsl:when test="$gnm=$GNM"> <xsl:apply-templates select="$names"/> <xsl:choose> <xsl:when test="$nodetotal!=$position"> <xsl:text>.</xsl:text> </xsl:when> <xsl:when test="$pgtype!='author'"> <xsl:text>.</xsl:text> </xsl:when> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$names"/> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> <!-- strip superfluous . from article-title and source elements --> <xsl:template match="text()[parent::article-title or parent::source]"> <xsl:variable name="last-char" select="normalize-space(substring(., string-length(.), 1))"/> <xsl:choose> <xsl:when test="contains('.', $last-char)"> <xsl:value-of select="substring(normalize-space(.), 1, string-length(.)-1)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ============================================================= --> <!-- mode=none --> <!-- ============================================================= --> <!-- This mode assumes no punctuation is provided in the XML. It is used, among other things, for the citation/ref when there is no significant text node inside the ref. --> <xsl:template match="name" mode="none"> <xsl:value-of select="surname"/> <xsl:text>, </xsl:text> <xsl:value-of select="given-names"/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="article-title" mode="none"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="volume" mode="none"> <xsl:apply-templates/> </xsl:template> <xsl:template match="edition" mode="none"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="supplement" mode="none"> <xsl:text> </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="issue" mode="none"> <xsl:text>(</xsl:text> <xsl:apply-templates/> <xsl:text>)</xsl:text> </xsl:template> <xsl:template match="publisher-loc" mode="none"> <xsl:apply-templates/> <xsl:text>: </xsl:text> </xsl:template> <xsl:template match="publisher-name" mode="none"> <xsl:apply-templates/> <xsl:text>; </xsl:text> </xsl:template> <xsl:template match="person-group" mode="none"> <xsl:variable name="gnms" select="string(descendant::given-names)"/> <xsl:variable name="GNMS"> <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="$gnms"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$gnms=$GNMS"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="node()" mode="book"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="collab" mode="none"> <xsl:apply-templates/> <xsl:if test="@collab-type"> <xsl:text>, </xsl:text> <xsl:value-of select="@collab-type"/> </xsl:if> <xsl:choose> <xsl:when test="following-sibling::collab"> <xsl:text>; </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="source" mode="none"> <xsl:text> </xsl:text> <i3><xsl:apply-templates/></i3> <xsl:choose> <xsl:when test="../access-date"> <xsl:if test="../edition"> <xsl:text> (</xsl:text> <xsl:apply-templates select="../edition" mode="plain"/> <xsl:text>)</xsl:text> </xsl:if> <xsl:text>. </xsl:text> </xsl:when> <xsl:when test="../volume | ../fpage"> <xsl:if test="../edition"> <xsl:text> (</xsl:text> <xsl:apply-templates select="../edition" mode="plain"/> <xsl:text>)</xsl:text> </xsl:if> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> <xsl:if test="../edition"> <xsl:text> (</xsl:text> <xsl:apply-templates select="../edition" mode="plain"/> <xsl:text>)</xsl:text> </xsl:if> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="trans-title" mode="none"> <xsl:text> [</xsl:text> <xsl:apply-templates/> <xsl:text>]. </xsl:text> </xsl:template> <xsl:template match="month" mode="none"> <xsl:variable name="month" select="."/> <xsl:choose> <xsl:when test="$month='01' or $month='1' ">Jan</xsl:when> <xsl:when test="$month='02' or $month='2' ">Feb</xsl:when> <xsl:when test="$month='03' or $month='3' ">Mar</xsl:when> <xsl:when test="$month='04' or $month='4' ">Apr</xsl:when> <xsl:when test="$month='05' or $month='5' ">May</xsl:when> <xsl:when test="$month='06' or $month='6'">Jun</xsl:when> <xsl:when test="$month='07' or $month='7'">Jul</xsl:when> <xsl:when test="$month='08' or $month='8' ">Aug</xsl:when> <xsl:when test="$month='09' or $month='9' ">Sep</xsl:when> <xsl:when test="$month='10' ">Oct</xsl:when> <xsl:when test="$month='11' ">Nov</xsl:when> <xsl:when test="$month='12' ">Dec</xsl:when> <xsl:otherwise> <xsl:value-of select="$month"/> </xsl:otherwise> </xsl:choose> <xsl:if test="../day"> <xsl:text> </xsl:text> <xsl:value-of select="../day"/> </xsl:if> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="day" mode="none"/> <xsl:template match="year" mode="none"> <xsl:choose> <xsl:when test="../month or ../season or ../access-date"> <xsl:apply-templates mode="none"/> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="none"/> <xsl:if test="../volume or ../issue"> <xsl:text>;</xsl:text> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="access-date" mode="none"> <xsl:text> [</xsl:text> <xsl:apply-templates/> <xsl:text>];</xsl:text> </xsl:template> <xsl:template match="season" mode="none"> <xsl:apply-templates/> <xsl:text>;</xsl:text> </xsl:template> <xsl:template match="fpage" mode="none"> <xsl:variable name="fpgct" select="count(../fpage)"/> <xsl:variable name="lpgct" select="count(../lpage)"/> <xsl:variable name="hermano" select="name(following-sibling::node())"/> <xsl:choose> <xsl:when test="preceding-sibling::fpage"> <xsl:choose> <xsl:when test="following-sibling::fpage"> <xsl:text> </xsl:text> <xsl:apply-templates/> <xsl:if test="$hermano='lpage'"> <xsl:text>–</xsl:text> <xsl:apply-templates select="following-sibling::lpage[1]" mode="none"/> </xsl:if> <xsl:text>,</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> <xsl:apply-templates/> <xsl:if test="$hermano='lpage'"> <xsl:text>–</xsl:text> <xsl:apply-templates select="following-sibling::lpage[1]" mode="none"/> </xsl:if> <xsl:text>.</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:text>:</xsl:text> <xsl:apply-templates/> <xsl:choose> <xsl:when test="$hermano='lpage'"> <xsl:text>–</xsl:text> <xsl:apply-templates select="following-sibling::lpage[1]" mode="write"/> <xsl:text>.</xsl:text> </xsl:when> <xsl:when test="$hermano='fpage'"> <xsl:text>,</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>.</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="lpage" mode="none"/> <xsl:template match="lpage" mode="write"> <xsl:apply-templates/> </xsl:template> <xsl:template match="gov" mode="none"> <xsl:choose> <xsl:when test="../trans-title"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="patent" mode="none"> <xsl:apply-templates/> <xsl:text>. </xsl:text> </xsl:template> <xsl:template match="comment" mode="none"> <xsl:text> </xsl:text> <xsl:apply-templates/> </xsl:template> <!-- special handling for citation links --> <xsl:template match="comment/ext-link" mode="none"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="comment/ext-link" mode="nscitation"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="comment/ext-link" mode="citation"> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="comment/ext-link"> <xsl:variable name="href"> <xsl:value-of select="@xlink:href"/> </xsl:variable> <xsl:text> [</xsl:text> <!-- NB: target is deprecated in XHTML 1.0S --> <a> <xsl:call-template name="make-id"/> <xsl:attribute name="href"> <xsl:value-of select="$href"/> </xsl:attribute> <xsl:choose> <xsl:when test="contains($href, 'www.webcitation.org') or contains(., 'www.webcitation.org')"> <xsl:text>WebCite Cache</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>Full Text</xsl:text> </xsl:otherwise> </xsl:choose> </a> <xsl:text>] </xsl:text> </xsl:template> <!-- ============================================================= --> <!-- 57. "CITATION-TAG-ENDS" --> <!-- ============================================================= --> <xsl:template name="citation-tag-ends"> <xsl:apply-templates select="series" mode="citation"/> <!-- If language is not English --> <!-- XX review logic --> <xsl:if test="article-title[@xml:lang!='en'] or article-title[@xml:lang!='EN']"> <xsl:call-template name="language"> <xsl:with-param name="lang" select="article-title/@xml:lang"/> </xsl:call-template> </xsl:if> <xsl:if test="source[@xml:lang!='en'] or source[@xml:lang!='EN']"> <xsl:call-template name="language"> <xsl:with-param name="lang" select="source/@xml:lang"/> </xsl:call-template> </xsl:if> <xsl:apply-templates select="comment" mode="citation"/> <xsl:apply-templates select="annotation" mode="citation"/> </xsl:template></xsl:transform>