Exemplo n.º 1
0
		public XPathNavigator GetDocument (Uri uri)
		{
			XPathNavigator result;
			
			if (docCache != null) {
				result = docCache [uri] as XPathNavigator;
				if (result != null)
					return result.Clone();
			} else {
				docCache = new Hashtable();
			}

			XmlReader rdr = null;
			try {
				rdr = new XmlTextReader (uri.ToString(), (Stream) resolver.GetEntity (uri, null, null), root.NameTable);
				XmlValidatingReader xvr = new XmlValidatingReader (rdr);
				xvr.ValidationType = ValidationType.None;
				result = new XPathDocument (xvr, XmlSpace.Preserve).CreateNavigator ();
			} finally {
				if (rdr != null)
					rdr.Close ();
			}
			docCache [uri] = result.Clone ();
			return result;
		}