Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

Xml

Contains functions to read and write XML files.

Functions and values

Function or valueDescription
createDoc(text)
Signature: text:string -> XmlDocument

Loads the given text into a XmlDocument

endElement(writer)
Signature: writer:XmlWriter -> XmlWriter

Writes an XML end element to the given XmlTextWriter

getAttribute name node
Signature: name:string -> node:'a -> string
Type parameters: 'a

Gets the attribute with the given name from the given XmlNode

getChilds(node)
Signature: node:'a -> seq<XmlNode>
Type parameters: 'a

Gets a sequence of all child nodes for the given XmlNode

getDocElement(doc)
Signature: doc:XmlDocument -> XmlElement

Gets the DocumentElement of the XmlDocument

getSubNode name node
Signature: name:string -> node:XmlNode -> XmlNode

Gets the first sub node with the given name from the given XmlNode

getWriter(fileName)
Signature: fileName:string -> XmlWriter

Creates a XmlWriter which writes to the given file name

loadDoc(path)
Signature: path:string -> XmlDocument

Loads the given file path into a XmlDocument

parse name f node
Signature: name:string -> f:('a -> 'b) -> node:'a -> 'b
Type parameters: 'a, 'b

Parses a XmlNode

parseSubNode name f
Signature: name:string -> f:(XmlNode -> 'a) -> XmlNode -> 'a
Type parameters: 'a

Parses a XML subnode

poke fileName xpath value
Signature: fileName:string -> xpath:string -> value:string -> unit

Replaces text in a XML file at the location specified by a XPath expression.

pokeInnerText(...)
Signature: fileName:string -> xpath:string -> innerTextValue:string -> unit

Replaces the inner text of an xml node in a XML file at the location specified by a XPath expression.

pokeInnerTextNS(...)
Signature: fileName:string -> namespaces:seq<string * string> -> xpath:string -> innerTextValue:string -> unit

Replaces inner text of an xml node in a XML file at the location specified by a XPath expression, with support for namespaces.

pokeNS fileName namespaces xpath value
Signature: fileName:string -> namespaces:seq<string * string> -> xpath:string -> value:string -> unit

Replaces text in a XML file at the location specified by a XPath expression, with support for namespaces.

read(...)
Signature: failOnError:bool -> xmlFileName:string -> nameSpace:string -> prefix:string -> xPath:string -> seq<string>

Reads a value from a XML document using a XPath

read_Int(...)
Signature: failOnError:bool -> xmlFileName:string -> nameSpace:string -> prefix:string -> xPath:string -> bool * int

Reads a value from a XML document using a XPath Returns if the value is an int and the value

replaceXPath xpath value doc
Signature: xpath:string -> value:string -> doc:XmlDocument -> XmlDocument

Replaces text in the XML document specified by a XPath expression.

replaceXPathAttribute(...)
Signature: xpath:string -> attribute:string -> value:string -> doc:XmlDocument -> XmlDocument

Replaces the value of attribute in an xml node in the XML document specified by a XPath expression.

replaceXPathInnerText(...)
Signature: xpath:string -> innerTextValue:string -> doc:XmlDocument -> XmlDocument

Replaces the inner text of an xml node in the XML document specified by a XPath expression.

replaceXPathInnerTextNS(...)
Signature: xpath:string -> innerTextValue:string -> namespaces:'?17268 -> doc:XmlDocument -> XmlDocument
Type parameters: '?17268

Replaces inner text in a XML document specified by a XPath expression, with support for namespaces.

replaceXPathNS(...)
Signature: xpath:string -> value:string -> namespaces:'a -> doc:XmlDocument -> XmlDocument
Type parameters: 'a

Replaces text in a XML document specified by a XPath expression, with support for namespaces.

saveDoc fileName doc
Signature: fileName:string -> doc:XmlDocument -> unit
selectXPathAttributeValue(...)
Signature: xpath:string -> attribute:string -> namespaces:'?17257 -> doc:XmlDocument -> string
Type parameters: '?17257

Selects a xml node attribute value via XPath from the given document

selectXPathNode xpath namespaces doc
Signature: xpath:string -> namespaces:'?17259 -> doc:XmlDocument -> XmlNode
Type parameters: '?17259

Selects a xml node via XPath from the given document

selectXPathValue xpath namespaces doc
Signature: xpath:string -> namespaces:'a -> doc:XmlDocument -> string
Type parameters: 'a

Selects a xml node value via XPath from the given document

startElement name writer
Signature: name:string -> writer:XmlWriter -> XmlWriter

Writes an XML start element to the given XmlTextWriter

writeAttribute name value writer
Signature: name:string -> value:'?17237 -> writer:XmlWriter -> XmlWriter
Type parameters: '?17237

Writes an XML attribute to current element of the given XmlTextWriter

writeCDataElement(...)
Signature: elementName:string -> data:string -> writer:XmlWriter -> XmlWriter

Writes an CData element to the given XmlTextWriter

writeComment comment writer
Signature: comment:string -> writer:XmlWriter -> XmlWriter

Writes an XML comment to the given XmlTextWriter

XmlTransform stylesheetUri fileName
Signature: stylesheetUri:string -> fileName:string -> unit
Attributes:
[<Obsolete("This API is not yet available on netcore. If you have an alternative please switch. If the API becomes available this warning is removed.")>]
OBSOLETE

This API is not yet available on netcore. If you have an alternative please switch. If the API becomes available this warning is removed.

Transforms a XML file using a XSL stylesheet file.

Parameters

  • stylesheetUri - The Uri for the XSL stylesheet file.
  • fileName - The XML file to transform.
XslTransform xsl doc
Signature: xsl:XslCompiledTransform -> doc:XmlDocument -> XmlDocument
Attributes:
[<Obsolete("This API is not yet available on netcore. If you have an alternative please switch. If the API becomes available this warning is removed.")>]
OBSOLETE

This API is not yet available on netcore. If you have an alternative please switch. If the API becomes available this warning is removed.

Transforms a XmlDocument using a XslCompiledTransform.

Parameters

  • xsl - The XslCompiledTransform which should be applied.
  • doc - The XmlDocument to transform.
XslTransformer(text)
Signature: text:string -> XslCompiledTransform
Attributes:
[<Obsolete("This API is not yet available on netcore. If you have an alternative please switch. If the API becomes available this warning is removed.")>]
OBSOLETE

This API is not yet available on netcore. If you have an alternative please switch. If the API becomes available this warning is removed.

Loads the given text into a XslCompiledTransform.