EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #07603


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] RT1/Crosswalks - multiple dates


All the "logic" should go within the test=""

The scripting terms are documented at https://wiki.eprints.org/w/EPScript and teh XML strucure at https://wiki.eprints.org/w/EPrints_Control_Format

here's the tweaks from your example to OK XML & EPScript:


</xsl:when>  test="$name='publication-date' and type='presentation_material'>presented</xsl:when>
 *            *                                                     *                                          *
<xsl:when test="$name='publication-date' and $type='presentation_material'">presented</xsl:when>

So you were close

see also <xsl:otherwise>


On 13/12/2018 06:05, James Kerwin via Eprints-tech wrote:
Hello all,

I recently noticed we had an item type in EPrints that hadn't been set up properly (Presentation Material). I have managed to add it to the crosswalks and phrases, but I have a problem that I cannot solve with the metadata.

The "Presentation Date" is sent over from the Elements "publication-date" field and so has a field name in Eprints of "Published" when I want it to say "Presented".

This is controlled via this bit of code in uol_xwalks_default.xml:

<!-- ##################### MULTIPLE DATES ##################### -->
    <xsl:template match="pubs:date" mode="mapping">
        <xsl:param name="name"/>
        <xsl:param name="repo_field"/>
        <xsl:choose>
            <xsl:when test="$repo_field = 'dates'">
                <xsl:element name="date">
                    <xsl:apply-templates select="."/>
                </xsl:element>
                <xsl:element name="date_type">
                    <xsl:choose>
<xsl:when test="$name='publication-date'">published</xsl:when>
                        <xsl:when test="$name='acceptance-date'">accepted</xsl:when>
                        <xsl:when test="$name='filed-date'">filed</xsl:when>
                        <xsl:when test="$name='online-publication-date'">published_online</xsl:when>
                    </xsl:choose>
                </xsl:element>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates select="." />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


It is the section in bold that I need to alter and add a condition to. Ideally I want to say something along the lines of:

</xsl:when>  test="$name='publication-date' and type='presentation_material'>presented</xsl:when>

but I'm struggling to access the item type. I'm also uncertain as to whether the type should be the EPrint field name that was set in another crosswalks file, or if I should be using some other nomenclature. Complicated further by searching "type" and getting millions of results.

This isn't particularly urgent or even essential, but if anybody has some advice I'd appreciate it.

Thanks,
James


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/

-- 
Christopher Gutteridge <totl@soton.ac.uk> 
You should read our team blog at http://blog.soton.ac.uk/webteam/