INFO

This API documentation is for FAKE version 5.0 or later. The old API documentation can be found here for migration or here for fake 4

This is part of the Fake.Core.Xml module.

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:'?9602 -> string
Type parameters: '?9602

Gets the attribute with the given name from the given XmlNode

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

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:('?9607 -> '?9608) -> node:'?9607 -> '?9608
Type parameters: '?9607, '?9608

Parses a XmlNode

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

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:'?9630 -> doc:XmlDocument -> XmlDocument
Type parameters: '?9630

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

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

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:'?9619 -> doc:XmlDocument -> string
Type parameters: '?9619

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

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

Selects a xml node via XPath from the given document

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

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:'?9599 -> writer:XmlWriter -> XmlWriter
Type parameters: '?9599

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