[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT 2 I have a for-each, When there is only 1 in
OK I just received new information on What I need here. I just want the primary consumer initials. <sf:Consumers__r> <done>true</done> <queryLocator xsi:nil="true"/> <records xsi:type="sf:RelatedConsumer_GCC__c"> <sf:Id xsi:nil="true"/> <sf:ConsumerLevel_GCC__c>Primary</sf:ConsumerLevel_GCC__c> <sf:Consumer_GCC__c>0033L00000RnKjGQAV</sf:Consumer_GCC__c> <sf:Consumer_GCC__r xsi:type="sf:Contact"> <sf:Id xsi:nil="true"/> <sf:Email></sf:Email> <sf:FirstName>Firsta</sf:FirstName> <sf:LastName>Lasta</sf:LastName> <sf:MailingCity></sf:MailingCity> <sf:MailingCountry></sf:MailingCountry> <sf:MailingPostalCode></sf:MailingPostalCode> <sf:MailingState></sf:MailingState> <sf:MailingStreet></sf:MailingStreet> <sf:Name></sf:Name> <sf:NoFurtherContactInformationProvided_GCC__c>false</sf:NoFurthe rContactInformationProvided_GCC__c> </sf:Consumer_GCC__r> <sf:CustomerType_GCC__c>Consumer</sf:CustomerType_GCC__c> <sf:Name></sf:Name> </records> <records xsi:type="sf:RelatedConsumer_GCC__c"> <sf:Id xsi:nil="true"/> <sf:ConsumerLevel_GCC__c>Secondary</sf:ConsumerLevel_GCC__c> <sf:Consumer_GCC__c>0033L00000UPnlWQAT</sf:Consumer_GCC__c> <sf:Consumer_GCC__r xsi:type="sf:Contact"> <sf:Id xsi:nil="true"/> <sf:Email></sf:Email> <sf:FirstName>Firstb</sf:FirstName> <sf:LastName>Lastb</sf:LastName> <sf:MailingCity></sf:MailingCity> <sf:MailingCountry></sf:MailingCountry> <sf:MailingPostalCode></sf:MailingPostalCode> <sf:MailingState></sf:MailingState> <sf:MailingStreet></sf:MailingStreet> <sf:Name></sf:Name> <sf:NoFurtherContactInformationProvided_GCC__c>false</sf:NoFurthe rContactInformationProvided_GCC__c> <sf:Phone></sf:Phone> </sf:Consumer_GCC__r> <sf:CustomerType_GCC__c>Consumer</sf:CustomerType_GCC__c> <sf:Name></sf:Name> </records> <size>2</size> </sf:Consumers__r> From: Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, July 5, 2023 10:01 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [EXTERNAL] Re: XSLT 2 I have a for-each, When there is only 1 instance You haven't shown your source document and it's not at all clear what your question is, but an absolute path inside a for-each xsl:when test="/records/... is always a danger signal because your're testing a condition that' doesn't depend on which element in the iteration is being processed. Michael Kay Saxonica On 5 Jul 2023, at 14:51, LEGAULT, PHILLIP plegault@xxxxxxxxxx<mailto:plegault@xxxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx rytech.com>> wrote: 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<http://www.mulberrytech.com/xsl/xsl-list> EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/293509> (by email)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|