Esempio n. 1
0
        public override bool Read()
        {
            if (EOF)
            {
                return(false);
            }

            if (Reader == initial_reader)
            {
                SetupPrimaryReader();
            }

            if (part_reader != null)
            {
                part_reader = null;
            }

            if (!Reader.Read())
            {
                xml_reader = eof_reader;
                return(false);
            }
            if (Reader.LocalName == "Include" && Reader.NamespaceURI == "http://www.w3.org/2004/08/xop/include")
            {
                string cid = Reader.GetAttribute("href");
                if (!cid.StartsWith("cid:"))
                {
                    throw new XmlException("Cannot resolve non-cid href attribute value in XOP Include element");
                }
                cid = cid.Substring(4);
                if (!readers.ContainsKey(cid))
                {
                    ReadToIdentifiedStream(cid);
                }
                part_reader = new MultiPartedXmlReader(Reader, readers [cid]);
            }
            return(true);
        }
Esempio n. 2
0
		public override bool Read ()
		{
			if (EOF)
				return false;

			if (Reader == initial_reader)
				SetupPrimaryReader ();

			if (part_reader != null)
				part_reader = null;

			if (!Reader.Read ()) {
				xml_reader = eof_reader;
				return false;
			}
			if (Reader.LocalName == "Include" && Reader.NamespaceURI == "http://www.w3.org/2004/08/xop/include") {
				string cid = Reader.GetAttribute ("href");
				if (!cid.StartsWith ("cid:"))
					throw new XmlException ("Cannot resolve non-cid href attribute value in XOP Include element");
				cid = cid.Substring (4);
				if (!readers.ContainsKey (cid))
					ReadToIdentifiedStream (cid);
				part_reader = new MultiPartedXmlReader (Reader, readers [cid]);
			}
			return true;
		}