Opc.Ua.XmlDecoder.ReadXmlElement C# (CSharp) Method

ReadXmlElement() public method

Reads an XmlElement from the stream.
public ReadXmlElement ( string fieldName ) : XmlElement
fieldName string
return System.Xml.XmlElement
        public XmlElement ReadXmlElement(string fieldName)
        {
            if (BeginField(fieldName, true))
            {
                if (MoveToElement(null))
                {
                    XmlDocument document = new XmlDocument();
                    XmlElement value = document.CreateElement(m_reader.Prefix, m_reader.LocalName, m_reader.NamespaceURI);
                    document.AppendChild(value);

                    if (m_reader.MoveToFirstAttribute())
                    {
                        do
                        {
                            XmlAttribute attribute = document.CreateAttribute(m_reader.Name);
                            attribute.Value = m_reader.Value;
                            value.Attributes.Append(attribute);
                        }
                        while (m_reader.MoveToNextAttribute());

                        m_reader.MoveToContent();
                    }

                    value.InnerXml = m_reader.ReadInnerXml();
                    
                    EndField(fieldName);
                    return value;
                }
            }

            return null;
        }