Skip to content

Xml Class ​

Definition ​

Contains a set of utility methods for working with XML data.

  • Namespace: JASE.Serializers
  • Assembly: JASE.Serializers.dll

Methods ​

NameDescription
T Deserialize(string input)Deserializes the specified XML string into an instance of the specified type.
object Deserialize(string input, Type type, bool exceptOnUnknownElement = null)Deserializes the specified XML string into an object of the specified type.
XElement FindXElement(XDocument document, string elementName, bool caseSensitive = null)Finds the first XElement that matches the specified element name within the given XDocument object.
XElement FindXElement(XElement start, string elementName, bool caseSensitive = null)Finds the first XElement that matches the specified element name within the given XElement object.
XElement FindXElement(string xml, string elementName, bool caseSensitive = null)Finds the first XElement that matches the specified element name within the given XML string or XElement object.
T FromXML(string input, bool exceptOnUnknownElement = null)Convert XML string to Generic defined Type
object FromXML(string input, Type type, bool exceptOnUnknownElement = null)Convert XML string to requested Type
XDocument GetXDocument(XPathNavigator navigator, bool moveToRoot = null)Converts an XPathNavigator to an XDocument object, optionally moves it to the document root
XDocument GetXDocument(object obj, Dictionary<string, string> xmlNameSpaces = null)Converts an object to an XDocument instance.
XDocument GetXDocument(string xml)Converts the input string into an XDocument object
bool IsXElementNil(XElement element)Examines the attributes of the XElement to determine if it is decorated as being nil/null
string Prettify(string input, bool omitDeclaration = null, bool newLineOnAttributes = null)Convert input XML into prettified (indented) version
XElement SelectXElement(XDocument doc, string select)Selects the first XElement that matches the specified XPath expression in the specified XDocument object.
string Serialize(object input, bool omitDeclaration = null, bool prettify = null, bool newLineOnAttributes = null, Dictionary<string, string> namespaces = null)Serialize object to XML
XElement SoapGetMethodElement(string xml)Finds the first method element within a SOAP message XML.
string SoapGetMethodName(string xml)Find name of SOAP method called
string SoapGetMethodParameter(string xml, string parameter)Finds the XML string representation of a specified method parameter within a SOAP message.
string SoapGetMethodParameterValue(string xml, string search)Finds the string value of a specified method parameter within a SOAP message.
XDocument ToXDocument(string xml)Parse input XML into an XDocument
string ToXml(object input, bool omitDeclaration = null, bool prettify = null, bool newLineOnAttributes = null, Dictionary<string, string> namespaces = null)Serialize object to XML
T TransformObject(object obj)Use Xml to convert object from one datatype to another, at times this is useful in consuming web services
bool Validate(string input)Validate the input string as being valid XML content