sharepoint 2010 XsltListViewWebPart Inside (1)
xsltListView中的的联接和投影
创建两个List, 建立Lookup关系
联接:具体看MSDN
<Joins>
<Join Type='LEFT' ListAlias='Sections'>
<Eq>
<FieldRef Name='SectionName' RefType='Id'/>
<FieldRef List='Sections' Name='Id'/>
</Eq>
</Join>
</Joins>
投影:具体看MSDN
<ProjectedFields>
<Field
Name='SectionIcon'
Type='Lookup'
List='Sections'
ShowField='IconUrl'/>
</projectedFields>
ShowFiled是Sections List中的FiledName, Name才是ViewFields所要显示的名称
<View> <Query> <Where> <Eq> <FieldRef Name="SectionName"/> <Value Type="Text">Manage</Value> </Eq> </Where> </Query> <Joins> <Join Type='LEFT' ListAlias='Sections'> <Eq> <FieldRef Name='SectionName' RefType='Id'/> <FieldRef List='Sections' Name='Id'/> </Eq> </Join> </Joins> <ProjectedFields> <Field Name='SectionIcon' Type='Lookup' List='Sections' ShowField='IconUrl'/> </ProjectedFields> <ViewFields> <FieldRef Name="Title"/> <FieldRef Name="SectionName"/> <FieldRef Name="SectionIcon"/> </ViewFields> <RowLimit Paged="TRUE">5</RowLimit> <Aggregations Value="On"/> <Toolbar Type="Full"/> </View>