English 中文(简体)
How to add second data source to xslt / dataview in SharePoint?
原标题:

I m trying to create a bar chart using dataview formated using xsl. The list to chart contains data about number of hours spend on certain project. The project column is of type lookup, which points to a list on the other subsite (simpler: cross site lookup column). The fist data source that I connected to dataview points to the first list.

How to add second datasource? (I know it s maybe not the best explanaition so here s some code)

<xsl:template name="dvt_1.footer">
    <xsl:param name="ParentPath" />
    <xsl:param name="Rows" />

    <xsl:variable name="Time" select="count(/dsQueryResponse/Rows/Row)" /> 
    <xsl:variable name="Projects" select="/NEED/DATA/SOURCE" />

    <table width="100%" cellspacing="0" cellpadding="2" style="border-right: 1 solid #C0C0C0; border-bottom: 1 solid #C0C0C0; border-left-style: solid; border-left-width: 1; border-top-style: solid; border-top-width: 1;">
        <xsl:for-each select="$Projects">
            <xsl:call-template name="showBar">
                <xsl:with-param name="TimeCount" select="$Time" />
                <xsl:with-param name="ColumnTitle" select="ProjectName" />
                <xsl:with-param name="ItemCount" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Project) =  ProjectName ])" />
            </xsl:call-template>
        </xsl:for-each>        
    </table>

</xsl:template>

So I need to:

  • somehow populate Projects variable
  • figure out how to use fore-each variable from new datasource in xl:with-param :P

I m completely new to xsl so it s possible there are obvious mistakes in code. Any constructive input is highly appreciated.

问题回答

Use the document() function to load and leverage an external XML file within your XSLT.

 <xsl:variable name="Projects" select="document( http://some.url.to/file.xml )/DATA" />




相关问题
SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

UI automated testing within SharePoint

I m looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and documents thought the web interface. It needs to be extensible enough to handle any custom ...

Enable authorization on sitemap provider

I want to enable Authorization on the Site map provider. We have enabled anonymous access to the site and we want the Site map provider to be visible only to authorized users. I tried ...

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...

热门标签