Hi,

I'm trying to generate XML docs for a F# lib. FSC is generating a xml document like this:

1
2
3
4
5
6
7
8
9
10
11
...
<member name="M:Statefulie.StateMachine.createTarget``1(``0)">
 <summary>Creates a state machine target from a state.</summary>
 <typeparam name="'a">The type of the state.</typeparam>
 <returns>An anonymous IStateful<'a>.</returns>
 <remarks>
   This function reminds me an awful lot of the monadic Return...
   I would like to remove this and use a state monad in its place. (see above)
 </remarks>
</member>
...

No I want to load this file into a XMLDocument (like fshtmldoc does):

1
2
3
4
5
 
let settings = XmlReaderSettings()   
let reader = XmlReader.Create(xmlFile,settings)
let doc = XmlDocument()
doc.Load(reader)

but I'm getting an error. doc.Load() complains about the ' at the beginning of the type in the return type.
Any ideas to solve this?

Thanks and regards,
forki

The spec is roughly: if the first character of an xmldoc comment is a less-than, then the entire xmldoc comment is assumed to be well-formed XML and you're on your own. Otherwise, it's assumed to be non-XML, and the compiler escapes it.

The fix would be to escape it, e.g. use

1
2
3
4
5
 

    <returns>An anonymous IStateful<'a>.</returns>

By on 2/20/2010 9:52 AM ()

Thanks Brian for giving a workaround.

BTW: The C# compiler shows a warning for such cases:

1
"Warning    1    XML comment on 'ConsoleApplication2.Program' has badly formed XML. ...."

Regards,
forki

By on 2/20/2010 11:19 AM ()

I think fsc.exe should encapsulate the comment here?!

By on 2/20/2010 3:35 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper