Header menu logo FSharp.Data

XmlProvider Type

Typed representation of a XML file.

Static parameters

Static parameters Description

Culture: string(optional,default="")

Full Usage: Culture: string(optional,default="")

The culture used for parsing numbers and dates. Defaults to the invariant culture.

DtdProcessing: string(optional,default="Ignore")

Full Usage: DtdProcessing: string(optional,default="Ignore")

Controls how DTD declarations in the XML are handled. Accepted values: "Ignore" (default, silently skips DTD processing, safe for most cases), "Prohibit" (throws on any DTD declaration), "Parse" (enables full DTD processing including entity expansion, use with caution).

EmbeddedResource: string(optional,default="")

Full Usage: EmbeddedResource: string(optional,default="")

When specified, the type provider first attempts to load the sample from the specified resource 
              (e.g. 'MyCompany.MyAssembly, resource_name.xml'). This is useful when exposing types generated by the type provider.

Encoding: string(optional,default="")

Full Usage: Encoding: string(optional,default="")

The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and to ISO-8859-1 the for HTTP requests, unless charset is specified in the Content-Type response header.

Global: bool(optional,default=false)

Full Usage: Global: bool(optional,default=false)

If true, the inference unifies all XML elements with the same name.

InferTypesFromValues: bool(optional,default=true)

Full Usage: InferTypesFromValues: bool(optional,default=true)

This parameter is deprecated. Please use InferenceMode instead. If true, turns on additional type inference from values. (e.g. type inference infers string values such as "123" as ints and values constrained to 0 and 1 as booleans. The XmlProvider also infers string values as JSON.)

InferenceMode: InferenceMode(optional,default=BackwardCompatible)

Full Usage: InferenceMode: InferenceMode(optional,default=BackwardCompatible)

Possible values:
              | NoInference -> Inference is disabled. All values are inferred as the most basic type permitted for the value (usually string).
              | ValuesOnly -> Types of values are inferred from the Sample. Inline schema support is disabled. This is the default.
              | ValuesAndInlineSchemasHints -> Types of values are inferred from both values and inline schemas. Inline schemas are special string values that can define a type and/or unit of measure. Supported syntax: typeof or typeof{type} or typeof> or typeof{type{measure}}. Valid measures are the default SI units, and valid types are int, int64, bool, float, decimal, date, datetimeoffset, timespan, guid and string.
              | ValuesAndInlineSchemasOverrides -> Same as ValuesAndInlineSchemasHints, but value inferred types are ignored when an inline schema is present.
              Note inline schemas are not used from Xsd documents.

PreferDateOnly: bool(optional,default=false)

Full Usage: PreferDateOnly: bool(optional,default=false)

When true on .NET 6+, date-only strings are inferred as DateOnly and time-only strings as TimeOnly. Defaults to false for backward compatibility.

PreferDateTimeOffset: bool(optional,default=false)

Full Usage: PreferDateTimeOffset: bool(optional,default=false)

When true, date-time strings without an explicit timezone offset are inferred as DateTimeOffset (using the local offset) instead of DateTime. Defaults to false.

PreferOptionals: bool(optional,default=true)

Full Usage: PreferOptionals: bool(optional,default=true)

When set to true (default), inference will use the option type for missing or absent values. When false, inference will prefer to use empty string or double.NaN for missing values where possible, matching the default CsvProvider behavior.

ResolutionFolder: string(optional,default="")

Full Usage: ResolutionFolder: string(optional,default="")

A directory that is used when resolving relative file references (at design time and in hosted execution).

Sample: string(optional,default="")

Full Usage: Sample: string(optional,default="")

Location of a XML sample file or a string containing a sample XML document.

SampleIsList: bool(optional,default=false)

Full Usage: SampleIsList: bool(optional,default=false)

If true, the children of the root in the sample document represent individual samples for the inference.

Schema: string(optional,default="")

Full Usage: Schema: string(optional,default="")

Location of a schema file or a string containing xsd.

UseOriginalNames: bool(optional,default=false)

Full Usage: UseOriginalNames: bool(optional,default=false)

When true, XML element and attribute names are used as-is for generated property names instead of being normalized to PascalCase. Defaults to false.

Type something to start searching.