某些版本的 word 上不显示参考书目样式
Bibliography styles don't show on some versions of word
下午好。
我正在为 Word 做一些自定义书目样式。问题是代码确实在 Windows 的 2016 Word 和 Mac 的另一个版本的 office 365 中出现并起作用。但它们没有出现在我试用过的其他两本 Mac 书籍中,这两本书也都使用 Office 365。 (一开始我以为是Mac的文件权限问题,但这并没有解决问题https://answers.microsoft.com/en-us/mac/forum/macoffice2016-macword/word-2016-for-mac-os-x-yosemite-numeric/200b578a-4007-4226-aad6-8132e2958298)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
xmlns:t="http://www.microsoft.com/temp">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="*" mode="outputHtml2">
<xsl:apply-templates mode="outputHtml"/>
</xsl:template>
<!--Match the root element, and dispatch to its children-->
<xsl:template match="/">
<xsl:apply-templates select="*" />
<xsl:choose>
<xsl:when test="b:Version">
<xsl:text>2019.9.29</xsl:text>
</xsl:when>
<xsl:when test="b:XslVersion">
<xsl:text>4</xsl:text>
</xsl:when>
<xsl:when test="b:StyleNameLocalized">
<xsl:choose>
<xsl:when test="b:StyleNameLocalized/b:Lcid='1033'">
<xsl:text>David Teste</xsl:text>
</xsl:when>
<xsl:when test="b:StyleNameLocalized/b:Lcid='2070'">
<xsl:text>David Teste</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<xsl:variable name="book_Title">
<xsl:value-of select="(b:Title)" />
</xsl:variable>
</xsl:template>
<xsl:template match="b:GetImportantFields[b:SourceType = 'Book']">
<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:ShortTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Publisher</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Edition</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Pages</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
<xsl:template match="b:GetImportantFields[b:SourceType = 'BookSection']">
<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:ShortTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:BookTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Publisher</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Edition</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Pages</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Comments</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
<xsl:template match="b:GetImportantFields[b:SourceType = 'ArticleInAPeriodical']">
<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:ShortTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:PeriodicalTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Edition</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Month</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Pages</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Comments</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
<!--Label the paragraph as an Office Bibliography paragraph-->
<xsl:template match="b:Source[b:SourceType = 'Book']">
<xsl:if test = "string-length(b:Tag) >= 9">
<p>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
</span>
<xsl:text> </xsl:text>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
</span>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="b:Source[b:SourceType = 'BookSection']">
<!--Label the paragraph as an Office Bibliography paragraph-->
<xsl:if test = "string-length(b:Tag) >= 9">
<p>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
</span>
<xsl:text> </xsl:text>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
</span>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Comments"/>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="b:Source[b:SourceType = 'ArticleInAPeriodical']">
<xsl:if test = "string-length(b:Tag) >= 9">
<p>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
</span>
<xsl:text> </xsl:text>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
</span>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:Title"/>
<xsl:text>", </xsl:text>
<i>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:PeriodicalTitle"/>
</span>
</i>
<xsl:text>, n.º </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Month"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Comments"/>
</p>
</xsl:if>
</xsl:template>
<!--FINISH Label the paragraph as an Office Bibliography paragraph-->
<xsl:template match="b:Bibliography">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<xsl:apply-templates select ="b:Source[b:SourceType = 'Book' or b:SourceType = 'BookSection' or b:SourceType = 'ArticleInAPeriodical']">
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'Book']">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<xsl:if test = "9 > string-length(b:Tag)">
<!-- Defines the output format as (Author, Year)-->
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:ShortTitle"/>
<xsl:text>..., </xsl:text>
<xsl:text>ob. cit.</xsl:text>
</i>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
<xsl:if test = "string-length(b:Tag) >= 9">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
</body>
</html>
</xsl:template>
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'BookSection']">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<xsl:if test = "9 > string-length(b:Tag)">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:ShortTitle"/>
<xsl:text>...", </xsl:text>
<i>
<xsl:text>ob. cit.</xsl:text>
</i>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
<xsl:if test = "string-length(b:Tag) >= 9">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:Title"/>
<xsl:text>", </xsl:text>
<i>
<xsl:value-of select="b:BookTitle"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
</body>
</html>
</xsl:template>
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'ArticleInAPeriodical']">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<!-- Defines the output format as (Author, Year)-->
<xsl:if test = "9 > string-length(b:Tag)">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:ShortTitle"/>
<xsl:text>...", </xsl:text>
<i>
<xsl:text>ob. cit.</xsl:text>
</i>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
<xsl:if test = "string-length(b:Tag) >= 9">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:Title"/>
<xsl:text>", </xsl:text>
<i>
<xsl:value-of select="b:PeriodicalTitle"/>
</i>
<xsl:text>, n.º </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Month"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
</body>
</html>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>
这是代码。
有没有人有过类似的经历?有人可以帮忙吗?
谢谢。
对于 Mac 上的当前 (2016/2019) Word 版本(我的版本是 v. 16.29 (19090802)),例如在
之后
<xsl:when test="b:Version">
<xsl:text>2019.9.29</xsl:text>
</xsl:when>
您需要插入如下代码:
<xsl:when test="b:OfficeStyleKey">
<xsl:text>David Teste</xsl:text>
</xsl:when>
从 Windows 上的 2010 版 Office 开始,似乎不需要进行该测试。我很惊讶它在 Mac 上仍然需要,因为另一个主要的 Mac-specific 参考书目功能(不同的脚注引用)似乎已被删除。您可能拥有比我更新的 Mac Word 版本,您不需要该代码,但您也有 2011 版本的副本,可能仍然需要它。
注意,在此版本的 Word 中,这些参考书目样式 .xsl 文件的正确文件夹似乎是
~/Library/Group Containers/UBF8T346G9.Office/User Content/Citations
(“~”表示顶级用户文件夹,例如 /Macintosh HD/Users/myusername)
下午好。
我正在为 Word 做一些自定义书目样式。问题是代码确实在 Windows 的 2016 Word 和 Mac 的另一个版本的 office 365 中出现并起作用。但它们没有出现在我试用过的其他两本 Mac 书籍中,这两本书也都使用 Office 365。 (一开始我以为是Mac的文件权限问题,但这并没有解决问题https://answers.microsoft.com/en-us/mac/forum/macoffice2016-macword/word-2016-for-mac-os-x-yosemite-numeric/200b578a-4007-4226-aad6-8132e2958298)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
xmlns:t="http://www.microsoft.com/temp">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="*" mode="outputHtml2">
<xsl:apply-templates mode="outputHtml"/>
</xsl:template>
<!--Match the root element, and dispatch to its children-->
<xsl:template match="/">
<xsl:apply-templates select="*" />
<xsl:choose>
<xsl:when test="b:Version">
<xsl:text>2019.9.29</xsl:text>
</xsl:when>
<xsl:when test="b:XslVersion">
<xsl:text>4</xsl:text>
</xsl:when>
<xsl:when test="b:StyleNameLocalized">
<xsl:choose>
<xsl:when test="b:StyleNameLocalized/b:Lcid='1033'">
<xsl:text>David Teste</xsl:text>
</xsl:when>
<xsl:when test="b:StyleNameLocalized/b:Lcid='2070'">
<xsl:text>David Teste</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<xsl:variable name="book_Title">
<xsl:value-of select="(b:Title)" />
</xsl:variable>
</xsl:template>
<xsl:template match="b:GetImportantFields[b:SourceType = 'Book']">
<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:ShortTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Publisher</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Edition</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Pages</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
<xsl:template match="b:GetImportantFields[b:SourceType = 'BookSection']">
<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:ShortTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:BookTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Publisher</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Edition</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Pages</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Comments</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
<xsl:template match="b:GetImportantFields[b:SourceType = 'ArticleInAPeriodical']">
<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:ShortTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:PeriodicalTitle</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Edition</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Month</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Pages</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Comments</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
<!--Label the paragraph as an Office Bibliography paragraph-->
<xsl:template match="b:Source[b:SourceType = 'Book']">
<xsl:if test = "string-length(b:Tag) >= 9">
<p>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
</span>
<xsl:text> </xsl:text>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
</span>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="b:Source[b:SourceType = 'BookSection']">
<!--Label the paragraph as an Office Bibliography paragraph-->
<xsl:if test = "string-length(b:Tag) >= 9">
<p>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
</span>
<xsl:text> </xsl:text>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
</span>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Comments"/>
</p>
</xsl:if>
</xsl:template>
<xsl:template match="b:Source[b:SourceType = 'ArticleInAPeriodical']">
<xsl:if test = "string-length(b:Tag) >= 9">
<p>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
</span>
<xsl:text> </xsl:text>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
</span>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:Title"/>
<xsl:text>", </xsl:text>
<i>
<span style='text-transform: uppercase;'>
<xsl:value-of select="b:PeriodicalTitle"/>
</span>
</i>
<xsl:text>, n.º </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Month"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Comments"/>
</p>
</xsl:if>
</xsl:template>
<!--FINISH Label the paragraph as an Office Bibliography paragraph-->
<xsl:template match="b:Bibliography">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<xsl:apply-templates select ="b:Source[b:SourceType = 'Book' or b:SourceType = 'BookSection' or b:SourceType = 'ArticleInAPeriodical']">
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'Book']">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<xsl:if test = "9 > string-length(b:Tag)">
<!-- Defines the output format as (Author, Year)-->
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:ShortTitle"/>
<xsl:text>..., </xsl:text>
<xsl:text>ob. cit.</xsl:text>
</i>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
<xsl:if test = "string-length(b:Tag) >= 9">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
</body>
</html>
</xsl:template>
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'BookSection']">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<xsl:if test = "9 > string-length(b:Tag)">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:ShortTitle"/>
<xsl:text>...", </xsl:text>
<i>
<xsl:text>ob. cit.</xsl:text>
</i>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
<xsl:if test = "string-length(b:Tag) >= 9">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:Title"/>
<xsl:text>", </xsl:text>
<i>
<xsl:value-of select="b:BookTitle"/>
<xsl:text>, </xsl:text>
</i>
<xsl:value-of select="b:Publisher"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>.ª ed., </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
</body>
</html>
</xsl:template>
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'ArticleInAPeriodical']">
<html xmlns="https://www.w3.org/TR/REC-html40">
<body>
<!-- Defines the output format as (Author, Year)-->
<xsl:if test = "9 > string-length(b:Tag)">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:ShortTitle"/>
<xsl:text>...", </xsl:text>
<i>
<xsl:text>ob. cit.</xsl:text>
</i>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
<xsl:if test = "string-length(b:Tag) >= 9">
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Middle"/>
<xsl:text> </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, "</xsl:text>
<xsl:value-of select="b:Title"/>
<xsl:text>", </xsl:text>
<i>
<xsl:value-of select="b:PeriodicalTitle"/>
</i>
<xsl:text>, n.º </xsl:text>
<xsl:value-of select="b:Edition"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Month"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>, pp. </xsl:text>
<xsl:value-of select="b:Pages"/>
</xsl:if>
</body>
</html>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>
这是代码。
有没有人有过类似的经历?有人可以帮忙吗? 谢谢。
对于 Mac 上的当前 (2016/2019) Word 版本(我的版本是 v. 16.29 (19090802)),例如在
之后 <xsl:when test="b:Version">
<xsl:text>2019.9.29</xsl:text>
</xsl:when>
您需要插入如下代码:
<xsl:when test="b:OfficeStyleKey">
<xsl:text>David Teste</xsl:text>
</xsl:when>
从 Windows 上的 2010 版 Office 开始,似乎不需要进行该测试。我很惊讶它在 Mac 上仍然需要,因为另一个主要的 Mac-specific 参考书目功能(不同的脚注引用)似乎已被删除。您可能拥有比我更新的 Mac Word 版本,您不需要该代码,但您也有 2011 版本的副本,可能仍然需要它。
注意,在此版本的 Word 中,这些参考书目样式 .xsl 文件的正确文件夹似乎是
~/Library/Group Containers/UBF8T346G9.Office/User Content/Citations
(“~”表示顶级用户文件夹,例如 /Macintosh HD/Users/myusername)