Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ version="1.0">
</draw:frame>
</xsl:template>

<xsl:template match="item[@type!='hn' and @type!='variantTypes' and @type!='glsAppend']" mode="rowItems">
<xsl:template match="item[@type!='hn' and @type!='variantTypes' and @type!='glsAppend' and @type!='glsPrepend']" mode="rowItems">
<text:p>
<xsl:if test="@type='txt'">
<xsl:attribute name="text:style-name">Interlin_Morph_<xsl:value-of select="@lang"/></xsl:attribute>
Expand All @@ -209,6 +209,8 @@ version="1.0">
</xsl:template>
<xsl:template match="morph/item[@type='glsAppend']">
</xsl:template>
<xsl:template match="morph/item[@type='glsPrepend']">
</xsl:template>

<!-- This mode occurs within the 'cf' item to display the homograph number from the following item.-->
<xsl:template match="morph/item[@type='hn']" mode="hn">
Expand All @@ -218,7 +220,10 @@ version="1.0">
<text:span text:style-name="Interlin_VariantTypes"><xsl:apply-templates/></text:span>
</xsl:template>
<xsl:template match="morph/item[@type='glsAppend']" mode="glsAppend">
<text:span text:style-name="Interlin_VariantTypes"><xsl:apply-templates/></text:span>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="morph/item[@type='glsPrepend']" mode="glsPrepend">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="morph/item[@type='cf']" mode="rowItems">
Expand All @@ -240,11 +245,15 @@ version="1.0">
<xsl:template match="morph/item[@type='gls']" mode="rowItems">
<text:p>
<xsl:attribute name="text:style-name">Interlin_Morpheme_Gloss_<xsl:value-of select="@lang"/></xsl:attribute>
<xsl:variable name="glsPrepend" select="preceding-sibling::item[1][@type='glsPrepend']"/>
<xsl:if test="$glsPrepend">
<xsl:apply-templates select="$glsPrepend" mode="glsPrepend"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:variable name="glsAppend" select="following-sibling::item[1][@type='glsAppend']"/>
<xsl:if test="$glsAppend">
<xsl:apply-templates select="$glsAppend" mode="glsAppend"/>
</xsl:if>
<xsl:variable name="glsAppend" select="following-sibling::item[1][@type='glsAppend']"/>
<xsl:if test="$glsAppend">
<xsl:apply-templates select="$glsAppend" mode="glsAppend"/>
</xsl:if>
</text:p>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@
This gets invoked only for the items of the first morph of the word. We find all the corresponding items
in the other morphs (and this one) and output them as a matrix row.
The homograph number item is omitted because we don't want a separate row for these.-->
<xsl:template match="item[@type!='hn' and @type!='variantTypes' and @type!='glsAppend']" mode="rows" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
<xsl:template match="item[@type!='hn' and @type!='variantTypes' and @type!='glsAppend' and @type!='glsPrepend']" mode="rows" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
<m:mr>
<xsl:variable name="myType" select="@type"/>
<xsl:variable name="myLang" select="@lang"/>
Expand Down Expand Up @@ -721,6 +721,8 @@
</xsl:template>
<xsl:template match="morph/item[@type='glsAppend']">
</xsl:template>
<xsl:template match="morph/item[@type='glsPrepend']">
</xsl:template>

<!-- This mode occurs within the 'cf' item to display the homograph number from the following item.-->
<xsl:template match="morph/item[@type='hn']" mode="hn">
Expand All @@ -732,6 +734,9 @@
<xsl:template match="morph/item[@type='glsAppend']" mode="glsAppend">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="morph/item[@type='glsPrepend']" mode="glsPrepend">
<xsl:apply-templates/>
</xsl:template>

<!-- a special item for citation form may include the homograph number (typically as a subscript)-->
<xsl:template match="morph/item[@type='cf']" mode="rowItems" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
Expand Down Expand Up @@ -802,14 +807,17 @@
<w:rtl/>
</xsl:if>
</w:rPr>
<xsl:variable name="glsPrepend" select="preceding-sibling::item[1][@type='glsPrepend']"/>
<xsl:if test="$glsPrepend">
<m:t>
<xsl:apply-templates select="$glsPrepend" mode="glsPrepend"/>
</m:t>
</xsl:if>
<m:t>
<xsl:apply-templates/>
</m:t>
<xsl:variable name="glsAppend" select="following-sibling::item[1][@type='glsAppend']"/>
<xsl:if test="$glsAppend">
<w:rPr>
<w:rStyle w:val="Interlin Variant Types"/>
</w:rPr>
<m:t>
<xsl:apply-templates select="$glsAppend" mode="glsAppend"/>
</m:t>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,17 +811,9 @@ public void ExportIrrInflVariantTypeInformation_LT7581_glsAppend_xml2OO_multiple
//AssertThatXmlIn.Dom(transformedDocOO).HasSpecifiedNumberOfMatchesForXpath(@"/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[2]", 1);
Assert.That(transformedDocOO.SelectNodes("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[3]", nsmgr), Has.Count.EqualTo(1));
Assert.That(transformedDocOO.SelectSingleNode("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[3]", nsmgr).InnerText, Is.EqualTo("frglossgo.pst"));
Assert.That(transformedDocOO.SelectNodes("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[3]/text:span[@text:style-name='Interlin_VariantTypes']", nsmgr),
Has.Count.EqualTo(1));
Assert.That(transformedDocOO.SelectSingleNode("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[3]/text:span[@text:style-name='Interlin_VariantTypes']", nsmgr).InnerText,
Is.EqualTo(".pst"));

Assert.That(transformedDocOO.SelectNodes("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[4]", nsmgr), Has.Count.EqualTo(1));
Assert.That(transformedDocOO.SelectSingleNode("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[4]", nsmgr).InnerText, Is.EqualTo("glossgo.pst"));
Assert.That(transformedDocOO.SelectNodes("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[4]/text:span[@text:style-name='Interlin_VariantTypes']", nsmgr),
Has.Count.EqualTo(1));
Assert.That(transformedDocOO.SelectSingleNode("/office:document-content/office:body/office:text/text:p[5]/draw:frame[3]/draw:text-box/text:p[2]/draw:frame/draw:text-box/text:p[4]/text:span[@text:style-name='Interlin_VariantTypes']", nsmgr).InnerText,
Is.EqualTo(".pst"));
Assert.That(transformedDocOO.SelectNodes("//text:p[text()='.pst']", nsmgr), Has.Count.EqualTo(0));
}

Expand Down
Loading