Esempio n. 1
0
        private void InitializeCustomContext(CustomQueryContext paramContext)
        {
            IDictionary <string, string> namespaces = paramContext.GetNamespacesInScope(XmlNamespaceScope.ExcludeXml);

            _paramContext = new CustomQueryContext((NameTable)paramContext.NameTable);
            _paramContext.AddNamespace(namespaces);
        }
Esempio n. 2
0
 /// <summary>
 /// This method does some XPath specific initializations.
 /// </summary>
 private void InitializeXPathObjects(Stream xmlStream)
 {
     try
     {
         _xPathDoc     = new XPathDocument(xmlStream);
         _xNav         = _xPathDoc.CreateNavigator();
         _paramContext = new CustomQueryContext(new NameTable());
     }
     catch (XmlException ex)
     {
         Trace.TraceError("An XML specific exception occured " +
                          "while initializing XPathDocument and XPathNavigator in XPathQueryManager: " +
                          ex.Message);
         throw;
     }
     catch (Exception ex)
     {
         Trace.TraceError("An exception occured " +
                          "while initializing XPathDocument and XPathNavigator in XPathQueryManager: " +
                          ex.Message);
         throw;
     }
     finally
     {
         xmlStream.Dispose();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class.
 /// </summary>
 /// <param name="xPathDoc">An XmlDocument instance</param>
 /// <param name="xIter">An XPathNodeIterator instance</param>
 /// <param name="paramContext">A <see cref="XPathQueryManager.CustomQueryContext"/> instance for parameterized XPath expressions</param>
 private XPathQueryManager(XPathDocument xPathDoc, XPathNodeIterator xIter, CustomQueryContext paramContext)
     : this(xPathDoc)
 {
     if (xIter != null)
     {
         _xNav = xIter.Current;
     }
     InitializeCustomContext(paramContext);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class.
 /// </summary>
 /// <param name="xPathDoc">An XmlDocument instance</param>
 /// <param name="paramContext">A <see cref="XPathQueryManager.CustomQueryContext"/> instance for parameterized XPath expressions</param>
 private XPathQueryManager(XPathDocument xPathDoc, XPathNavigator xNav, CustomQueryContext paramContext)
 {
     _XNav = xNav.Clone();
     SetDocumentToParse(xPathDoc);
     InitializeCustomContext(paramContext);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class.
 /// </summary>
 /// <param name="xPathDoc">An XmlDocument instance</param>
 public XPathQueryManager(XPathDocument xPathDoc)
 {
     SetDocumentToParse(xPathDoc);
     _ParamContext = new CustomQueryContext(new NameTable());
 }
 private void InitializeCustomContext(CustomQueryContext paramContext)
 {
     IDictionary<string, string> namespaces = paramContext.GetNamespacesInScope(XmlNamespaceScope.ExcludeXml);
     _ParamContext = new CustomQueryContext((NameTable) paramContext.NameTable);
     _ParamContext.AddNamespace(namespaces);
 }
 /// <summary>
 /// This method does some XPath specific initializations.
 /// </summary>
 private void initializeXPathObjects(Stream xmlStream)
 {
     try
     {
         _XPathDoc = new XPathDocument(xmlStream);
         _XNav = _XPathDoc.CreateNavigator();
         _ParamContext = new CustomQueryContext(new NameTable());
     }
     catch (XmlException ex)
     {
         Trace.TraceError("An XML specific exception occured " +
                          "while initializing XPathDocument and XPathNavigator in XPathQueryManager: " +
                          ex.Message);
         throw ex;
     }
     catch (Exception ex)
     {
         Trace.TraceError("An exception occured " +
                          "while initializing XPathDocument and XPathNavigator in XPathQueryManager: " +
                          ex.Message);
         throw ex;
     }
     finally
     {
         xmlStream.Dispose();
     }
 }
 /// <summary>
 /// This method deletes the current namespace context.
 /// </summary>
 public void ResetNamespaces()
 {
     _ParamContext = null;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class.
 /// </summary>
 /// <param name="xPathDoc">An XmlDocument instance</param>
 /// <param name="xIter">An XPathNodeIterator instance</param
 /// <param name="paramContext">A <see cref="XPathQueryManager.CustomQueryContext"/> instance for parameterized XPath expressions</param>
 private XPathQueryManager(XPathDocument xPathDoc, XPathNodeIterator xIter, CustomQueryContext paramContext)
     : this(xPathDoc)
 {
     if (xIter != null)
         _XNav = xIter.Current;
     InitializeCustomContext(paramContext);
 }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class.
 /// </summary>
 /// <param name="xPathDoc">An XmlDocument instance</param>
 /// <param name="xNav"></param>
 /// <param name="paramContext">A <see cref="XPathQueryManager.CustomQueryContext"/> instance for parameterized XPath expressions</param>
 private XPathQueryManager(XPathDocument xPathDoc, XPathNavigator xNav, CustomQueryContext paramContext)
 {
     _xNav = xNav.Clone();
     SetDocumentToParse(xPathDoc);
     InitializeCustomContext(paramContext);
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XPathQueryManager"/> class.
 /// </summary>
 /// <param name="xPathDoc">An XmlDocument instance</param>
 public XPathQueryManager(XPathDocument xPathDoc)
 {
     SetDocumentToParse(xPathDoc);
     _paramContext = new CustomQueryContext(new NameTable());
 }
Esempio n. 12
0
 /// <summary>
 /// This method deletes the current namespace context.
 /// </summary>
 public void ResetNamespaces()
 {
     _paramContext = null;
 }