In Windows store app, the types 'XmlNode' and 'XmlElement ' does not exist

While developing Windows store app, I got to know that the types 'System.Xml.XmlNode' and 'System.Xml.XmlElement ' does not exist. Following code is giving error.

public static XmlElement GetElement(XmlElement parent, string elementName, string namespaceURI)
        {
            foreach (XmlNode x in parent.ChildNodes)
            {
                if (x.NodeType == XmlNodeType.Element && x.Name.Equals(elementName) && x.NamespaceURI.Equals(namespaceURI))
                    return (XmlElement)x;
            }

            return null;
        }

Error:

The type or namespace name 'XmlElement' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?)

Please let me know is there any replacement of these classes in .NetCore.

Answers


I would convert to using Linq to XML which is described here.

Its not a perfect replacement for the DOM API, but it is supported on many platforms.


Need Your Help

rails 3.2 development mode is not displaying the full error page with backtrace etc

ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.2

I just upgraded to rails 3.2 Everything is working fine except error pages no longer show the normal development debug info. Instead it's showing the standard production error page (white backgroun...

in C#/Powershell - Is it possible to change the Idle TimeOut for an IIS Application Pool?

c# iis powershell

I want to disable the idle timeout (Set it to Zero) of an application pool and I want to perform this at setup time, is it possible to perform this action from C# or PowerShell?