I am very new in my role with no XML experience at all, and we are encountering a problem with our employee directory where someone's last name starts with a lowercase letter, and is not being displayed in the correct letter list. My predecessor made separate pages for each letter of the alphabet, and it is set up to automatically pull employee names in based on what their last name begins with from an existing data feed. Unfortunately, this is only targeted toward names that start with an uppercase letter. The code that exists for each "letter" is below:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="faculty" version="1.0" xmlns:faculty="ext1" xmlns:xalan="http://xml.apache.org/xalan">
<xsl:output encoding="UTF-8" indent="yes" method="html" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
<xsl:include href="/_internal/formats/EmpDir/EmpDir.xsl"/>
<xsl:param name="alphaValue">v</xsl:param>
<xsl:template match="/">
<xsl:call-template name="Employees">
<xsl:with-param name="alphaValue"/>
</xsl:call-template>
</xsl:template>
<xsl:param name="alphaValue">V</xsl:param>
<xsl:template match="/">
<xsl:call-template name="Employees">
<xsl:with-param name="alphaValue"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Because of how the CMS works, I cannot change alphaValue in any way, so I was hoping there was some way to make a catch all for both uppercase and lowercase "V"s that would allow the names to be pulled in together.
The other linked format for EmpDir does have code that seems to catch uppercase and lowercase letters, and this person's name does pull in for the big "A-Z" list, I think it is the part where variables are set to uppercase and lowercase, but I'm not sure which line is the one that allows both to display together on the page. `
<xsl:choose>
<xsl:when test="count(//directory[starts-with(last, $alphaValue)]) > 0">
<p style="text-align: center;">There are =
<xsl:value-of select="count(//directory[starts-with(last, $alphaValue)])"/> entries.
</p>
<div style="float:right; width: calc(100% - 40px);">
<xsl:for-each select="//directory[starts-with(last, $alphaValue)]">
<xsl:sort order="ascending" select="last"/>
<xsl:sort order="ascending" select="first"/>
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="Photo">
<xsl:value-of select="translate(nmcid, $uppercase, $lowercase)"/>
<xsl:text>.jpg</xsl:text>
</xsl:variable>
`
I've tried adding in the following code snippets to no avail:
Hoped this would select both cases and translate/convert to lowercase
<!--add variables for upper and lower case to translate to lowercase -->
<xsl:variable name="lowercaseV" select="'v'"/>
<xsl:variable name="uppercaseV" select="'V'"/>
<xsl:variable name="alphaValue" select="translate(., $uppercaseV, $lowercaseV)"/>
hoped adding second param would catch the little v
<!--add secondary param for little v-->
<xsl:param name="alphaValue">v</xsl:param>
Neither of these did anything, probably because I don't fully understand how it's set up, but I am at a loss for what to do so that employees with last names like "deAngelo" or "Devine" can appear in the same auto-generated list.