xsl-list
[Top] [All Lists]

Re: [xsl] Do some elements contain strings from other elements?

2011-01-27 09:20:15
On 27 January 2011 15:12, W Charlton <XSLList(_at_)ymonda(_dot_)net> wrote:

I have what appears a simple compare() problem.

I have the following XML.
<XML>
           <SplitNameList>
                       <SplitName>
                                   <GivenName>ANDREW</GivenName>
                                   <FamilyName>SMITH</FamilyName>
                       </SplitName>
                       <SplitName>
                                   <GivenName>DONALD</GivenName>
                                   <FamilyName>DUCK</FamilyName>
                       </SplitName>
           </SplitNameList>
           <FulNameList>
                       <FullName>DAVID JONES</FullName>
                       <FullName>ANDREW J SMITH</FullName>
                       <FullName>JOHN SMITH</FullName>
           </FulNameList>
</XML>

I need to know if any of the Family Names match in the two lists. Either of 
these two lists could be quite long and this is in the middle of a load of 
logic. All I need here is a True/False. It doesn’t have to be an exact match 
just as long as it matches the FamilyName.

Sadly I am restricted to XSL 1

It's not clear what you are asking - are you saying return true if any
of the <FamilyName>s are contained in the <FullName>s ?  So in the
above, because SMITH is in at least one of the <FullName>s, then it
should return true.



-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--