Xml

Contains functions to read and write XML files.

Functions and values

Function or valueDescription
Attribute name value writer
Signature: name:string -> value:'?15254 -> writer:XmlWriter -> XmlWriter
Type parameters: '?15254

Writes an XML attribute to current element of the given XmlTextWriter

CDataElement elementName data writer
Signature: elementName:string -> data:string -> writer:XmlWriter -> XmlWriter

Writes an CData element to the given XmlTextWriter

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

Writes an XML comment to the given XmlTextWriter

Doc text
Signature: text:string -> XmlDocument

Loads the given text into a XmlDocument

DocElement doc
Signature: doc:XmlDocument -> XmlElement

Gets the DocumentElement of the XmlDocument

EndElement writer
Signature: writer:XmlWriter -> XmlWriter

Writes an XML end element to the given XmlTextWriter

getAttribute name node
Signature: name:string -> node:'?15257 -> string
Type parameters: '?15257

Gets the attribute with the given name from the given XmlNode

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

Gets a sequence of all child nodes for the given XmlNode

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

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

parse name f node
Signature: name:string -> f:('?15262 -> '?15263) -> node:'?15262 -> '?15263
Type parameters: '?15262, '?15263

Parses a XmlNode

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

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

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

Writes an XML start element to the given XmlTextWriter

Writer fileName
Signature: fileName:string -> XmlWriter

Creates a XmlWriter which writes to the given file name

XmlTransform stylesheetUri fileName
Signature: stylesheetUri:string -> fileName:string -> unit

Transforms a XML file using a XSL stylesheet file.

Parameters

  • stylesheetUri - The Uri for the XSL stylesheet file.
  • fileName - The XML file to transform.
XPathReplace xpath value doc
Signature: xpath:string -> value:string -> doc:XmlDocument -> XmlDocument

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

XPathReplaceInnerText (...)
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.

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

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

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

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

XPathValue 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

XslTransform xsl doc
Signature: xsl:XslCompiledTransform -> doc:XmlDocument -> XmlDocument

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

Loads the given text into a XslCompiledTransform.