If you look at the API documentation forXMLHelper , you will see that the function signature for XMLReadlooks like this:
failOnError:bool -> xmlFileName:string -> nameSpace:string -> prefix:string -> xPath:string -> seq<string>
, failOnError, xmlFileName nameSpace *, . F # , , , XMLRead, , (, string -> string -> (result) ).
* , , "/version/major/minor" xPath, F # , , nameSpace.
, , XMLRead. XMLRead, nameSpace prefix , XML . , :
let x = XMLHelper.XMLRead true "D:/test/Version.Config" "" "" "/version/major/minor"
Target "New" (fun _ ->
for i in x do
printf "%s" i
)
, , , , XMLHelper.XMLRead_Int:
let minorVersion =
match XMLHelper.XMLRead_Int true "D:/test/Version.Config" "" "" "/version/major/minor" with
| true, v -> v
| false, _ -> failwith "Minor version should have been an int"
, int minorVersion, script , Version.Config.