Esempio n. 1
0
        private RelaxngInclude ReadInclude()
        {
            RelaxngInclude i = new RelaxngInclude();

            FillLocation(i);
            expect("include");
            i.NSContext = ContextNamespace;
            string href = GetSpaceStrippedAttribute("href", String.Empty);

            if (href == null)
            {
                throw new RelaxngException("Required attribute href was not found.");
            }
            XmlResolver res = resolver != null ? resolver : new XmlUrlResolver();

            i.Href = res.ResolveUri(BaseURI != null ? new Uri(BaseURI) : null, href).AbsoluteUri;
            if (!IsEmptyElement)
            {
                Read();
                this.readGrammarIncludeContent(i.Starts, i.Defines, i.Divs, null);
                expectEnd("include");
            }
            else
            {
                Read();
            }
            return(i);
        }
Esempio n. 2
0
		private RelaxngInclude ReadInclude ()
		{
			RelaxngInclude i = new RelaxngInclude ();
			FillLocation (i);
			expect ("include");
			i.NSContext = ContextNamespace;
			string href = GetSpaceStrippedAttribute ("href", String.Empty);
			if (href == null)
				throw new RelaxngException ("Required attribute href was not found.");
			XmlResolver res = resolver != null ? resolver : new XmlUrlResolver ();
			i.Href = res.ResolveUri (BaseURI != null ? new Uri (BaseURI) : null, href).AbsoluteUri;
			if (!IsEmptyElement) {
				Read ();
				this.readGrammarIncludeContent (i.Starts, i.Defines, i.Divs, null);
				expectEnd ("include");
			}
			else
				Read ();
			return i;
		}
Esempio n. 3
0
		public void WriteInclude (RelaxngInclude include)
		{
			w.Write ("include ");
			w.Write (include.Href);

			// FIXME: optInherit?

			if (include.Starts.Count > 0 ||
				include.Defines.Count > 0 ||
				include.Divs.Count > 0) {
				w.Write ('(');
				WriteGrammarIncludeContents (include.Starts,
					include.Defines, include.Divs, null);
				w.Write (')');
			}
			w.WriteLine ();
		}