FSharp.Data XmlProvider - Differences When Using Release 3.0.0-Beta for XML Schema

beginners

#1

Hello,
I figured out how to get the 3.0.0-Beta release of the FSharp.Data installed. It seems to accept my schema XSD files without a hiccup!
My question is this - when using the current stable release XmlProvider with a sample file to create the type rather than a schema, I was able to reference my elements and attributes by name using dot-notation, down through multiple levels, e.g.:

type OdmAudit = XmlProvider<…>
let clinData = OdmAudit.Parse(response)

…clinData.CreationDateTime

but now using the 3.0.0-Beta and creating the type by pointing to an XSD file (which uses other XSD files), I have to refer to my elements and attributes using XElements, e.g.

clinData.XElement.Attribute(XName.Get “CreationDateTime”)

Is this to be expected when using a schema vs. sample file? Will it persist once moved into the stable release?


#2

Hmmm…I lied about it liking my schema, so I’m unsure why I was able to get that top-level attribute at all. Realized I had forgotten the ’ Schema = ’ qualifier n the XmlProvider statement. With that added, and pointing to the top-level XSD file in the schema files received from my vendor, I get:

test_fsharpData_beta.fsx(135,17): error FS3033: The type provider ‘ProviderImplementation.XmlProvider’ reported an error: Cannot read sample XSD from ‘H:/FSharp_Projects/XmlTests/ODMSchema2015.3.0/ODM1.3.1/mdsol.xsd’:
No suitable element definition found in the schema.

Can I use a multi-file schema that uses imports and includes, or do they need to be merged into a single XSD file?


#3

Ugh. Please disregard. I discovered the ResolutionFolder parameter for the type definition, and now schema files are accepted.
I hate being a newbie…