XSL 单词引用更改

XSL word citation change

我找到了适用于 Word 2010 的 *.xsl 引文模板。这几乎就是我需要的,我只需要做一些更改。

首先它显示在输出中,例如[Str17] 但它应该显示 [STR-17] 此外,它显示参考书目不在 table 中,标签和条目之间有一个选项卡。

例如

looks like that

但我需要

I need that format

我无法根据需要调整 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>

我试图在这部分添加 - 但它只在开头或结尾显示连字符。将字母改为大写字母对我来说仍然很神奇。找不到相关部分。

对于第二部分,我将上传文件,因为它很长而且我不想 post 整个代码。无法在工作中完成,因为我的公司阻止了上传的所有可能性。

首先我会推荐你​​使用模板,例如:

<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)"/>
  • 要插入表格,请使用如下代码:

    文本 文本

如果您希望得到更好的答案,请post一些可读代码