2018-04-05 17:25:59 +00:00
<?xml version="1.0"?>
<xsl:stylesheet version= "1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" xmlns:o= "urn:schemas-microsoft-com:office:office" xmlns:r= "http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:v= "urn:schemas-microsoft-com:vml" xmlns:w= "http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w10= "urn:schemas-microsoft-com:office:word" xmlns:wp= "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wps= "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpg= "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:mc= "http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wp14= "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:w14= "http://schemas.microsoft.com/office/word/2010/wordml" >
<xsl:output method= "text" />
<xsl:template match= "/" >
<xsl:apply-templates select= "/w:document/w:body/*" />
</xsl:template>
<!-- Ignore these -->
<xsl:template match= "w:p[starts-with(w:pPr/w:pStyle/@w:val, 'TOC')]" />
<xsl:template match= "w:p[starts-with(w:pPr/w:pStyle/@w:val, 'Contents1')]" />
<xsl:template match= "w:p[starts-with(w:pPr/w:pStyle/@w:val, 'Contents2')]" />
<xsl:template match= "w:p[starts-with(w:pPr/w:pStyle/@w:val, 'Contents3')]" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'ChapterStart']" />
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'ChapterNumber']" />
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'Normal']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'Standard']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'AuthorQuery']" />
2022-07-14 00:47:46 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BookHalfTitle']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BookTitle0']" />
2022-09-05 18:36:01 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BookEdition']" />
2022-07-14 00:47:46 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BookAuthor']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'Copyright']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'CopyrightHead']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'CopyrightLOC']" />
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'ProductionDirective0']" />
2022-09-06 15:03:53 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'ProductionDirective']" />
2022-09-05 19:17:55 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BoxType']" />
2022-09-09 23:57:06 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'GraphicSlug']" />
2018-04-05 17:25:59 +00:00
2019-01-29 22:15:21 +00:00
<xsl:template match= "w:p[w:pPr[not(w:pStyle)]]" />
2022-09-13 16:22:20 +00:00
<xsl:variable name= "chapternumber" select= "//w:p[w:pPr/w:pStyle/@w:val = 'ChapterNumber']/w:r/w:t" />
2018-04-05 17:25:59 +00:00
<!-- Paragraph styles -->
2022-08-30 00:05:40 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'AppendixNumber']" >
<xsl:text > [TOC] </xsl:text>
<xsl:text > ## Appendix </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > : </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'AppendixTitle']" >
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'ChapterTitle']" >
<xsl:text > [TOC] </xsl:text>
<xsl:text > # </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-08-30 00:05:40 +00:00
2022-09-05 18:36:01 +00:00
<xsl:template match= "w:p[(w:pPr/w:pStyle/@w:val = 'HeadA' or w:pPr/w:pStyle/@w:val = 'FrontmatterTitle') and w:r/w:t]" >
2018-04-05 17:25:59 +00:00
<xsl:text > ## </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-09-05 18:36:01 +00:00
<xsl:template match= "w:p[(w:pPr/w:pStyle/@w:val = 'HeadA' or w:pPr/w:pStyle/@w:val = 'FrontmatterTitle') and not(w:r/w:t)]" />
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'HeadB']" >
<xsl:text > ### </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'HeadC']" >
<xsl:text > #### </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'HeadBox']" >
<xsl:text > ### </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'NumListA' or @w:val = 'NumListB' or @w:val = 'ListNumber']]" >
2018-04-05 17:25:59 +00:00
<xsl:text > 1. </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'NumListC']]" >
<xsl:text > 1. </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-09-13 16:03:27 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BulletA' or @w:val = 'BulletB' or @w:val = 'ListPlainA' or @w:val = 'ListPlainB' or @w:val = 'ListBullet' or @w:val = 'ListPlain' or @w:val = 'ListBullet0']]" >
2018-04-05 17:25:59 +00:00
<xsl:text > * </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
2022-09-13 16:03:27 +00:00
<xsl:if test= "not(following-sibling::*[1][self::w:p]) or following-sibling::w:p[1][w:pPr/w:pStyle[@w:val != 'BulletA' and @w:val != 'BulletB' and @w:val != 'ListPlainA' and @w:val != 'ListPlainB' and @w:val != 'ListBullet' and @w:val != 'ListPlain' and @w:val != 'ListBullet0']]" >
2022-09-06 01:38:51 +00:00
<xsl:text > </xsl:text>
</xsl:if>
2018-04-05 17:25:59 +00:00
</xsl:template>
2022-09-06 15:27:07 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BoxListBullet']]" >
<xsl:text > > * </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
2022-09-09 23:46:05 +00:00
<xsl:choose >
<xsl:when test= "following-sibling::w:p[1][w:pPr/w:pStyle[@w:val = 'BoxBody']]" >
<xsl:text > > </xsl:text>
</xsl:when>
<xsl:when test= "not(following-sibling::*[1][self::w:p])" >
<xsl:text > </xsl:text>
</xsl:when>
</xsl:choose>
2022-09-06 15:27:07 +00:00
</xsl:template>
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BulletC' or @w:val = 'ListPlainC']]" >
<xsl:text > * </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'SubBullet']]" >
<xsl:text > * </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'CodeLabel']]" >
<xsl:text > Filename: </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-09-05 18:36:01 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BodyFirst' or @w:val = 'Body' or @w:val = 'BodyFirstBox' or @w:val = 'BodyBox' or @w:val = '1stPara' or @w:val = 'ChapterIntro' or @w:val = 'BodyContinued' or @w:val = 'SourceForeword']]" >
2018-04-05 17:25:59 +00:00
<xsl:if test= ".//w:t" >
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'CodeA' or @w:val = 'CodeAWingding']]" >
<xsl:text > ``` </xsl:text>
<!-- Don't apply Emphasis/etc templates in code blocks -->
<xsl:for-each select= "w:r" >
<xsl:value-of select= "w:t" />
</xsl:for-each>
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'CodeB' or @w:val = 'CodeBWingding']]" >
<!-- Don't apply Emphasis/etc templates in code blocks -->
<xsl:for-each select= "w:r" >
<xsl:value-of select= "w:t" />
</xsl:for-each>
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'CodeC' or @w:val = 'CodeCWingding']]" >
<!-- Don't apply Emphasis/etc templates in code blocks -->
<xsl:for-each select= "w:r" >
<xsl:value-of select= "w:t" />
</xsl:for-each>
<xsl:text > ``` </xsl:text>
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'Code' or @w:val = 'CodeWide' or @w:val = 'CodeAnnotated']]" >
2022-09-06 01:54:15 +00:00
<xsl:if test= "not(preceding-sibling::*[1][self::w:p]) or preceding-sibling::w:p[1][w:pPr[not(w:pStyle) or (w:pStyle/@w:val != 'Code' and w:pStyle/@w:val != 'CodeWide' and w:pStyle/@w:val != 'CodeAnnotated')]]" >
<xsl:text > ``` </xsl:text>
</xsl:if>
2022-07-15 00:12:02 +00:00
<!-- Don't apply Emphasis/etc templates in code blocks -->
<xsl:for-each select= "w:r" >
<xsl:value-of select= "w:t" />
</xsl:for-each>
2022-09-06 01:54:15 +00:00
<xsl:text > </xsl:text>
<xsl:if test= "not(following-sibling::*[1][self::w:p]) or following-sibling::w:p[1][w:pPr[not(w:pStyle) or (w:pStyle/@w:val != 'Code' and w:pStyle/@w:val != 'CodeWide' and w:pStyle/@w:val != 'CodeAnnotated')]]" >
<xsl:text > ``` </xsl:text>
</xsl:if>
2022-07-15 00:12:02 +00:00
</xsl:template>
2022-09-13 14:54:59 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BoxCode']]" >
<xsl:choose >
<xsl:when test= "not(preceding-sibling::*[1][self::w:p]) or preceding-sibling::w:p[1][w:pPr[not(w:pStyle) or w:pStyle/@w:val != 'BoxCode']]" >
<xsl:text > > ``` > </xsl:text>
</xsl:when>
<xsl:otherwise >
<xsl:text > > </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select= "*" />
<xsl:choose >
<xsl:when test= "following-sibling::w:p[1][w:pPr/w:pStyle/@w:val = 'BoxCode']" >
<xsl:text > </xsl:text>
</xsl:when>
<xsl:when test= "following-sibling::w:p[1][w:pPr/w:pStyle/@w:val = 'BoxBody']" >
<xsl:text > > ``` > </xsl:text>
</xsl:when>
<xsl:otherwise >
2022-09-13 15:54:25 +00:00
<xsl:text > > ``` </xsl:text>
2022-09-13 14:54:59 +00:00
</xsl:otherwise>
</xsl:choose>
</xsl:template>
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'CodeSingle']" >
<xsl:text > ``` </xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > ``` </xsl:text>
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'Caption' or @w:val = 'TableTitle' or @w:val = 'Caption1' or @w:val = 'Listing' or @w:val = 'CodeListingCaption']]" >
2022-09-13 16:22:20 +00:00
<xsl:text > Listing </xsl:text>
<xsl:value-of select= "$chapternumber" />
<xsl:text > -</xsl:text>
<xsl:number level= "any" count= "w:p[w:pPr/w:pStyle[@w:val = 'Caption' or @w:val = 'TableTitle' or @w:val = 'Caption1' or @w:val = 'Listing' or @w:val = 'CodeListingCaption']]" />
<xsl:text > : </xsl:text>
2018-04-05 17:25:59 +00:00
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-09-13 15:01:40 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BlockQuote' or @w:val = 'QuotePara']]" >
2018-04-05 17:25:59 +00:00
<xsl:text > > </xsl:text>
<xsl:apply-templates select= "*" />
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BoxTitle']]" >
<xsl:text > > ### </xsl:text>
<xsl:apply-templates select= "*" />
2022-09-06 01:42:17 +00:00
<xsl:text > > </xsl:text>
2022-07-15 00:12:02 +00:00
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle[@w:val = 'BlockText' or @w:val = 'BoxBody']]" >
2018-04-05 17:25:59 +00:00
<xsl:text > > </xsl:text>
<xsl:apply-templates select= "*" />
2022-09-09 23:46:05 +00:00
<xsl:choose >
2022-09-13 15:12:37 +00:00
<xsl:when test= "following-sibling::w:p[1][w:pPr/w:pStyle/@w:val = 'BlockText' or w:pPr/w:pStyle/@w:val = 'BoxBody' or w:pPr/w:pStyle/@w:val = 'BoxListBullet' or w:pPr/w:pStyle/@w:val = 'BoxCode' or w:pPr/w:pStyle/@w:val = 'BoxRunInHead']" >
2022-09-09 23:46:05 +00:00
<xsl:text > > </xsl:text>
</xsl:when>
<xsl:otherwise >
<xsl:text > </xsl:text>
</xsl:otherwise>
</xsl:choose>
2018-04-05 17:25:59 +00:00
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'Note']" >
2022-09-05 19:16:09 +00:00
<xsl:text > > Note: </xsl:text>
2018-04-05 17:25:59 +00:00
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-09-05 19:16:09 +00:00
<xsl:template match= "w:r[w:rPr/w:rStyle/@w:val = 'NoteHead']" />
2018-04-05 17:25:59 +00:00
2022-08-30 00:05:40 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'RunInHead']" >
2022-09-13 15:17:31 +00:00
<xsl:text > * **</xsl:text>
2022-08-30 00:05:40 +00:00
<xsl:apply-templates select= "*" />
2022-09-13 15:17:31 +00:00
<xsl:text > **: </xsl:text>
2022-08-30 00:05:40 +00:00
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'RunInPara']" >
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
2022-09-13 15:07:41 +00:00
<xsl:if test= "following-sibling::w:p[1][w:pPr/w:pStyle/@w:val != 'RunInHead']" >
<xsl:text > </xsl:text>
</xsl:if>
2022-08-30 00:05:40 +00:00
</xsl:template>
2022-09-06 15:03:53 +00:00
2022-09-13 15:12:37 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BoxRunInHead']" >
<xsl:text > > * **</xsl:text>
<xsl:apply-templates select= "*" />
<xsl:text > **: </xsl:text>
</xsl:template>
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'BoxRunInPara']" >
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
<xsl:if test= "following-sibling::w:p[1][w:pPr/w:pStyle/@w:val != 'BoxRunInHead']" >
<xsl:text > > </xsl:text>
</xsl:if>
</xsl:template>
2022-09-09 23:57:06 +00:00
<xsl:template match= "w:p[w:pPr/w:pStyle/@w:val = 'CaptionLine']" >
2022-09-13 16:34:49 +00:00
<xsl:text > Figure </xsl:text>
<xsl:value-of select= "$chapternumber" />
<xsl:text > -</xsl:text>
<xsl:number level= "any" count= "w:p[w:pPr/w:pStyle/@w:val = 'CaptionLine']" />
<xsl:text > : </xsl:text>
2022-09-09 23:57:06 +00:00
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
2022-09-06 15:03:53 +00:00
<xsl:template match= "w:tbl" >
<xsl:apply-templates select= "*" />
<xsl:text > </xsl:text>
</xsl:template>
<xsl:template match= "w:tr[.//w:pStyle/@w:val = 'TableHeader']" >
<xsl:apply-templates select= "*" />
<xsl:text > | </xsl:text>
<xsl:for-each select= "w:tc" >
<xsl:text > |---</xsl:text>
</xsl:for-each>
<xsl:text > | </xsl:text>
</xsl:template>
<xsl:template match= "w:tr" >
<xsl:apply-templates select= "*" />
<xsl:text > | </xsl:text>
</xsl:template>
<xsl:template match= "w:tc" >
<xsl:text > | </xsl:text>
<xsl:apply-templates select= ".//w:r" />
<xsl:text > </xsl:text>
</xsl:template>
2022-08-30 00:05:40 +00:00
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:p" >
Unmatched: <xsl:value-of select= "w:pPr/w:pStyle/@w:val" />
<xsl:text >
</xsl:text>
</xsl:template>
<!-- Character styles -->
<xsl:template match= "w:r[w:rPr/w:rStyle[@w:val = 'Literal' or @w:val = 'LiteralBold' or @w:val = 'LiteralCaption' or @w:val = 'LiteralBox']]" >
<xsl:choose >
<xsl:when test= "normalize-space(w:t) != ''" >
<xsl:if test= "starts-with(w:t, ' ')" >
<xsl:text > </xsl:text>
</xsl:if>
2022-09-06 13:19:29 +00:00
<xsl:if test= "not(preceding-sibling::*[1][self::w:r]) or preceding-sibling::w:r[1][not(w:rPr/w:rStyle/@w:val = 'Literal') and not(w:rPr/w:rStyle/@w:val = 'LiteralBold') and not(w:rPr/w:rStyle/@w:val = 'LiteralCaption') and not(w:rPr/w:rStyle/@w:val = 'LiteralBox')]" >
2022-09-05 18:58:47 +00:00
<xsl:text > `</xsl:text>
</xsl:if>
2018-04-05 17:25:59 +00:00
<xsl:value-of select= "normalize-space(w:t)" />
2022-09-06 13:19:29 +00:00
<xsl:if test= "not(following-sibling::*[1][self::w:r]) or following-sibling::w:r[1][not(w:rPr/w:rStyle/@w:val = 'Literal') and not(w:rPr/w:rStyle/@w:val = 'LiteralBold') and not(w:rPr/w:rStyle/@w:val = 'LiteralCaption') and not(w:rPr/w:rStyle/@w:val = 'LiteralBox')]" >
2022-09-05 18:58:47 +00:00
<xsl:text > `</xsl:text>
</xsl:if>
2018-04-05 17:25:59 +00:00
<xsl:if test= "substring(w:t, string-length(w:t)) = ' '" >
<xsl:text > </xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test= "normalize-space(w:t) != w:t and w:t != ''" >
<xsl:text > </xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:r[w:rPr/w:rStyle[@w:val = 'EmphasisBold' or @w:val = 'Bold']]" >
2018-04-05 17:25:59 +00:00
<xsl:choose >
<xsl:when test= "normalize-space(w:t) != ''" >
<xsl:if test= "starts-with(w:t, ' ')" >
<xsl:text > </xsl:text>
</xsl:if>
<xsl:text > **</xsl:text>
<xsl:value-of select= "normalize-space(w:t)" />
<xsl:text > **</xsl:text>
<xsl:if test= "substring(w:t, string-length(w:t)) = ' '" >
<xsl:text > </xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test= "normalize-space(w:t) != w:t and w:t != ''" >
<xsl:text > </xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
2022-07-14 00:47:46 +00:00
<xsl:template match= "w:r[w:rPr/w:rStyle[@w:val = 'EmphasisItalic' or @w:val = 'EmphasisItalicBox' or @w:val = 'EmphasisNote' or @w:val = 'EmphasisRevCaption' or @w:val = 'EmphasisRevItal' or @w:val = 'Italic' or @w:val = 'LinkURL']]" >
2018-04-05 17:25:59 +00:00
<xsl:choose >
2022-09-06 14:51:22 +00:00
<xsl:when test= "w:t and normalize-space(w:t) != ''" >
2018-04-05 17:25:59 +00:00
<xsl:if test= "starts-with(w:t, ' ')" >
<xsl:text > </xsl:text>
</xsl:if>
2022-09-06 14:51:22 +00:00
<xsl:if test= "not(preceding-sibling::*[1][self::w:r]) or preceding-sibling::w:r[1][not(w:t) or not(w:rPr/w:rStyle/@w:val = 'EmphasisItalic') and not(w:rPr/w:rStyle/@w:val = 'EmphasisItalicBox') and not(w:rPr/w:rStyle/@w:val = 'EmphasisNote') and not(w:rPr/w:rStyle/@w:val = 'EmphasisRevCaption') and not(w:rPr/w:rStyle/@w:val = 'EmphasisRevItal') and not(w:rPr/w:rStyle/@w:val = 'Italic') and not(w:rPr/w:rStyle/@w:val = 'LinkURL')]" >
2022-09-06 01:59:23 +00:00
<xsl:text > *</xsl:text>
</xsl:if>
2018-04-05 17:25:59 +00:00
<xsl:value-of select= "normalize-space(w:t)" />
2022-09-06 01:59:23 +00:00
2022-09-06 14:51:22 +00:00
<xsl:if test= "not(following-sibling::*[1][self::w:r]) or following-sibling::w:r[1][not(w:t) or not(w:rPr/w:rStyle/@w:val = 'EmphasisItalic') and not(w:rPr/w:rStyle/@w:val = 'EmphasisItalicBox') and not(w:rPr/w:rStyle/@w:val = 'EmphasisNote') and not(w:rPr/w:rStyle/@w:val = 'EmphasisRevCaption') and not(w:rPr/w:rStyle/@w:val = 'EmphasisRevItal') and not(w:rPr/w:rStyle/@w:val = 'Italic') and not(w:rPr/w:rStyle/@w:val = 'LinkURL')]" >
2022-09-06 01:59:23 +00:00
<xsl:text > *</xsl:text>
</xsl:if>
2018-04-05 17:25:59 +00:00
<xsl:if test= "substring(w:t, string-length(w:t)) = ' '" >
<xsl:text > </xsl:text>
</xsl:if>
</xsl:when>
2022-09-06 14:51:22 +00:00
<xsl:when test= "w:t" >
2018-04-05 17:25:59 +00:00
<xsl:text > </xsl:text>
2022-09-06 14:51:22 +00:00
</xsl:when>
2018-04-05 17:25:59 +00:00
</xsl:choose>
</xsl:template>
2022-07-15 00:12:02 +00:00
<xsl:template match= "w:r[w:rPr/w:rStyle[@w:val = 'CodeAnnotation']]" >
<xsl:choose >
<xsl:when test= "normalize-space(w:t) != ''" >
<xsl:if test= "starts-with(w:t, ' ')" >
<xsl:text > </xsl:text>
</xsl:if>
<xsl:text > [</xsl:text>
<xsl:value-of select= "normalize-space(w:t)" />
<xsl:text > ]</xsl:text>
<xsl:if test= "substring(w:t, string-length(w:t)) = ' '" >
<xsl:text > </xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise >
<xsl:text > </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
2022-09-06 15:23:42 +00:00
<xsl:template match= "w:r[w:rPr/w:rStyle[@w:val = 'Superscript']]" >
<xsl:if test= "not(preceding-sibling::*[1][self::w:r]) or preceding-sibling::w:r[1][not(w:t) or not(w:rPr/w:rStyle/@w:val = 'Superscript')]" >
<xsl:text > < sup></xsl:text>
</xsl:if>
<xsl:value-of select= "w:t" />
<xsl:if test= "not(following-sibling::*[1][self::w:r]) or following-sibling::w:r[1][not(w:t) or not(w:rPr/w:rStyle/@w:val = 'Superscript')]" >
<xsl:text > < /sup></xsl:text>
</xsl:if>
</xsl:template>
2018-04-05 17:25:59 +00:00
<xsl:template match= "w:r" >
<xsl:value-of select= "w:t" />
</xsl:template>
</xsl:stylesheet>