LiquidTechnologies.XmlObjects Namespace / LxSerializer Class / DeserializeSnippet Method / DeserializeSnippet(XmlReader,Type,XmlQualifiedName,LxReaderSettings) Method
The System.Xml.XmlReader to read the XML data from
The data read from xmlReader will be de-serialized into an object of this type. If it represents a xs:complexType and the XML data contains an xsi:type attribute then the appropriate class will be created to de-serialize the data into. If the type represents an xs:element and the XML data contains an xsi:type attribute then the appropriate class will be created to de-serialize the data into.
Returns the qualified name of the root element, this is useful when the root element contains an xsi:type attribute as the returned class will represent a xs:complexType which is not bound to an element name. The value of rootElementQName can then be used in Serialize in order to re-construct the correct XML data.
Settings to control how the data is de-serialized

In This Topic
    DeserializeSnippet(XmlReader,Type,XmlQualifiedName,LxReaderSettings) Method
    In This Topic
    De-serializes a section of an XML document, creating a class populated with the data from the XmlReader. The de-serialized type (targetObjectType) can represent an xs:element or xs:complexType.
    Syntax
    'Declaration
     
    
    Public Overloads Function DeserializeSnippet( _
       ByVal xmlReader As System.Xml.XmlReader, _
       ByVal targetObjectType As System.Type, _
       ByRef rootElementQName As System.Xml.XmlQualifiedName, _
       Optional ByVal settings As LxReaderSettings _
    ) As System.Object
    public System.object DeserializeSnippet( 
       System.Xml.XmlReader xmlReader,
       System.Type targetObjectType,
       out System.Xml.XmlQualifiedName rootElementQName,
       LxReaderSettings settings
    )

    Parameters

    xmlReader
    The System.Xml.XmlReader to read the XML data from
    targetObjectType
    The data read from xmlReader will be de-serialized into an object of this type. If it represents a xs:complexType and the XML data contains an xsi:type attribute then the appropriate class will be created to de-serialize the data into. If the type represents an xs:element and the XML data contains an xsi:type attribute then the appropriate class will be created to de-serialize the data into.
    rootElementQName
    Returns the qualified name of the root element, this is useful when the root element contains an xsi:type attribute as the returned class will represent a xs:complexType which is not bound to an element name. The value of rootElementQName can then be used in Serialize in order to re-construct the correct XML data.
    settings
    Settings to control how the data is de-serialized

    Return Value

    The de-serialized object, will be of type targetObjectType or derived from it.
    Exceptions
    ExceptionDescription
    General errors
    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows Server 2016, Windows Server 2012, Windows Server 2008. Please ensure you have the latest Service Pack for your operating system installed.

    See Also