FSharp.Data.Xsd
FSharp.Data.Xsd augments the XML type provider of FSharp.Data with schema support.
PM> Install-Package FSharp.Data.Xsd
Example
The Schema
parameter can be used (instead of Sample
) to specify an XML schema.
The value of the parameter can be either the name of a schema file or
plain text like in the following example:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: |
|
The properties of the provided type are derived from the schema instead of being inferred from samples.
Samples & documentation
The library comes with comprehensible documentation.
It can include tutorials automatically generated from *.fsx
files in the content folder.
Tutorial contains a further explanation of this library.
Sequence and Choice shows the library in action with the basic structures in a schema.
Substitution Groups explains how to deal with extensible and abstract schemas.
Design Notes provide some context for implementation decisions.
Contributing and copyright
The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding a new public API, please also consider adding samples that can be turned into a documentation. You might also want to read the library design notes to understand how it works.
The library is available under Public Domain license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.
namespace FSharp
--------------------
namespace Microsoft.FSharp
namespace FSharp.Data
--------------------
namespace Microsoft.FSharp.Data
Full name: Index.Person
Full name: FSharp.Data.XmlProvider
<summary>Typed representation of a XML file.</summary>
<param name='Sample'>Location of a XML sample file or a string containing a sample XML document.</param>
<param name='SampleIsList'>If true, the children of the root in the sample document represent individual samples for the inference.</param>
<param name='Global'>If true, the inference unifies all XML elements with the same name.</param>
<param name='Culture'>The culture used for parsing numbers and dates. Defaults to the invariant culture.</param>
<param name='Encoding'>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.</param>
<param name='ResolutionFolder'>A directory that is used when resolving relative file references (at design time and in hosted execution).</param>
<param name='EmbeddedResource'>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.</param>
<param name='InferTypesFromValues'>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.)</param>
<param name='Schema'>Location of a schema file or a string containing xsd.</param>
Full name: Index.turing
Parses the specified XML string
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn