天天看點

F# read an XML document

  1. #light 
  2. open System 
  3. open System.IO 
  4. open System.Xml 
  5. let out(x) = printfn "%A"x 
  6. let xmldoc = new XmlDocument() 
  7. xmldoc.Load("c://test.xml") 
  8. let xnl = xmldoc.SelectSingleNode("Root").ChildNodes 
  9. for n in 0 .. xnl.Count-1 do 
  10. let xe = xnl.Item(n) 
  11. out(xe.InnerText) 
  12. System.Console.ReadKey(true) > ignore
F# xml c