创建LocaleInfo.xml提交文件

LocaleInfo XML 架构

设备清单提交包必须包含一个 LocaleInfo.xml 文档,合作伙伴中心使用其中包含的信息来验证设备元数据包中的区域设置信息。

LocaleInfo.xml 文档中的数据基于 LocaleInfo XML 架构进行格式化,如下所述。

注意

必须使用 UTF-8 编码保存 XML 文档。

有关地址范围的详细信息,请参阅 如何为设备和打印机创建设备元数据包。

LocaleInfo XML 架构命名空间

以下是 LocaleInfo XML 架构的命名空间:http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo

LocaleInfo XML 元素/属性概述

下表描述了 LocaleInfo XML 架构的元数据元素和属性。

元素/属性 元素/属性类型 必需/可选
MultipleLocale xs:boolean 可选
LocaleDeclaredInPackageInfo tns:LocaleDeclaredInPackageInfoType 可选
默认值 xs:boolean 必须
SupportedLocaleList tns:SupportedLocaleListType 可选
区域设置 xs:string 可选

LocaleInfo XML 架构定义

下面是 LocaleInfo XML 架构定义:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo" xmlns:tns="http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" blockDefault="#all">

 <xs:element name="LocaleInfo" type="tns:LocaleInfoType" />

 <xs:complexType name="LocaleInfoType">
  <xs:sequence>
   <xs:element name="MultipleLocale" type="xs:boolean" />
   <xs:element name="LocaleDeclaredInPackageInfo" type="tns:LocaleDeclaredInPackageInfoType" />
   <xs:element name="SupportedLocaleList" type="tns:SupportedLocaleListType" minOccurs="0" />
   <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
 </xs:complexType>

  <xs:complexType name="LocaleDeclaredInPackageInfoType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="default" type="xs:boolean" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="SupportedLocaleListType">
    <xs:sequence>
      <xs:element name="Locale" type="xs:string" maxOccurs="unbounded" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

</xs:schema>

LocaleInfo XML 架构参考

LocaleInfo XML 架构定义以下元素和属性:

  • LocaleInfo
    • MultipleLocale
    • LocaleDeclaredInPackageInfo
      • 默认值
    • SupportedLocaleList
      • 区域设置

MultipleLocale 元素

MultipleLocale 元素指定设备元数据包是否支持多个区域设置。 合作伙伴中心使用此值可正确验证包。

<xs:element name="MultipleLocale" type="xs:boolean" />

备注(MultipleLocale 元素)

如果设备元数据包中支持多个区域设置,则 MultipleLocale 元素必须是“true”。 如果设备元数据包仅支持一个区域设置,则元素可以为“true”或“false”。 MultipleLocale 的值必须与PackageInfo.xml中指定的值匹配。

LocaleDeclaredInPackageInfo 元素

LocaleDeclaredInPackageInfo 元素指定有关设备元数据包中声明的区域设置和包属性的信息。 合作伙伴中心使用此信息可正确验证设备元数据包中的已声明区域设置元数据。

<xs:element name="LocaleDeclaredInPackageInfo" type="tns:LocaleDeclaredInPackageInfoType" />

<xs:complexType name="LocaleDeclaredInPackageInfoType">
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:attribute name="default" type="xs:boolean" use="required" />
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

备注(LocaleDeclaredInPackageInfo 元素)

LocaleDeclaredInPackageInfo 元素必须与PackageInfo.xml中指定的区域设置值匹配。

default 属性

默认属性指定设备元数据包是否为默认包,如PackageInfo.xml所示。

<xs:attribute name="default" type="xs:boolean" use="required" />

备注(默认元素)

默认元素必须与PackageInfo.xml中指定的默认值匹配。

SupportedLocaleList 元素

SupportedLocaleList 元素指定设备元数据包中支持哪些其他区域设置。 合作伙伴中心使用此信息可正确验证设备元数据包中的其他区域设置元数据。

<xs:element name="SupportedLocaleList" type="tns:SupportedLocaleListType" minOccurs="0" />

<xs:complexType name="SupportedLocaleListType">
  <xs:sequence>
    <xs:element name="Locale" type="xs:string" maxOccurs="unbounded" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>

Locale 元素

Locale 元素指定设备元数据包中支持的额外区域设置。 有关合作伙伴中心如何使用此值的详细信息,请参阅“SupportedLocaleList 元素”。

LocaleInfo XML 示例

以下 XML 文档使用 LocaleInfo XML 架构来指定 LocaleInfo 信息的组件。

此示例适用于支持 en-US、ja-JP 和 fr-FR 区域设置的设备元数据包。 它列出了 PackageInfo.xml 中的 en-US 区域设置,并且是默认的区域设置包,如PackageInfo.xml所示。

<?xml version="1.0" encoding="utf-8"?>
<LocaleInfo xmlns="http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo">
  
  <MultipleLocale>
    true
  </MultipleLocale>
  
  <LocaleDeclaredInPackageInfo default="true">
    en-US
  </LocaleDeclaredInPackageInfo>
  
  <SupportedLocaleList>
    <Locale>en-US</Locale>
    <Locale>ja-JP</Locale>
    <Locale>fr-FR</Locale>
  </SupportedLocaleList>
  
</LocaleInfo>