Beispiel #1
0
        //static XmlSchemaSet schemaSet;

        //static XmlSchemaSet SchemaSet {
        //	get {
        //		if (schemaSet == null) {
        //			schemaSet = HighlightingLoader.LoadSchemaSet(new XmlTextReader(
        //				Resources.OpenStream("ModeV1.xsd")));
        //		}
        //		return schemaSet;
        //	}
        //}

        public static XshdSyntaxDefinition LoadDefinition(XmlReader reader, bool skipValidation)
        {
            reader = HighlightingLoader.GetValidatingReader(reader, false);
            XmlDocument document = new XmlDocument();

            document.Load(reader);
            V1Loader loader = new V1Loader();

            return(loader.ParseDefinition(document.DocumentElement));
        }
Beispiel #2
0
 internal static XshdSyntaxDefinition LoadXshd(XmlReader reader, bool skipValidation)
 {
     if (reader == null)
     {
         throw new ArgumentNullException(nameof(reader));
     }
     try
     {
         reader.MoveToContent();
         if (reader.NamespaceURI == V2Loader.Namespace)
         {
             return(V2Loader.LoadDefinition(reader, skipValidation));
         }
         else
         {
             return(V1Loader.LoadDefinition(reader, skipValidation));
         }
     }
     catch (XmlException ex)
     {
         throw WrapException(ex, ex.LineNumber, ex.LinePosition);
     }
 }