fsharp xsd

73 views
Skip to first unread message

Sayth Renshaw

unread,
Mar 10, 2015, 4:15:44 PM3/10/15
to fsharp-o...@googlegroups.com
Hi

On my forray into the fsharp world and I wanted to create classes off of an XSD like you can with C#.

This SO post https://stackoverflow.com/questions/4327396/xsd-exe-to-generate-f-classes-off-of-xsd shows that at that time 2010 there was no other way then brute force to create this

I had the same problem "Exception from HRESULT: 0x80131047" - did not manage to solve it but there is an ugly workaround:

  1. Create a new C# console application
  2. See this post for how to programatically do the same thing as xsd.exe
  3. Add reference to your F# powerpack's CodeDom dll
  4. Use Microsoft.FSharp.Compiler.CodeDom.FSharpCodeProvider instead of CSharpCodeProvid


Is there a way now to generate F# instead of csharp based off an XML and xsd file?

Sayth

Sayth Renshaw

unread,
Mar 11, 2015, 12:00:53 AM3/11/15
to fsharp-o...@googlegroups.com
Or should I be using something like fspickler http://nessos.github.io/FsPickler/tutorial.html ?

Finding it unclear how to pull in xml and access values from it in F#.

Sayth

Leaf Garland

unread,
Mar 11, 2015, 7:33:26 AM3/11/15
to fsharp-o...@googlegroups.com
You might find the Xml type provider helps, there is ongoing work to be able to use an XSD but in the meantime it works well with a sample Xml file.


See this issue for details of the XSD work:

Cheers,
Leaf.

Sayth Renshaw

unread,
Mar 11, 2015, 6:46:30 PM3/11/15
to fsharp-o...@googlegroups.com

Thank you so much going to sit down and work through it and see how I go.

Sayth


--
--
To post, send email to fsharp-o...@googlegroups.com
To unsubscribe, send email to
fsharp-opensou...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fsharp-opensource
---
You received this message because you are subscribed to a topic in the Google Groups "F# Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fsharp-opensource/pg8vNL86BVE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fsharp-opensou...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages