Sharepoint joined sources and XSLT transformation problem.

Posted on 2011-04-21
Last Modified: 2012-05-11
In sharepoint I've joined to data sources:

Person | Key
Tom     | A6
Fred    | A7
Phil      | A6-3
Peter   | A6-2
Tim      | A2
Ross   | A2; A7

Key   | Door
A2     | Front Door
A6     | Back Door
A6-2  | Front Area
A6-3  | All Areas
A7     | Side Door

The intention is to have a joined view as such:
Key    | Door            | Persons
A2      | Front Door  | Tim, Ross
A6      | Back Door  | Tom
A6-2   | Front Area | Peter
A6-3   | All Areas   | Phil
A7      | Side Door   | Fred, Ross

if i do this:
<xsl:variable name="Rows" select="../../../Persons/Rows/Row[contains($dvt_ParentRow/@Title,@Key_x0020_Number)]" />

I get:
Key    | Door            | Persons
A2      | Front Door  | Tim, Ross
A6      | Back Door  | Tom, Phil, Peter
A6-2   | Front Area | Peter
A6-3   | All Areas   | Phil
A7      | Side Door   | Fred, Ross

Notice that A6 shows Phil and Peter. The reason I used 'contain' is so it will show Ross's name because doing a $dvt_ParentRow/@Title = @Key_x0020_Number would not show his name.

Hope this explanation works..
Question by:Alarius
    LVL 60

    Expert Comment

    by:Geert Bormans
    there might be a cast or space problem
    <xsl:variable name="Rows" select="../../../Persons/Rows/Row[normalize-space($dvt_ParentRow/@Title) = normalize-space(@Key_x0020_Number)]" />

    Author Comment

    Still the same problem. Seems like when it encounters a value separated by ; such as "A2;A7" (realized now in my original post i put a space between ; and A7) it treats it as one value. I wonder if its possible to split them then compare ?
    LVL 42

    Accepted Solution

    why not have list A structured so that there is one row per key / person combination?  Ross would have two rows, one for each key.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now