FAKE - F# Make - A DSL for build tasks and more FAKE
6.1.3

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

Xml Module

Contains functions to read and write XML files.

Functions and values

Function or value Description

XmlTransform stylesheetUri fileName

Full Usage: XmlTransform stylesheetUri fileName

Parameters:
    stylesheetUri : string - The Uri for the XSL stylesheet file.
    fileName : string - The XML file to transform.

Transforms a XML file using a XSL stylesheet file.

stylesheetUri : string

The Uri for the XSL stylesheet file.

fileName : string

The XML file to transform.

XslTransform xsl doc

Full Usage: XslTransform xsl doc

Parameters:
Returns: XmlDocument

Transforms a XmlDocument using a XslCompiledTransform.

xsl : XslCompiledTransform

The XslCompiledTransform which should be applied.

doc : XmlDocument

The XmlDocument to transform.

Returns: XmlDocument

XslTransformer text

Full Usage: XslTransformer text

Parameters:
    text : string - The text to use

Returns: XslCompiledTransform

Loads the given text into a XslCompiledTransform.

text : string

The text to use

Returns: XslCompiledTransform

createDoc text

Full Usage: createDoc text

Parameters:
    text : string - The XML text

Returns: XmlDocument

Loads the given text into a XmlDocument

text : string

The XML text

Returns: XmlDocument

endElement writer

Full Usage: endElement writer

Parameters:
Returns: XmlWriter

Writes an XML end element to the given XmlTextWriter

writer : XmlWriter

The XML writer to use

Returns: XmlWriter

getAttribute name node

Full Usage: getAttribute name node

Parameters:
    name : string - The attribute name to get
    node : 'a - The XML node to get attribute on

Returns: string

Gets the attribute with the given name from the given XmlNode

name : string

The attribute name to get

node : 'a

The XML node to get attribute on

Returns: string

getDocElement doc

Full Usage: getDocElement doc

Parameters:
Returns: XmlElement

Gets the DocumentElement of the XmlDocument

doc : XmlDocument

The XmlDocument object

Returns: XmlElement

getSubNode name node

Full Usage: getSubNode name node

Parameters:
    name : string - The sub node name
    node : XmlNode - The XML node to get sub node for

Returns: XmlNode

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

name : string

The sub node name

node : XmlNode

The XML node to get sub node for

Returns: XmlNode

getSubNodes node

Full Usage: getSubNodes node

Parameters:
    node : 'a - The XML node to get sub nodes for

Returns: seq<XmlNode>

Gets a sequence of all sub nodes for the given XmlNode

node : 'a

The XML node to get sub nodes for

Returns: seq<XmlNode>

getWriter fileName

Full Usage: getWriter fileName

Parameters:
    fileName : string - The XML file name

Returns: XmlWriter

Creates a XmlWriter which writes to the given file name

fileName : string

The XML file name

Returns: XmlWriter

loadDoc path

Full Usage: loadDoc path

Parameters:
    path : string - The file path to load an XmlDocument from

Returns: XmlDocument

Loads the given file path into a XmlDocument

path : string

The file path to load an XmlDocument from

Returns: XmlDocument

parse name f node

Full Usage: parse name f node

Parameters:
    name : string - The node name
    f : 'a -> 'b - The parser function to use
    node : 'a - The XML node to parse

Returns: 'b

Parses a XmlNode

name : string

The node name

f : 'a -> 'b

The parser function to use

node : 'a

The XML node to parse

Returns: 'b

parseSubNode name f

Full Usage: parseSubNode name f

Parameters:
    name : string - The sub node name
    f : XmlNode -> 'a - The parser function to use

Returns: XmlNode -> 'a

Parses a XML sub node

name : string

The sub node name

f : XmlNode -> 'a

The parser function to use

Returns: XmlNode -> 'a

poke fileName xpath value

Full Usage: poke fileName xpath value

Parameters:
    fileName : string - The file name to use
    xpath : string - The XPath expression used to select text
    value : string - The new value

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

fileName : string

The file name to use

xpath : string

The XPath expression used to select text

value : string

The new value

pokeInnerText fileName xpath innerTextValue

Full Usage: pokeInnerText fileName xpath innerTextValue

Parameters:
    fileName : string - The file name to use
    xpath : string - The XPath expression used to select text
    innerTextValue : string - The new value

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

fileName : string

The file name to use

xpath : string

The XPath expression used to select text

innerTextValue : string

The new value

pokeInnerTextNS fileName namespaces xpath innerTextValue

Full Usage: pokeInnerTextNS fileName namespaces xpath innerTextValue

Parameters:
    fileName : string - The file name to use
    namespaces : seq<string * string> - The namespaces list
    xpath : string - The XPath expression used to select text
    innerTextValue : string - The new value

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

fileName : string

The file name to use

namespaces : seq<string * string>

The namespaces list

xpath : string

The XPath expression used to select text

innerTextValue : string

The new value

pokeNS fileName namespaces xpath value

Full Usage: pokeNS fileName namespaces xpath value

Parameters:
    fileName : string - The file name to use
    namespaces : seq<string * string> - The namespaces list
    xpath : string - The XPath expression used to select text
    value : string - The new value

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

fileName : string

The file name to use

namespaces : seq<string * string>

The namespaces list

xpath : string

The XPath expression used to select text

value : string

The new value

read failOnError xmlFileName nameSpace prefix xPath

Full Usage: read failOnError xmlFileName nameSpace prefix xPath

Parameters:
    failOnError : bool - Flag to fail the operation when an error happens
    xmlFileName : string - The XML file name
    nameSpace : string - The XML name specification
    prefix : string - The XML name specification prefix
    xPath : string - X Path expression

Returns: seq<string>

Reads a value from a XML document using a XPath

failOnError : bool

Flag to fail the operation when an error happens

xmlFileName : string

The XML file name

nameSpace : string

The XML name specification

prefix : string

The XML name specification prefix

xPath : string

X Path expression

Returns: seq<string>

read_Int failOnError xmlFileName nameSpace prefix xPath

Full Usage: read_Int failOnError xmlFileName nameSpace prefix xPath

Parameters:
    failOnError : bool - Flag to fail the operation when an error happens
    xmlFileName : string - The XML file name
    nameSpace : string - The XML name specification
    prefix : string - The XML name specification prefix
    xPath : string - X Path expression

Returns: bool * int

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

failOnError : bool

Flag to fail the operation when an error happens

xmlFileName : string

The XML file name

nameSpace : string

The XML name specification

prefix : string

The XML name specification prefix

xPath : string

X Path expression

Returns: bool * int

replaceXPath xpath value doc

Full Usage: replaceXPath xpath value doc

Parameters:
    xpath : string - The XPath expression to use to select node
    value : string - The new value
    doc : XmlDocument - The XML document to search on

Returns: XmlDocument

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

xpath : string

The XPath expression to use to select node

value : string

The new value

doc : XmlDocument

The XML document to search on

Returns: XmlDocument

replaceXPathAttribute xpath attribute value doc

Full Usage: replaceXPathAttribute xpath attribute value doc

Parameters:
    xpath : string - The XPath expression to use to select node
    attribute : string - The attribute name
    value : string
    doc : XmlDocument - The XML document to search on

Returns: XmlDocument

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

xpath : string

The XPath expression to use to select node

attribute : string

The attribute name

value : string
doc : XmlDocument

The XML document to search on

Returns: XmlDocument

replaceXPathInnerText xpath innerTextValue doc

Full Usage: replaceXPathInnerText xpath innerTextValue doc

Parameters:
    xpath : string - The XPath expression to use to select node
    innerTextValue : string - The new value
    doc : XmlDocument - The XML document to search on

Returns: XmlDocument

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

xpath : string

The XPath expression to use to select node

innerTextValue : string

The new value

doc : XmlDocument

The XML document to search on

Returns: XmlDocument

replaceXPathInnerTextNS xpath innerTextValue namespaces doc

Full Usage: replaceXPathInnerTextNS xpath innerTextValue namespaces doc

