CultureAndRegionInfoBuilder::CreateFromLdml Method (String^)
Reconstitutes a CultureAndRegionInfoBuilder object from a specified XML file that contains a representation of the object.
Assembly: sysglobl (in sysglobl.dll)
Parameters
- xmlFileName
-
Type:
System::String^
A file name that contains the XML representation of a CultureAndRegionInfoBuilder object.
Return Value
Type: System.Globalization::CultureAndRegionInfoBuilder^A new object that is equivalent to the information stored in the xmlFileName parameter.
| Exception | Condition |
|---|---|
| ArgumentNullException | xmlFileName is null. |
| ArgumentException | xmlFileName is an empty string (""), or invalid file or path name. |
| XmlException | The data in xmlFileName is not in valid XML format. -or- An I/O error occurred while accessing xmlFileName. |
| XmlSchemaValidationException | The data in xmlFileName is not in valid LDML format. |
The xmlFileName parameter specifies a file name that contains the XML representation of a CultureAndRegionInfoBuilder object. The format of the XML file is called Locale Data Markup Language (LDML) version 1.1. A new CultureAndRegionInfoBuilder object is created and initialized with the data in xmlFileName. The Save method performs the reverse operation of the CreateFromLdml method.
In the LDML file, the properties of a culture are specified as child elements of the <special> element in the <identity> section. A property value is typically specified by the element's type attribute. For example, the following excerpt from an LDML file defines a culture's parent as the English neutral culture.
<identity>
<version number="1.1">ldml version 1.1</version>
<generation date="2012-05-16" />
<special xmlns:msLocale="http://schemas.microsoft.com/globalization/2004/08/carib/ldml">
<!—content removed -->
<msLocale:parentName type="en" />
<!—content removed -->
</special>
</identity>
For more information about the LDML standard, see Unicode Technical Standard #35, "Locale Data Markup Language (LDML)" on the Unicode Consortium website.
Available since 2.0