[xsl] Re: XSLT 2 I have a for-each, When there is only 1 instance

Subject: [xsl] Re: XSLT 2 I have a for-each, When there is only 1 instance
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Jul 2023 13:57:35 -0000
Hi Phillip,

This is difficult for me to follow. Can you please post a simplified XSLT (no
namespaces, no unnecessary element hierarchy, use generic values, etc.), plus
a sample input document and expected output document?

In other words, try to distill your question down to the very essence of what
you are trying to achieve, then when you have an answer, expand it back into
the context of your actual situation on your side.


  *   Chris


From: LEGAULT, PHILLIP plegault@xxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, July 5, 2023 9:51 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] XSLT 2 I have a for-each, When there is only 1 instance

XSLT 2 I have a for-each for consumer initials , When there is only 1 instance
I want to display just the 1 initials. If there are 2 I a want it to display
with PL, JL, etc.

Here is what I have:
            <reporterfamilyname><xsl:for-each
select="/records/sf:Consumers__r/records">
            <xsl:choose>
                <xsl:when
test="/records/sf:Product_GCC__r/sf:Locale_GCC__r/sf:Region_GCC__c = 'EMEA'">
                    <xsl:text>ANON</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of
select="substring(sf:Consumer_GCC__r/sf:FirstName/text(),1,1)"/><xsl:value-of
select="substring(sf:Consumer_GCC__r/sf:LastName/text(),1,1)"/>
                </xsl:otherwise>
            </xsl:choose></xsl:for-each>
             </reporterfamilyname>


XSL-List info and
archive<https://urldefense.com/v3/__http:/www.mulberrytech.com/xsl/xsl-list__
;!!A4F2R9G_pg!fTgw9EMLhf21Wpy2lgIrhQyjTOal9eeUhRMY445fCsbl8qOFCm9Khe9_FC_jpxh
MLdARRBIogeqiEYtZCz4VlfQNHDaR4q9vHgwafvhoealJ8W2vvAJT$>
EasyUnsubscribe<https://urldefense.com/v3/__http:/lists.mulberrytech.com/unsu
b/xsl-list/3380743__;!!A4F2R9G_pg!fTgw9EMLhf21Wpy2lgIrhQyjTOal9eeUhRMY445fCsb
l8qOFCm9Khe9_FC_jpxhMLdARRBIogeqiEYtZCz4VlfQNHDaR4q9vHgwafvhoealJ8f9oZ7o6$>
(by email<>)

Current Thread