Xsemmel/Schema/XsdValidationHelper.cs
/// <summary>
/// Gets the filename of the declared XSD
/// </summary>
/// <param name="xmldoc"></param>
/// <param name="currentDirectory"></param>
/// <returns></returns>
Gets the filename of the declared XSD
Gets the filename of the declared XSD
public static string GetXsdFile(XmlDocument xmldoc, string currentDirectory)
        {
            var doc = xmldoc.DocumentElement;
            if (doc != null)
            {
                foreach (XmlAttribute attr in doc.Attributes)
                {
                    string value = attr.Value;
                    if (value.ToLower().EndsWith(".xsd"))
                    {
                        List<ConfigObj.XsdMapItem> items = XSConfiguration.Instance.Config.XsdMapping;
                        foreach (ConfigObj.XsdMapItem xsdMapItem in items)
                        {
                            if (string.Compare(xsdMapItem.Name, value, true) == 0)
                            {
                                value = xsdMapItem.Mapping;
                                break;
                            }
                        }
                        value = Path.Combine(currentDirectory, value);
                        return value;
                    }
                }
            }
            return null;
        }
public static string GetXsdFile ( XmlDocument xmldoc , string currentDirectory ) { var doc = xmldoc . DocumentElement ; if ( doc != null ) { foreach ( XmlAttribute attr in doc . Attributes ) { string value = attr . Value ; if ( value . ToLower ( ) . EndsWith ( " " ) ) { List < ConfigObj . XsdMapItem > items = XSConfiguration . Instance . Config . XsdMapping ; foreach ( ConfigObj . XsdMapItem xsdMapItem in items ) { if ( string . Compare ( xsdMapItem . Name , value , true ) == 0 ) { value = xsdMapItem . Mapping ; break ; } } value = Path . Combine ( currentDirectory , value ) ; return value ; } } } return null ; }
Gets the filename of the declared XSD
Gets the filename of the declared XSD
None
xmldoc
XmlDocument
None
currentDirectory
string
None