Table of Contents

Method Parse

Namespace
Ubiquity.NET.Versioning
Assembly
Ubiquity.NET.Versioning.dll

Parse(XDocument)

public static ParsedBuildVersionXml Parse(XDocument xdoc)

Parameters

xdoc XDocument

Document to parse

Returns

ParsedBuildVersionXml

Parsed version information

Remarks

This is the core of the parsing support, all of the other overloads and parsing methods ultimately call this to perform the actual parsing of XML data.

The schema requirements of the XML file are fairly simple. It consists of a single element 'BuildVersionData' which has a number of optional attributes:

Attribute NameDescription
BuildMajorMajor build number [default: 0]
BuildMinorMinor build number [default: 0]
BuildPatchBuild Patch number [default: 0]
PreReleaseNamePre-Release Name [default: Empty String]
PreReleaseNumberPre-Release number [default: 0]
PreReleaseFixPre-Release fix number [default: 0]

Other elements are ignored, Though other attributes on the 'BuildVersionData' result in an exception.

Exceptions

FormatException

Data format of the document is not valid

InvalidDataException

Attribute for the "BuildVersionData" element is not known

Parse(TextReader)

Parse Build version XML from a TextReader

public static ParsedBuildVersionXml Parse(TextReader reader)

Parameters

reader TextReader

Reader to parse data from

Returns

ParsedBuildVersionXml

Parsed version information

See Also

Parse(string)

Parse XML from an input string

public static ParsedBuildVersionXml Parse(string xmlTxt)

Parameters

xmlTxt string

string form of the XML text

Returns

ParsedBuildVersionXml

Parsed version information

Remarks

This is mostly used for internal testing where the XML is a string constant/literal.

See Also