Exemple #1
0
		public void Parse1 ()
		{
			XmlNamespaceManager nsMgr = new MyNS (XmlReader.Create (new StringReader (empty)));
			nsMgr.AddNamespace ("foo", "bar");
			XmlParserContext inputContext = new XmlParserContext (null, nsMgr, null, XmlSpace.None);

			XmlReader xr = XmlReader.Create (new StringReader (xmlstr), new XmlReaderSettings (), inputContext);
			while (xr.Read ()) {}
		}
Exemple #2
0
		public void Parse3 ()
		{
			XmlNamespaceManager nsMgr = new MyNS (XmlReader.Create (new StringReader (empty)));
			XmlParserContext inputContext = new XmlParserContext (null, nsMgr, null, XmlSpace.None);
			XmlReader xr = XmlReader.Create (new StringReader (xmlstr), new XmlReaderSettings (), inputContext);
			XmlNamespaceManager aMgr = new MyNS (xr);
			XmlParserContext inputContext2 = new XmlParserContext(null, aMgr, null, XmlSpace.None);

			XmlReader xr2 = XmlReader.Create (new StringReader (xmlstr2), new XmlReaderSettings (), inputContext2);
			Assert.Throws<XmlException> (delegate {
				while (xr2.Read ()) {}
			}, "null");
		}
        public void Parse1()
        {
            XmlNamespaceManager nsMgr = new MyNS(XmlReader.Create(new StringReader(empty)));

            nsMgr.AddNamespace("foo", "bar");
            XmlParserContext inputContext = new XmlParserContext(null, nsMgr, null, XmlSpace.None);

            XmlReader xr = XmlReader.Create(new StringReader(xmlstr), new XmlReaderSettings(), inputContext);

            while (xr.Read())
            {
            }
        }
        public void Parse3()
        {
            XmlNamespaceManager nsMgr         = new MyNS(XmlReader.Create(new StringReader(empty)));
            XmlParserContext    inputContext  = new XmlParserContext(null, nsMgr, null, XmlSpace.None);
            XmlReader           xr            = XmlReader.Create(new StringReader(xmlstr), new XmlReaderSettings(), inputContext);
            XmlNamespaceManager aMgr          = new MyNS(xr);
            XmlParserContext    inputContext2 = new XmlParserContext(null, aMgr, null, XmlSpace.None);

            XmlReader xr2 = XmlReader.Create(new StringReader(xmlstr2), new XmlReaderSettings(), inputContext2);

            Assert.Throws <XmlException> (delegate {
                while (xr2.Read())
                {
                }
            }, "null");
        }