Redigera

Dela via


XmlConvert Class

Definition

Encodes and decodes XML names, and provides methods for converting between common language runtime types and XML Schema definition language (XSD) types. When converting data types, the values returned are locale-independent.

public ref class XmlConvert abstract sealed
public ref class XmlConvert
public static class XmlConvert
public class XmlConvert
type XmlConvert = class
Public Class XmlConvert
Inheritance
XmlConvert

Remarks

For more information about this API, see Supplemental API remarks for XmlConvert.

Constructors

XmlConvert()

Initializes a new instance of the XmlConvert class.

Methods

DecodeName(String)

Decodes a name. This method does the reverse of the EncodeName(String) and EncodeLocalName(String) methods.

EncodeLocalName(String)

Converts the name to a valid XML local name.

EncodeName(String)

Converts the name to a valid XML name.

EncodeNmToken(String)

Verifies the name is valid according to the XML specification.

IsNCNameChar(Char)

Checks whether the passed-in character is a valid non-colon character type.

IsPublicIdChar(Char)

Returns the passed-in character instance if the character in the argument is a valid public id character, otherwise null.

IsStartNCNameChar(Char)

Checks if the passed-in character is a valid Start Name Character type.

IsWhitespaceChar(Char)

Checks if the passed-in character is a valid XML whitespace character.

IsXmlChar(Char)

Checks if the passed-in character is a valid XML character.

IsXmlSurrogatePair(Char, Char)

Checks if the passed-in surrogate pair of characters is a valid XML character.

ToBoolean(String)

Converts the String to a Boolean equivalent.

ToByte(String)

Converts the String to a Byte equivalent.

ToChar(String)

Converts the String to a Char equivalent.

ToDateTime(String)
Obsolete.
Obsolete.

Converts the String to a DateTime equivalent.

ToDateTime(String, String)

Converts the String to a DateTime equivalent.

ToDateTime(String, String[])

Converts the String to a DateTime equivalent.

ToDateTime(String, XmlDateTimeSerializationMode)

Converts the String to a DateTime using the XmlDateTimeSerializationMode specified.

ToDateTimeOffset(String)

Converts the supplied String to a DateTimeOffset equivalent.

ToDateTimeOffset(String, String)

Converts the supplied String to a DateTimeOffset equivalent.

ToDateTimeOffset(String, String[])

Converts the supplied String to a DateTimeOffset equivalent.

ToDecimal(String)

Converts the String to a Decimal equivalent.

ToDouble(String)

Converts the String to a Double equivalent.

ToGuid(String)

Converts the String to a Guid equivalent.

ToInt16(String)

Converts the String to a Int16 equivalent.

ToInt32(String)

Converts the String to a Int32 equivalent.

ToInt64(String)

Converts the String to a Int64 equivalent.

ToSByte(String)

Converts the String to a SByte equivalent.

ToSingle(String)

Converts the String to a Single equivalent.

ToString(Boolean)

Converts the Boolean to a String.

ToString(Byte)

Converts the Byte to a String.

ToString(Char)

Converts the Char to a String.

ToString(DateTime)
Obsolete.
Obsolete.

Converts the DateTime to a String.

ToString(DateTime, String)

Converts the DateTime to a String.

ToString(DateTime, XmlDateTimeSerializationMode)

Converts the DateTime to a String using the XmlDateTimeSerializationMode specified.

ToString(DateTimeOffset)

Converts the supplied DateTimeOffset to a String.

ToString(DateTimeOffset, String)

Converts the supplied DateTimeOffset to a String in the specified format.

ToString(Decimal)

Converts the Decimal to a String.

ToString(Double)

Converts the Double to a String.

ToString(Guid)

Converts the Guid to a String.

ToString(Int16)

Converts the Int16 to a String.

ToString(Int32)

Converts the Int32 to a String.

ToString(Int64)

Converts the Int64 to a String.

ToString(SByte)

Converts the SByte to a String.

ToString(Single)

Converts the Single to a String.

ToString(TimeSpan)

Converts the TimeSpan to a String.

ToString(UInt16)

Converts the UInt16 to a String.

ToString(UInt32)

Converts the UInt32 to a String.

ToString(UInt64)

Converts the UInt64 to a String.

ToTimeSpan(String)

Converts the String to a TimeSpan equivalent.

ToUInt16(String)

Converts the String to a UInt16 equivalent.

ToUInt32(String)

Converts the String to a UInt32 equivalent.

ToUInt64(String)

Converts the String to a UInt64 equivalent.

VerifyName(String)

Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation.

VerifyNCName(String)

Verifies that the name is a valid NCName according to the W3C Extended Markup Language recommendation. An NCName is a name that cannot contain a colon.

VerifyNMTOKEN(String)

Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation.

VerifyPublicId(String)

Returns the passed in string instance if all the characters in the string argument are valid public id characters.

VerifyTOKEN(String)

Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation.

VerifyWhitespace(String)

Returns the passed-in string instance if all the characters in the string argument are valid whitespace characters.

VerifyXmlChars(String)

Returns the passed-in string if all the characters and surrogate pair characters in the string argument are valid XML characters, otherwise an XmlException is thrown with information on the first invalid character encountered.

Applies to