Method Parse
- Namespace
- Ubiquity.NET.Versioning
- Assembly
- Ubiquity.NET.Versioning.dll
Parse(XDocument)
Parse a ParsedBuildVersionXml from an XDocument
public static ParsedBuildVersionXml Parse(XDocument xdoc)
Parameters
xdoc
XDocumentDocument 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 Name | Description |
---|---|
BuildMajor | Major build number [default: 0] |
BuildMinor | Minor build number [default: 0] |
BuildPatch | Build Patch number [default: 0] |
PreReleaseName | Pre-Release Name [default: Empty String] |
PreReleaseNumber | Pre-Release number [default: 0] |
PreReleaseFix | Pre-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
TextReaderReader 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
stringstring 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