System.Xml.Xsl.Runtime.NavigatorConstructor.GetNavigator C# (CSharp) Method

GetNavigator() public method

Create a document from the cache of events. If a document has already been created previously, return it. This method is thread-safe, and is always guaranteed to return the exact same document, no matter how many threads have called it concurrently.
public GetNavigator ( XmlEventCache events, XmlNameTable nameTable ) : XPathNavigator
events System.Xml.XmlEventCache
nameTable System.Xml.XmlNameTable
return System.Xml.XPath.XPathNavigator
        public XPathNavigator GetNavigator(XmlEventCache events, XmlNameTable nameTable) {
            if (this.cache == null) {
                // Create XPathDocument from event cache
                XPathDocument doc = new XPathDocument(nameTable);
                XmlRawWriter writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames | (events.HasRootNode ? XPathDocument.LoadFlags.None : XPathDocument.LoadFlags.Fragment), events.BaseUri);

                events.EventsToWriter(writer);
                writer.Close();

                this.cache = doc;
            }

            return ((XPathDocument) this.cache).CreateNavigator();
        }

Same methods

NavigatorConstructor::GetNavigator ( string text, string baseUri, XmlNameTable nameTable ) : XPathNavigator

Usage Example

コード例 #1
0
 /// <summary>
 /// Discard serialization hints and return a navigator that actually allows navigation.
 /// </summary>
 public override XPathNavigator ToNavigator()
 {
     return(_constr.GetNavigator(_text, _baseUri, new NameTable()));
 }
All Usage Examples Of System.Xml.Xsl.Runtime.NavigatorConstructor::GetNavigator
NavigatorConstructor