基本原理:使用SharePoint提供的WebService GetUserCollectionFromGroup,根据指定的群组名称来获取群组中的用户集合。
处理过程:
输出的XML片段为
XSLT片段为:
代码
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:h="http://schemas.microsoft.com/sharepoint/soap/directory/">
<xsl:template match="/">
<xsl:for-each select="xml/h:GetGroupCollectionFromUser/h:Groups/h:Group"> <xsl:value-of select="@Name"/>;</xsl:for-each> </xsl:template>
</xsl:stylesheet>
输出地结果为:
Lui, Mingle(Microsoft);Mingle, Lu(Microsoft);
如果XSLT使用如下
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:h="http://schemas.microsoft.com/sharepoint/soap/directory/">
<xsl:template match="/">
<xsl:value-of select="xml/h:GetUserCollectionFromGroup/h:Users/h:User/@Name"/>
</xsl:template></xsl:stylesheet>
则输出结果为XML元素User的第一条记录:
Lui, Mingle(Microsoft)
代码
<xml>
<GetUserCollectionFromGroup xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<Users>
<User ID="14" Sid="S-1-5-21-1178368992-402679808-390482200-577565" Name="Lui, Mingle(Microsoft)" LoginName="Microsoft\00168" Email="Mingle.Lui@hotmail.com" Notes="" IsSiteAdmin="True" IsDomainGroup="False" />
<User ID="10" Sid="S-1-5-21-1178368992-402679808-390482200-423316" Name="Mingle.Lu(Microsoft)" LoginName="Microsoft\00169" Email="Mingle.Lui@live.com" Notes="" IsSiteAdmin="True" IsDomainGroup="False" />
</Users></GetUserCollectionFromGroup>
</xml>
流程文件下载:download