属性包架构

适用于:SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013

元素清单可以定义文件、文件夹、列表项或网站的属性包。

以下是“属性包”架构中的元素的列表。

示例

以下示例演示如何将 Location 属性及其值添加到表示外地办事处的网站的属性包。

    <PropertyBag HyperlinkBaseUrl="http://contoso.com/sites/EastEnglandSalesOffice"" Url="" ParentType="Web" RootWebOnly=TRUE" />
        <Property Name="Location" Value="London" Type="string" />
    </PropertyBag>

以下示例演示如何将 DaysToLive 属性及其值添加到表示临时价格折扣的列表项的属性包。 该属性指定在从列表中删除第二十三个列表项之前,该项应保存的天数。 请注意,Type 属性的值必须是 PropertyBagType 枚举的成员。 因此,在这种情况下,它必须 "int" 不是 "integer"

    <PropertyBag HyperlinkBaseUrl="http://contoso.com/sites/EastEnglandSalesOffice"" Url="Lists/CurrentDiscounts" ParentType="ListItem" ItemIndex="23"/>
        <Property Name="DaysToLive" Value="90" Type="int" />
    </PropertyBag>