0

我需要在 XElement 中获取 SPWeb.Groups.Xml 来创建 XDocument。

      SPSite site = new SPSite(url);
        foreach (SPWeb web in site.AllWebs)
        {
            SPUserCollection spusers = site.RootWeb.SiteUsers;
            XElement xeGroup = new XElement("Groups");
            xeGroup =  new XElement(web.Groups.Xml);} 

目前我收到错误,因为“'<' 字符,十六进制值 0x3C,不能包含在名称中。”,

请建议解决方法或正确的方法来检索信息。

谢谢你的帮助。

4

1 回答 1

0

我的解决方案,不是很优雅......

SPSite site = new SPSite(url);
    foreach (SPWeb web in site.AllWebs)
    {
            XElement xeGroup = new XElement("Groups");
            xd.LoadXml(web.Groups.Xml);
            xeGroup = XElement.Load(new XmlNodeReader(xd));
于 2016-05-24T18:08:40.097 回答