当前位置: 首页>>代码示例>>C#>>正文


C# XPathDocument.MoveToNext方法代码示例

本文整理汇总了C#中System.Xml.XPath.XPathDocument.MoveToNext方法的典型用法代码示例。如果您正苦于以下问题:C# XPathDocument.MoveToNext方法的具体用法?C# XPathDocument.MoveToNext怎么用?C# XPathDocument.MoveToNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XPath.XPathDocument的用法示例。


在下文中一共展示了XPathDocument.MoveToNext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FromXml

 internal static CngKey FromXml(string xml)
 {
     CngKey key;
     using (TextReader reader = new StringReader(xml))
     {
         using (XmlTextReader reader2 = new XmlTextReader(reader))
         {
             BigInteger integer;
             BigInteger integer2;
             XPathNavigator navigator = new XPathDocument(reader2).CreateNavigator();
             if (!navigator.MoveToFirstChild())
             {
                 throw new ArgumentException(System.SR.GetString("Cryptography_MissingDomainParameters"));
             }
             CngAlgorithm algorithm = ReadAlgorithm(navigator);
             if (!navigator.MoveToNext(XPathNodeType.Element))
             {
                 throw new ArgumentException(System.SR.GetString("Cryptography_MissingPublicKey"));
             }
             ReadPublicKey(navigator, out integer, out integer2);
             key = CngKey.Import(NCryptNative.BuildEccPublicBlob(algorithm.Algorithm, integer, integer2), CngKeyBlobFormat.EccPublicBlob);
         }
     }
     return key;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:Rfc4050KeyFormatter.cs

示例2: SignificantWhitespaceConstruction

		public void SignificantWhitespaceConstruction ()
		{
			string xml = @"<root>
        <child xml:space='preserve'>    <!-- -->   </child>
        <child xml:space='preserve'>    </child>
</root>";
			XPathNavigator nav = new XPathDocument (
				new XmlTextReader (xml, XmlNodeType.Document, null),
				XmlSpace.Preserve).CreateNavigator ();
			nav.MoveToFirstChild ();
			nav.MoveToFirstChild ();
			Assert.AreEqual (XPathNodeType.Whitespace, nav.NodeType, "#1");
			nav.MoveToNext ();
			nav.MoveToFirstChild ();
			Assert.AreEqual (XPathNodeType.SignificantWhitespace,
				nav.NodeType, "#2");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:17,代码来源:XPathNavigatorTests.cs

示例3: PushInputDocument

		public void PushInputDocument (string url)
		{
			// todo: detect recursion
			Uri baseUriObj = (Input.BaseURI == String.Empty) ? null : new Uri (Input.BaseURI);
			Uri absUri = res.ResolveUri (baseUriObj, url);
			string absUriString = absUri != null ? absUri.ToString () : String.Empty;
			using (Stream s = (Stream)res.GetEntity (absUri, null, typeof(Stream)))
			{
				if (s == null)
					throw new XsltCompileException ("Can not access URI " + absUri.ToString (), null, Input);
				XmlValidatingReader vr = new XmlValidatingReader (new XmlTextReader (absUriString, s, nsMgr.NameTable));
				vr.ValidationType = ValidationType.None;
				XPathNavigator n = new XPathDocument (vr, XmlSpace.Preserve).CreateNavigator ();
				vr.Close ();
				n.MoveToFirstChild ();
				do {
					if (n.NodeType == XPathNodeType.Element)
						break;
				} while (n.MoveToNext ());
				PushInputDocument (n);
			}
		}
开发者ID:GirlD,项目名称:mono,代码行数:22,代码来源:Compiler.cs

示例4: XPathDocumentFragmentLoading

		public void XPathDocumentFragmentLoading()
		{
			string xml = "<customer id='1' pp:id='aba' xmlns='urn-kzu' xmlns:pp='urn-pepenamespace'><pp:order /><order id='1'>Chocolates</order></customer>";

			XPathNavigator nav = new XPathDocument(new StringReader(xml)).CreateNavigator();

			// <customer>
			nav.MoveToFirstChild();
			// <pp:order>
			nav.MoveToFirstChild();
			// <order>
			nav.MoveToNext();
			
			XmlReader reader = new XPathNavigatorReader(nav);
			XPathNavigator clone = new XPathDocument(reader).CreateNavigator();
			clone.MoveToFirstChild();
           
			Assert.AreEqual("order", clone.LocalName);
			Assert.AreEqual("urn-kzu", clone.NamespaceURI);
		}
开发者ID:zanyants,项目名称:mvp.xml,代码行数:20,代码来源:Tests.cs

示例5: XmlDocumentFragmentLoading

		public void XmlDocumentFragmentLoading()
		{
			string xml = "<customer id='1' pp:id='aba' xmlns='urn-kzu' xmlns:pp='urn-pepenamespace'><pp:order /><order id='1'>Chocolates</order></customer>";

			XPathNavigator nav = new XPathDocument(new StringReader(xml)).CreateNavigator();

			// <customer>
			nav.MoveToFirstChild();
			// <pp:order>
			nav.MoveToFirstChild();
			// <order>
			nav.MoveToNext();
			
			XmlReader reader = new XPathNavigatorReader(nav);
			XmlDocument doc = new XmlDocument(nav.NameTable);
			doc.Load( reader );
           
			Assert.AreEqual("order", doc.DocumentElement.LocalName);
			Assert.AreEqual("urn-kzu", doc.DocumentElement.NamespaceURI);
			Assert.AreEqual(1, doc.DocumentElement.Attributes.Count);
		}
开发者ID:zanyants,项目名称:mvp.xml,代码行数:21,代码来源:Tests.cs


注:本文中的System.Xml.XPath.XPathDocument.MoveToNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。