Microsoft.Protocols.TestSuites.Common.SchemaValidation.GetTargetNamespace C# (CSharp) Method

GetTargetNamespace() private static method

This method is used to get the target namespace from a schema string.
private static GetTargetNamespace ( string fullSchema ) : string
fullSchema string The schema string
return string
        private static string GetTargetNamespace(string fullSchema)
        {
            XmlDocument xd = new XmlDocument();
            xd.LoadXml(fullSchema);
            XmlAttributeCollection attributeList = xd.DocumentElement.Attributes;
            foreach (XmlAttribute attribute in attributeList)
            {
                if (attribute.Name.Equals("targetNamespace", StringComparison.OrdinalIgnoreCase))
                {
                    return attribute.Value;
                }
            }

            return string.Empty;
        }