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

Gets the attribute with the given name from the given XmlNode

getChilds node
Signature: node:'?9608 -> seq<XmlNode>
Type parameters: '?9608

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

Parses a XmlNode

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

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

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

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

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

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

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

Selects a xml node via XPath from the given document

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

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

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