示例#1
0
        public bool AddReader(XmlReader csdlReader, string source = null)
        {
            // If source is determined (empty means no source), use source;
            // otherwise try to use BaseURI from XmlReader.
            string artifactPath = source ?? csdlReader.BaseURI;

            // Create a new CsdlDocumentParser to parse a single CSDL document.
            CsdlDocumentParser docParser = new CsdlDocumentParser(artifactPath, csdlReader);

            // Initialize the parser and continue if a valid root element was found
            docParser.ParseDocumentElement();

            // Do not move on to other readers if errors were encountered
            this.success &= !docParser.HasErrors;

            // Gather any errors that occured, regardless of success
            this.errorsList.AddRange(docParser.Errors);

            if (docParser.Result != null)
            {
                this.result.AddSchema(docParser.Result.Value);
            }

            return this.success;
        }
示例#2
0
        public bool AddReader(XmlReader csdlReader, string source = null)
        {
            // If source is determined (empty means no source), use source;
            // otherwise try to use BaseURI from XmlReader.
            string artifactPath = source ?? csdlReader.BaseURI;

            // Create a new CsdlDocumentParser to parse a single CSDL document.
            CsdlDocumentParser docParser = new CsdlDocumentParser(artifactPath, csdlReader);

            // Initialize the parser and continue if a valid root element was found
            docParser.ParseDocumentElement();

            // Do not move on to other readers if errors were encountered
            this.success &= !docParser.HasErrors;

            // Gather any errors that occurred, regardless of success
            this.errorsList.AddRange(docParser.Errors);

            if (docParser.Result != null)
            {
                this.result.AddSchema(docParser.Result.Value);
            }

            return(this.success);
        }
示例#3
0
		public bool AddReader(XmlReader csdlReader)
		{
			string baseURI = csdlReader.BaseURI;
			string empty = baseURI;
			if (baseURI == null)
			{
				empty = string.Empty;
			}
			string str = empty;
			CsdlDocumentParser csdlDocumentParser = new CsdlDocumentParser(str, csdlReader);
			csdlDocumentParser.ParseDocumentElement();
			CsdlParser hasErrors = this;
			hasErrors.success = hasErrors.success & !csdlDocumentParser.HasErrors;
			this.errorsList.AddRange(csdlDocumentParser.Errors);
			if (csdlDocumentParser.Result != null)
			{
				this.result.AddSchema(csdlDocumentParser.Result.Value);
			}
			return this.success;
		}
示例#4
0
        public bool AddReader(XmlReader csdlReader)
        {
            string baseURI = csdlReader.BaseURI;
            string empty   = baseURI;

            if (baseURI == null)
            {
                empty = string.Empty;
            }
            string             str = empty;
            CsdlDocumentParser csdlDocumentParser = new CsdlDocumentParser(str, csdlReader);

            csdlDocumentParser.ParseDocumentElement();
            CsdlParser hasErrors = this;

            hasErrors.success = hasErrors.success & !csdlDocumentParser.HasErrors;
            this.errorsList.AddRange(csdlDocumentParser.Errors);
            if (csdlDocumentParser.Result != null)
            {
                this.result.AddSchema(csdlDocumentParser.Result.Value);
            }
            return(this.success);
        }
示例#5
0
        public bool AddReader(XmlReader csdlReader)
        {
            string artifactPath = csdlReader.BaseURI ?? string.Empty;

            // Create a new CsdlDocumentParser to parse a single CSDL document.
            CsdlDocumentParser docParser = new CsdlDocumentParser(artifactPath, csdlReader);

            // Initialize the parser and continue if a valid root element was found
            docParser.ParseDocumentElement();

            // Do not move on to other readers if errors were encountered
            this.success &= !docParser.HasErrors;

            // Gather any errors that occured, regardless of success
            this.errorsList.AddRange(docParser.Errors);

            if (docParser.Result != null)
            {
                this.result.AddSchema(docParser.Result.Value);
            }

            return(this.success);
        }
示例#6
0
        public bool AddReader(XmlReader csdlReader)
        {
            string artifactPath = csdlReader.BaseURI ?? string.Empty;

            // Create a new CsdlDocumentParser to parse a single CSDL document.
            CsdlDocumentParser docParser = new CsdlDocumentParser(artifactPath, csdlReader);

            // Initialize the parser and continue if a valid root element was found
            docParser.ParseDocumentElement();

            // Do not move on to other readers if errors were encountered
            this.success &= !docParser.HasErrors;

            // Gather any errors that occured, regardless of success
            this.errorsList.AddRange(docParser.Errors);

            if (docParser.Result != null)
            {
                this.result.AddSchema(docParser.Result.Value);
            }

            return this.success;
        }