Parameters:
    xpath : string - The XPath expression used to select text
    innerTextValue : string - The new value
    namespaces : 'a - The namespaces list
    doc : XmlDocument - The XmlDocument object

Returns: XmlDocument

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

xpath : string

The XPath expression used to select text

innerTextValue : string

The new value

namespaces : 'a

The namespaces list

doc : XmlDocument

The XmlDocument object

Returns: XmlDocument

replaceXPathNS xpath value namespaces doc

Full Usage: replaceXPathNS xpath value namespaces doc

Parameters:
    xpath : string - The XPath expression used to select text
    value : string - The new value
    namespaces : 'a - The namespaces list
    doc : XmlDocument - The XmlDocument object

Returns: XmlDocument

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

xpath : string

The XPath expression used to select text

value : string

The new value

namespaces : 'a

The namespaces list

doc : XmlDocument

The XmlDocument object

Returns: XmlDocument

saveDoc fileName doc

Full Usage: saveDoc fileName doc

Parameters:
    fileName : string - The output file name
    doc : XmlDocument - The XML document to save

Save the given XmlDocument to file path

fileName : string

The output file name

doc : XmlDocument

The XML document to save

selectXPathAttributeValue xpath attribute namespaces doc

Full Usage: selectXPathAttributeValue xpath attribute namespaces doc

Parameters:
    xpath : string - The XPath expression to use to select node
    attribute : string - The attribute name
    namespaces : 'a - The namespaces list
    doc : XmlDocument - The XML document to search on

Returns: string

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

xpath : string

The XPath expression to use to select node

attribute : string

The attribute name

namespaces : 'a

The namespaces list

doc : XmlDocument

The XML document to search on

Returns: string

selectXPathNode xpath namespaces doc

Full Usage: selectXPathNode xpath namespaces doc

Parameters:
    xpath : string - The XPath expression to use to select node
    namespaces : 'a - The namespaces list
    doc : XmlDocument - The XML document to search on

Returns: XmlNode

Selects a xml node via XPath from the given document

xpath : string

The XPath expression to use to select node

namespaces : 'a

The namespaces list

doc : XmlDocument

The XML document to search on

Returns: XmlNode

selectXPathValue xpath namespaces doc

Full Usage: selectXPathValue xpath namespaces doc

Parameters:
    xpath : string - The XPath expression to use to select node
    namespaces : 'a - The namespaces list
    doc : XmlDocument - The XML document to search on

Returns: string

Selects a xml node value via XPath from the given document

xpath : string

The XPath expression to use to select node

namespaces : 'a

The namespaces list

doc : XmlDocument

The XML document to search on

Returns: string

startElement name writer

Full Usage: startElement name writer

Parameters:
    name : string - The element name to start
    writer : XmlWriter - The XML writer to use

Returns: XmlWriter

Writes an XML start element to the given XmlTextWriter

name : string

The element name to start

writer : XmlWriter

The XML writer to use

Returns: XmlWriter

writeAttribute name value writer

Full Usage: writeAttribute name value writer

Parameters:
    name : string - The attribute name
    value : 'a - The attribute value
    writer : XmlWriter - The XML writer to use

Returns: XmlWriter

Writes an XML attribute to current element of the given XmlTextWriter

name : string

The attribute name

value : 'a

The attribute value

writer : XmlWriter

The XML writer to use

Returns: XmlWriter

writeCDataElement elementName data writer

Full Usage: writeCDataElement elementName data writer

Parameters:
    elementName : string - The element name
    data : string - The CData to write
    writer : XmlWriter - The XML writer to use

Returns: XmlWriter

Writes an CData element to the given XmlTextWriter

elementName : string

The element name

data : string

The CData to write

writer : XmlWriter

The XML writer to use

Returns: XmlWriter

writeComment comment writer

Full Usage: writeComment comment writer

Parameters:
    comment : string - The comment to write
    writer : XmlWriter - The XML writer to use

Returns: XmlWriter

Writes an XML comment to the given XmlTextWriter

comment : string

The comment to write

writer : XmlWriter

The XML writer to use

Returns: XmlWriter