Exemplo n.º 1
0
        public static XshdSyntaxDefinition LoadDefinition(XmlReader reader, bool skipValidation)
        {
            reader = HighlightingLoader.GetValidatingReader(reader, false, skipValidation ? null : SchemaSet);
            XmlDocument document = new XmlDocument();

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

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