Show / Hide Table of Contents

Class XmlSpecsHelper

Static Helper Class which contains a set of Functions which model Name and Character validations as laid out in the W3C XML and XML Namespaces specification.

Inheritance
object
XmlSpecsHelper
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public static class XmlSpecsHelper
Remarks

These are needed in the XML/RDF Parser

Also contains the Date Time format string used to format .Net's DateTime type into a String whose format conforms to the XML Schema Datatypes specification.

Fields

| Edit this page View Source

NamespaceXml

Namespace for XML.

Declaration
public const string NamespaceXml = "http://www.w3.org/XML/1998/namespace"
Field Value
Type Description
string
| Edit this page View Source

NamespaceXmlNamespaces

Namespace for XML Namespaces.

Declaration
public const string NamespaceXmlNamespaces = "http://www.w3.org/2000/xmlns/"
Field Value
Type Description
string
| Edit this page View Source

NamespaceXmlSchema

Namespace for XML Schema.

Declaration
public const string NamespaceXmlSchema = "http://www.w3.org/2001/XMLSchema#"
Field Value
Type Description
string
| Edit this page View Source

SupportedTypes

Array of Constants for Data Types that are supported by the Literal Node CompareTo method.

Declaration
public static string[] SupportedTypes
Field Value
Type Description
string[]
| Edit this page View Source

XmlSchemaDataTypeAnyUri

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeAnyUri = "http://www.w3.org/2001/XMLSchema#anyURI"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeBase64Binary

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeBase64Binary = "http://www.w3.org/2001/XMLSchema#base64Binary"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeBoolean

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeBoolean = "http://www.w3.org/2001/XMLSchema#boolean"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeByte

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeByte = "http://www.w3.org/2001/XMLSchema#byte"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeDate

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeDate = "http://www.w3.org/2001/XMLSchema#date"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeDateTime

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeDateTime = "http://www.w3.org/2001/XMLSchema#dateTime"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeDayTimeDuration

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeDayTimeDuration = "http://www.w3.org/2001/XMLSchema#dayTimeDuration"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeDecimal

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeDecimal = "http://www.w3.org/2001/XMLSchema#decimal"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeDouble

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeDouble = "http://www.w3.org/2001/XMLSchema#double"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeDuration

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeDuration = "http://www.w3.org/2001/XMLSchema#duration"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeFloat

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeFloat = "http://www.w3.org/2001/XMLSchema#float"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeHexBinary

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeHexBinary = "http://www.w3.org/2001/XMLSchema#hexBinary"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeInt

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeInt = "http://www.w3.org/2001/XMLSchema#int"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeInteger

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeInteger = "http://www.w3.org/2001/XMLSchema#integer"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeLong

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeLong = "http://www.w3.org/2001/XMLSchema#long"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeNegativeInteger

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeNegativeInteger = "http://www.w3.org/2001/XMLSchema#negativeInteger"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeNonNegativeInteger

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeNonNegativeInteger = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeNonPositiveInteger

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeNonPositiveInteger = "http://www.w3.org/2001/XMLSchema#nonPositiveInteger"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypePositiveInteger

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypePositiveInteger = "http://www.w3.org/2001/XMLSchema#positiveInteger"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeShort

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeShort = "http://www.w3.org/2001/XMLSchema#short"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeString

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeString = "http://www.w3.org/2001/XMLSchema#string"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeTime

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeTime = "http://www.w3.org/2001/XMLSchema#time"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeUnsignedByte

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeUnsignedByte = "http://www.w3.org/2001/XMLSchema#unsignedByte"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeUnsignedInt

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeUnsignedInt = "http://www.w3.org/2001/XMLSchema#unsignedInt"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeUnsignedLong

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeUnsignedLong = "http://www.w3.org/2001/XMLSchema#unsignedLong"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeUnsignedShort

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeUnsignedShort = "http://www.w3.org/2001/XMLSchema#unsignedShort"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeYear

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeYear = "http://www.w3.org/2001/XMLSchema#gYear"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDataTypeYearMonth

