briankavanaugh / APA-7th-Edition

Microsoft Word XSD for generating APA 7th edition references
MIT License
130 stars 28 forks source link

URL's no longer shown in the Bibliography #3

Closed lunerose closed 2 years ago

lunerose commented 2 years ago

Hi Brian! I really appreciate the work that went into the APA7 update. I've added the most recent update, and it no longer inserts the URL into the Bibliography. I'm not sure what else it misses, but in particular the URL is no longer added. Thanks for your time!

Polyglottery commented 2 years ago

Agreed, I have tracked the issue to the commented-out code from line 444 through 477, following a reply from user Jayveesac on the Microsoft forums (https://answers.microsoft.com/en-us/msoffice/forum/all/apa-7th-edition-in-ms-word/486fc70e-b7c7-40df-89bb-f8fc07169d40?page=2). This is the relevant portion:

<xsl:template name="templ_str_RetrievedFromCap" >
    <!--<xsl:param name="LCID" />
    <xsl:variable name="_LCID">
      <xsl:call-template name="localLCID">
        <xsl:with-param name="LCID" select="$LCID"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/>
    <xsl:text>Retrieved %1, from %2.</xsl:text>-->
  </xsl:template>

  <xsl:template name="templ_str_RetrievedCap" >
    <!--<xsl:param name="LCID" />
    <xsl:variable name="_LCID">
      <xsl:call-template name="localLCID">
        <xsl:with-param name="LCID" select="$LCID"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedCap"/>
    <xsl:text>Retrieved %1.</xsl:text>-->
  </xsl:template>

  <xsl:template name="templ_str_FromCap" >
    <!--<xsl:param name="LCID" />
    <xsl:variable name="_LCID">
      <xsl:call-template name="localLCID">
        <xsl:with-param name="LCID" select="$LCID"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:FromCap"/>
    <xsl:text>%2</xsl:text>-->
  </xsl:template>

I tried commenting the code back in, but then I got "Retrieved from [URL] [URL]" on my References page. Changing the text in the second-to-last line to <xsl:text>%1</xsl:text> got rid of the second URL, but "retrieved from" was still there, and modifying Retrieved %1, from %2 to %1 did not help either.

I should mention, if it was not clear already, that I have no idea what I am doing, having had only basic training in Praat and Python, and I am flying by the seat of my pants trying to mess with this hahaha. Help.

philiprein commented 2 years ago

After some trial and error I think I figured out how to show the links again. Change lines 444 to 453 to the following:

<xsl:template name="templ_str_RetrievedFromCap" >
  <!--<xsl:param name="LCID" />
  <xsl:variable name="_LCID">
    <xsl:call-template name="localLCID">
      <xsl:with-param name="LCID" select="$LCID"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/>-->
  <xsl:text>%2.</xsl:text>
</xsl:template>

This displays the links for webpages in the bibliography. However, I am also not familiar with the syntax and don't really know what other implications of this may be.

TJStar commented 2 years ago

It looks based on my testing the xsl:value-of select line , like <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/> adds the "Retrieved From" text. It seems the xsl:text field also creates a formated "Retrieved From".

My thought is remark the xsl:vale-of lines and replacement them the xsl:text lines.

Here are the examples for the three following lines: <!-- Note: removed due to issue github issue #3<xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/> --> keep <xsl:text>Retrieved %1, from %2</xsl:text> under <xsl:template name="templ_str_RetrievedFromCap" >

Remark <!-- Note: removed due to issue github issue #3<xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedCap"/> --> keep <xsl:text>Retrieved %1.</xsl:text> under <xsl:template name="templ_str_RetrievedCap" >

Remark <!-- Note: removed due to issue github issue #3<xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:FromCap"/> --> keep <xsl:text> %1 </xsl:text> under <xsl:template name="templ_str_FromCap" >

Based on the behavior as describe by https://answers.microsoft.com/en-us/msoffice/forum/all/apa-7th-edition-in-ms-word/486fc70e-b7c7-40df-89bb-f8fc07169d40?page=2

When you have the retrieval date, and the URL and/or website name: <xsl:template name="templ_str_RetrievedFromCap" >

When you have the retrieval date, but no URL and website name: `

When you have the URL and website name, but no retrieval date (the most common in APA 7th ed.): <xsl:template name="templ_str_RetrievedCap" >

The example citation I tested with is: Author: Amazon Web Services Date Created: April 28, 2022 Name of Web Page: AWS Infrastructure Event Management Support for planning and running business critical events. Name of Web Site: Amazon Web Services, Inc URL: https://aws.amazon.com/premiumsupport/programs/iem/ Date Accessed: May 2, 2022

Results: With the URL, retrieval date and website name

Amazon Web Services. (2022, April 28). AWS Infrastructure Event Management Support for planning and running business critical events. Retrieved May 2, 2022, from Amazon Web Services, Inc: https://aws.amazon.com/premiumsupport/programs/iem/

Without the URL, with a retrieval date and with the website name

Amazon Web Services. (2022, April 28). AWS Infrastructure Event Management Support for planning and running business critical events. Retrieved May 2, 2022, from Amazon Web Services, Inc.

Without the URL, with a retrieval date, and without a website name

Amazon Web Services. (2022, April 28). AWS Infrastructure Event Management Support for planning and running business critical events. Retrieved May 2, 2022.

With the URL, without the retrieval date and with the website name

Amazon Web Services. (2022, April 28). AWS Infrastructure Event Management Support for planning and running business critical events. https://aws.amazon.com/premiumsupport/programs/iem/

I have not seen any other impact while testing on my copy of Word for Office 365. I welcome other suggestions and testing.

briankavanaugh commented 2 years ago

@TJStar's pull request has been merged and a new release, 1.0.2, has been created with the changes.