我已经为Word 2010找到了一个*.xsl引文模板。这几乎是我所需要的,我只需要做一些改变。
首先,它显示在输出中,例如Str17,但它应该进一步显示STR-17,它显示的是书目,而不是在标签和条目之间有标签的表中。
例如:
但我需要
我只是不能根据我的需要调整xsl。我已经尝试了一段时间,并试图找到任何其他的xsl文件,但没有任何进展。这种引文在工程中很常见,所以我相信我不是唯一一个寻找解决办法的人。
关于标签的样式,我认为第一部分的相关代码是:
<xsl:if test="msxsl:node-set($ListPopulatedWithMain)/b:Citation/b:FirstAuthor">
<!-- hier wird die Klammer [ angezeigt -->
<xsl:call-template name="templ_prop_ISO690_GeneralOpen"/>
</xsl:if>
<xsl:if test="msxsl:node-set($ListPopulatedWithMain)/b:Citation/b:PagePrefix">
<xsl:value-of select="/b:Citation/b:PagePrefix"/>
</xsl:if>
<!-- <xsl:value-of select="$displayAuthor" /> nicht den Author anzeigen sondern den Tag-->
<xsl:value-of select="msxsl:node-set($ListPopulatedWithMain)/b:Citation/b:Source/b:Tag" />
<xsl:if test="string-length($displayTitle) > 0">
<xsl:if test="string-length($displayAuthor) > 0">
<xsl:call-template name="templ_prop_ListSeparator"/>
</xsl:if>
<xsl:value-of select="$displayTitle"/>
</xsl:if>
<xsl:if test="string-length($year) > 0">
<xsl:if test="string-length($displayTitle) > 0">
<xsl:call-template name="templ_prop_ListSeparator"/>
</xsl:if>
<!-- <xsl:value-of select="$year"/> nicht das Jahr anzeigen lassen -->
</xsl:if>
<xsl:if test="string-length($author0) = 0 and string-length($title0) = 0 and string-length($year0) = 0">
<xsl:value-of select="msxsl:node-set($ListPopulatedWithMain)/b:Citation/b:Source/b:Tag"/>
</xsl:if>
<xsl:if test="string-length($volume) > 0 or string-length($pages) > 0">
<xsl:if test="string-length($displayAuthor) > 0 or string-length($displayTitle) > 0 or string-length($year) > 0">
<xsl:call-template name="templ_prop_Space"/>
</xsl:if>
<xsl:choose>
<xsl:when test="string-length($volume) > 0 and string-length($pages) > 0">
<xsl:value-of select="$volume"/>
<xsl:call-template name="templ_prop_Enum"/>
<xsl:value-of select="$pages"/>
</xsl:when>
<xsl:when test="string-length($volVolume) > 0">
<xsl:value-of select="$volVolume"/>
</xsl:when>
<xsl:when test="string-length($ppPages) > 0">
<xsl:value-of select="$ppPages"/>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="/b:Citation/b:PageSuffix">
<xsl:value-of select="/b:Citation/b:PageSuffix"/>
</xsl:if>
<xsl:if test="/b:Citation/b:LastAuthor">
<!-- hier wird die Klammer ] angezeigt -->
<xsl:call-template name="templ_prop_ISO690_GeneralClose"/>
</xsl:if>
<xsl:if test="not(/b:Citation/b:LastAuthor)">
<xsl:call-template name="templ_prop_GroupSeparator"/>
</xsl:if>我试着添加-在这部分,但它只是显示连字符在开头或结尾。对我来说,把字母改成大写还是很神奇的。找不到相关的部分。
对于第二部分,我将上传文件,因为它是相当长的,我不想张贴整个代码。无法从工作中做到这一点,因为所有上传的可能性都被我的公司屏蔽了。
发布于 2017-10-27 10:59:41
首先,我建议您使用模板,例如:
<xsl:template name="Citation">
<xsl:apply-templates/>
</xsl:template>
<xsl:template name="FirstAuthor">
<xsl:call-template name="templ_prop_ISO690_GeneralOpen"/>
</xsl:template>
<xsl:template name="PagePrefix">
<xsl:value-of select="."/>
</xsl:template>
...这不是必要的,而是更好的代码样式。您的代码对我来说是不可读的,所以我将这样回答您的问题:-用于将文本转换为大写的用法。
<xsl:value-of select="upper-case(//some-xpath)"/>如果您希望得到更好的答案,请张贴一些可读的代码。
https://stackoverflow.com/questions/46973004
复制相似问题