Data Type Uri Constants for XML Schema Data Types.

Declaration
public const string XmlSchemaDataTypeYearMonth = "http://www.w3.org/2001/XMLSchema#gYearMonth"
Field Value
Type Description
string
| Edit this page View Source

XmlSchemaDateFormat

Date Time Formatting string which meets the specified format for xsd:date.

Declaration
public const string XmlSchemaDateFormat = "yyyy-MM-ddK"
Field Value
Type Description
string
Remarks

Use with the DateTime.ToString() method to format a DateTime into appropriate string format.

| Edit this page View Source

XmlSchemaDateRegex

A permissive regular expression that matches the structure of xsd:date.

Declaration
public static Regex XmlSchemaDateRegex
Field Value
Type Description
Regex
Remarks

This regular expression does not catch out-of-range errors on any of the date components.

| Edit this page View Source

XmlSchemaDateTimeFormat

Date Time Formatting string which meets the specified format for xsd:dateTime.

Declaration
public const string XmlSchemaDateTimeFormat = "yyyy-MM-dd\\THH:mm:ss.ffffffK"
Field Value
Type Description
string
Remarks

Use with the DateTime.ToString() method to format a DateTime into appropriate string format.

| Edit this page View Source

XmlSchemaDateTimeFormatImprecise

Date Time Formatting string which meets the specified format for xsd:dateTime, this formatting string is imprecise in the sense that it does not preserve the fractional seconds.

Declaration
public const string XmlSchemaDateTimeFormatImprecise = "yyyy-MM-dd\\THH:mm:ssK"
Field Value
Type Description
string
Remarks

Use with the DateTime.ToString() method to format a DateTime into appropriate string format.

| Edit this page View Source

XmlSchemaDateTimeRegex

A permissive regular expression that matches the structure of xsd:dateTime.

Declaration
public static Regex XmlSchemaDateTimeRegex
Field Value
Type Description
Regex
Remarks

This regular expression does not catch out-of-range errors on any of the date or time components.

| Edit this page View Source

XmlSchemaDurationRegex

A permissive regular expression that matches the structure of the lexical space for an XML Schema Duration.

Declaration
public static Regex XmlSchemaDurationRegex
Field Value
Type Description
Regex
Remarks

This regular expression will match certain invalid constructs, in particular a duration with a T followed by no time components.

| Edit this page View Source

XmlSchemaTimeFormat

Date Time Formatting string which meets the the specified format for xsd:time.

Declaration
public const string XmlSchemaTimeFormat = "HH:mm:ss.ffffffK"
Field Value
Type Description
string
Remarks

Use with the DateTime.ToString() method to format a DateTime into appropriate string format.

| Edit this page View Source

XmlSchemaTimeFormatImprecise

Date Time Formatting string which meets the the specified format for xsd:time, this formatting string is imprecise in the sense that it does not preserve the fractional seconds.

Declaration
public const string XmlSchemaTimeFormatImprecise = "HH:mm:ssK"
Field Value
Type Description
string
Remarks

Use with the DateTime.ToString() method to format a DateTime into appropriate string format.

| Edit this page View Source

XmlSchemaTimeRegex

A permissive regular expression that matches the structure of xsd:time.

Declaration
public static Regex XmlSchemaTimeRegex
Field Value
Type Description
Regex
Remarks

This regular expression does not catch out-of-range errors on any of the time components.

| Edit this page View Source

XmlSchemaYearMonthRegex

A permissive regular expression that matches the structure of xsd:gMonthYear.

Declaration
public static Regex XmlSchemaYearMonthRegex
Field Value
Type Description
Regex
| Edit this page View Source

XmlSchemaYearRegex

A permissive regular expression that matches the structure of xsd:gYear.

Declaration
public static Regex XmlSchemaYearRegex
Field Value
Type Description
Regex

Methods

| Edit this page View Source

