let xmlpurchaseOrder = GetWeb("[link:localhost]
let xmlOrders = new XmlDocument()
xmlOrders.Load(xmlpurchaseOrder)
let xmlItems = xmlOrders.SelectNodes("//purchaseOrder/items")
printfn "Done"

use

1
xmlOrders.LoadXml

instead of

1
xmlOrders.Load

. The argument of the Load method is the path of the content not the content itself.

By on 3/6/2010 6:05 AM ()

Hello, Sharpdev:
Thank you very much.
Finally, someone has answered my question. Actually, one of my friends has already told me the issue by email. But it is difficult to find anyone in this forum to indicate this.
Thanks again!

By on 3/6/2010 7:32 AM ()

mainly because that is strictly speaking not a F# question and more about a .NET library thing.

That said, it highlight one of the nice thing about F# unit of measure(not sure that applies to string though) is that for generic data primitive type like int/float/string, there is a need for unit of measure so the compiler can do some type checking. that is string <> string<xml>. That though is more about function parameter design and not much can be done in this case anyway.

By on 3/6/2010 9:51 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