GetCompatibleSupportedDataType(string, string)

Gets the Compatible Supported Data Type for the two Data Types.

Declaration
public static string GetCompatibleSupportedDataType(string type1, string type2)
Parameters
Type Name Description
string type1

A Data Type.

string type2

A Data Type.

Returns
Type Description
string
Remarks

Currently this is only immplemented sufficiently for the types it needs to know are compatible for implementing SPARQL equality and ordering semantics.

| Edit this page View Source

GetCompatibleSupportedDataType(string, string, bool)

Gets the Compatible Supported Data Type for the two Data Types.

Declaration
public static string GetCompatibleSupportedDataType(string type1, string type2, bool widen)
Parameters
Type Name Description
string type1

A Data Type.

string type2

A Data Type.

bool widen

Whether the compatible type should be the wider type.

Returns
Type Description
string
Remarks

Currently this is only immplemented sufficiently for the types it needs to know are compatible for implementing SPARQL equality and ordering semantics.

| Edit this page View Source

GetCompatibleSupportedDataType(INode, INode)

Gets the Compatible Supported Data Type assuming the two Nodes are Literals with support types and that those types are compatible.

Declaration
public static string GetCompatibleSupportedDataType(INode x, INode y)
Parameters
Type Name Description
INode x

A Node.

INode y

A Node.

Returns
Type Description
string
Remarks

Currently this is only immplemented sufficiently for the types it needs to know are compatible for implementing SPARQL equality and ordering semantics.

| Edit this page View Source

GetCompatibleSupportedDataType(INode, INode, bool)

Gets the Compatible Supported Data Type assuming the two Nodes are Literals with support types and that those types are compatible.

Declaration
public static string GetCompatibleSupportedDataType(INode x, INode y, bool widen)
Parameters
Type Name Description
INode x

A Node.

INode y

A Node.

bool widen

Whether the compatible type should be the wider type.

Returns
Type Description
string
Remarks

Currently this is only immplemented sufficiently for the types it needs to know are compatible for implementing SPARQL equality and ordering semantics.

| Edit this page View Source

GetSupportedDataType(INode)

Gets the Data Type Uri of the given Node if it has a supported type.

Declaration
public static string GetSupportedDataType(INode n)
Parameters
Type Name Description
INode n

Node.

Returns
Type Description
string
Remarks

Only ILiteralNode's can have a Data Type.

The function only returns the Data Type Uri (as a String) if the Data Type of the Literal is one of the supported Data Types.

| Edit this page View Source

IsNCName(string)

Returns whether a String is a NCName as defined by the W3C XML Namespaces Specification.

Declaration
public static bool IsNCName(string name)
Parameters
Type Name Description
string name

String to test.

Returns
Type Description
bool
| Edit this page View Source

IsName(string)

Returns whether a String is a Name as defined by the W3C XML Specification.

Declaration
public static bool IsName(string name)
Parameters
Type Name Description
string name

String to test.

Returns
Type Description
bool
| Edit this page View Source

IsNameChar(char)

Returns whether a Character is a NameChar as defined by the W3C XML Specification.

Declaration
public static bool IsNameChar(char c)
Parameters
Type Name Description
char c

Character to Test.

Returns
Type Description
bool
| Edit this page View Source

IsNameStartChar(char)

Returns whether a Character is a NameChar as defined by the W3C XML Specification.

Declaration
public static bool IsNameStartChar(char c)
Parameters
Type Name Description
char c

Character to test.

Returns
Type Description
bool
| Edit this page View Source

IsSupportedType(string)

Returns whether the given Type refers to one of the types supported by the LiteralNode CompareTo method.

Declaration
public static bool IsSupportedType(string type)
Parameters
Type Name Description
string type

Data Type Uri.

Returns
Type Description
bool
| Edit this page View Source

IsSupportedType(Uri)

Returns whether the given Type refers to one of the types supported by the LiteralNode CompareTo method.

Declaration
public static bool IsSupportedType(Uri type)
Parameters
Type Name Description
Uri type

Data Type Uri.

Returns
Type Description
bool
| Edit this page View Source

TryGetCompatibleSupportedDataType(string, string, bool, out string)

Attempts to get the compatible datatype for the two specified data types.

Declaration
public static bool TryGetCompatibleSupportedDataType(string type1, string type2, bool widen, out string compatibleDataType)
Parameters
Type Name Description
string type1

A data type IRI string.

string type2

A data type IRI string.

bool widen

Whether the compatible data type should be the wider type.

string compatibleDataType

Receives the IRI of the compatible data type, if any.

Returns
Type Description
bool

True if a compatible datatype could be found for the two data types, false otherwise.

| Edit this page View Source

TryGetCompatibleSupportedDataType(string, string, out string)

Attempts to get the compatible datatype for the two specified data types.

Declaration
public static bool TryGetCompatibleSupportedDataType(string type1, string type2, out string compatibleDataType)
Parameters
Type Name Description
string type1

A data type IRI string.

string type2

A data type IRI string.

string compatibleDataType

Receives the IRI of the compatible data type, if any.

Returns
Type Description
bool

True if a compatible datatype could be found for the two data types, false otherwise.

  • Edit this page
  • View Source
In this article
  • Fields
    • NamespaceXml
    • NamespaceXmlNamespaces
    • NamespaceXmlSchema
    • SupportedTypes
    • XmlSchemaDataTypeAnyUri
    • XmlSchemaDataTypeBase64Binary
    • XmlSchemaDataTypeBoolean
    • XmlSchemaDataTypeByte
    • XmlSchemaDataTypeDate
    • XmlSchemaDataTypeDateTime
    • XmlSchemaDataTypeDayTimeDuration
    • XmlSchemaDataTypeDecimal
    • XmlSchemaDataTypeDouble
    • XmlSchemaDataTypeDuration
    • XmlSchemaDataTypeFloat
    • XmlSchemaDataTypeHexBinary
    • XmlSchemaDataTypeInt
    • XmlSchemaDataTypeInteger
    • XmlSchemaDataTypeLong
    • XmlSchemaDataTypeNegativeInteger
    • XmlSchemaDataTypeNonNegativeInteger
    • XmlSchemaDataTypeNonPositiveInteger
    • XmlSchemaDataTypePositiveInteger
    • XmlSchemaDataTypeShort
    • XmlSchemaDataTypeString
    • XmlSchemaDataTypeTime
    • XmlSchemaDataTypeUnsignedByte
    • XmlSchemaDataTypeUnsignedInt
    • XmlSchemaDataTypeUnsignedLong
    • XmlSchemaDataTypeUnsignedShort
    • XmlSchemaDataTypeYear
    • XmlSchemaDataTypeYearMonth
    • XmlSchemaDateFormat
    • XmlSchemaDateRegex
    • XmlSchemaDateTimeFormat
    • XmlSchemaDateTimeFormatImprecise
    • XmlSchemaDateTimeRegex
    • XmlSchemaDurationRegex
    • XmlSchemaTimeFormat
    • XmlSchemaTimeFormatImprecise
    • XmlSchemaTimeRegex
    • XmlSchemaYearMonthRegex
    • XmlSchemaYearRegex
  • Methods
    • GetCompatibleSupportedDataType(string, string)
    • GetCompatibleSupportedDataType(string, string, bool)
    • GetCompatibleSupportedDataType(INode, INode)
    • GetCompatibleSupportedDataType(INode, INode, bool)
    • GetSupportedDataType(INode)
    • IsNCName(string)
    • IsName(string)
    • IsNameChar(char)
    • IsNameStartChar(char)
    • IsSupportedType(string)
    • IsSupportedType(Uri)
    • TryGetCompatibleSupportedDataType(string, string, bool, out string)
    • TryGetCompatibleSupportedDataType(string, string, out string)
Back to top Generated by DocFX