• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# XPath.XPathNavigator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



XPathNavigator类属于System.Xml.XPath命名空间,在下文中一共展示了XPathNavigator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: XPathAxisIterator

        public XPathAxisIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : this(nav, matchSelf) {
            if (name == null) throw new ArgumentNullException("name");
            if (namespaceURI == null) throw new ArgumentNullException("namespaceURI");

            this.name      = name;
            this.uri       = namespaceURI;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:XPathAxisIterator.cs


示例2: SchematronValidationEventArgs

        /// <summary>
        ///   Creates a new instance of the <see cref="SchematronValidationEventArgs"/>.
        /// </summary>
        /// <param name="schematron">The <see cref="SchematronDocument"/> that detected the event.</param>
        /// <param name="queryEngine">The <see cref="IQueryLanguage"/> that detected the event.</param>
        /// <param name="pattern">The active <see cref="Pattern"/>.</param>
        /// <param name="rule">The <see cref="Sepia.Schematron.Rule"/> that caused the event to be raised.</param>
        /// <param name="assertion">The <see cref="Sepia.Schematron.Assertion"/> that caused the event to be raised.</param>
        /// <param name="context">An <see cref="object"/> that provides the context for the <paramref name="rule"/> and <paramref name="assertion"/>.</param>
        /// <param name="instance">An <see cref="XPathNavigator"/> to the document node that cause the event to be raised.</param>
        public SchematronValidationEventArgs(SchematronDocument schematron, IQueryLanguage queryEngine, Pattern pattern, Rule rule, Assertion assertion, object context, XPathNavigator instance)
        {
            this.schematron = schematron;
             this.queryEngine = queryEngine;
             this.pattern = pattern;
             this.rule = rule;
             this.assertion = assertion;
             this.instance = instance.Clone();

             if (assertion == null)
             {
            message = "A schematron validation event occured.";
             }
             else
             {
            message = assertion.Message.ToString(instance, context);
             }

             List<string> diagnostics = new List<string>();
             if (assertion != null && !string.IsNullOrEmpty(assertion.Diagnostics))
             {
            foreach (string id in assertion.Diagnostics.Split(' '))
            {
               Diagnostic diagnostic = schematron.Diagnostics[id];
               diagnostics.Add(diagnostic.Message.ToString(instance, context));
            }
             }
             this.diagnostics = diagnostics.ToArray();
        }
开发者ID:richardschneider,项目名称:sepia,代码行数:39,代码来源:ValidationFramework.cs


示例3: GenericSeekableNavigator

 internal GenericSeekableNavigator(XPathNavigator navigator)
 {
     this.navigator = navigator;
     this.nodes = new QueryBuffer<XPathNavigator>(4);
     this.currentPosition = -1L;
     this.dom = this;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:GenericSeekableNavigator.cs


示例4: XPathSingletonIterator

 public XPathSingletonIterator(XPathNavigator nav, bool moved) : this(nav)
 {
     if (moved)
     {
         _position = 1;
     }
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:7,代码来源:XPathSingletonIterator.cs


示例5: Atom03SyndicationResourceAdapter

 /// <summary>
 /// Initializes a new instance of the <see cref="Atom03SyndicationResourceAdapter"/> class using the supplied <see cref="XPathNavigator"/> and <see cref="SyndicationResourceLoadSettings"/>.
 /// </summary>
 /// <param name="navigator">A read-only <see cref="XPathNavigator"/> object for navigating through the syndication feed information.</param>
 /// <param name="settings">The <see cref="SyndicationResourceLoadSettings"/> object used to configure the load operation of the <see cref="AtomFeed"/>.</param>
 /// <remarks>
 ///     This class expects the supplied <paramref name="navigator"/> to be positioned on the XML element that represents a <see cref="AtomFeed"/>.
 /// </remarks>
 /// <exception cref="ArgumentNullException">The <paramref name="navigator"/> is a null reference (Nothing in Visual Basic).</exception>
 /// <exception cref="ArgumentNullException">The <paramref name="settings"/> is a null reference (Nothing in Visual Basic).</exception>
 public Atom03SyndicationResourceAdapter(XPathNavigator navigator, SyndicationResourceLoadSettings settings)
     : base(navigator, settings)
 {
     //------------------------------------------------------------
     //	Initialization and argument validation handled by base class
     //------------------------------------------------------------
 }
开发者ID:Jiyuu,项目名称:Argotic,代码行数:17,代码来源:Atom03SyndicationResourceAdapter.cs


示例6: AxisElement

        internal AxisElement(GanttView view, XPathNavigator node)
            : base(view, node)
        {
            _scale = (ScaleLevel)Enum.Parse(typeof(ScaleLevel), Attributes[ScaleName].Value);
            _interval = int.Parse(Attributes[IntervalName].Value, CultureInfo.InvariantCulture);
            _format = Attributes[FormatName].Value;
            if(_scale == ScaleLevel.Week)
                _firstDay = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), Attributes[FirstDayName].Value);

            if (Attributes.ContainsKey(TitleTypeName))
            {
                string titleTypeValue = Attributes[TitleTypeName].Value;
                if (!string.IsNullOrEmpty(titleTypeValue))
                {
                    _titleType = (TitleType)Enum.Parse(typeof(TitleType), titleTypeValue);
                }
            }

            if (Attributes.ContainsKey(WidthName))
            {
                string widthValue = Attributes[WidthName].Value;
                if (!string.IsNullOrEmpty(widthValue))
                {
                    this.Width = int.Parse(widthValue, NumberStyles.Integer, CultureInfo.InvariantCulture);
                }
            }
        }
开发者ID:0anion0,项目名称:IBN,代码行数:27,代码来源:AxisElement.cs


示例7: AssertSequencePoints

        protected override void AssertSequencePoints(XPathNavigator navigator)
        {
            var entries = navigator.Select(
                "./symbols/methods/method[@name=\"MethodThatCreatesSwitch.SimpleClass.GenerateSwitch\"]/sequencepoints/entry");
            Assert.Equal(8, entries.Count);

            int visitedCount = 0;

            foreach (XPathNavigator entry in entries)
            {
                if (entry.GetAttribute("il_offset", string.Empty) == "0x0")
                {
                    Assert.Equal("16", entry.GetAttribute("start_row", string.Empty));
                    Assert.Equal("16", entry.GetAttribute("end_row", string.Empty));
                    Assert.Equal("4", entry.GetAttribute("start_column", string.Empty));
                    Assert.Equal("21", entry.GetAttribute("end_column", string.Empty));
                    visitedCount++;
                }
                else if (entry.GetAttribute("il_offset", string.Empty) == "0x23")
                {
                    Assert.Equal("24", entry.GetAttribute("start_row", string.Empty));
                    Assert.Equal("24", entry.GetAttribute("end_row", string.Empty));
                    Assert.Equal("4", entry.GetAttribute("start_column", string.Empty));
                    Assert.Equal("17", entry.GetAttribute("end_column", string.Empty));
                    visitedCount++;
                }
            }

            Assert.Equal(2, visitedCount);
        }
开发者ID:JasonBock,项目名称:EmitDebugging,代码行数:30,代码来源:DebuggingWithMethodThatCreatesSwitchTests.cs


示例8: LoadFromXPathNavigator

        public static MaterialDefinition LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return null;
            }

            MaterialDefinition materialDefinition = new MaterialDefinition();

            //name
            materialDefinition.Name = navigator.GetAttribute("Name", string.Empty);
            materialDefinition.NameHash = Cryptography.JenkinsOneAtATime(materialDefinition.Name);

            //type
            materialDefinition.Type = navigator.GetAttribute("Type", string.Empty);
            materialDefinition.TypeHash = Cryptography.JenkinsOneAtATime(materialDefinition.Type);

            //draw styles
            XPathNodeIterator entries = navigator.Select("./Array[@Name='DrawStyles']/Object[@Class='DrawStyle']");

            while (entries.MoveNext())
            {
                DrawStyle drawStyle = DrawStyle.LoadFromXPathNavigator(entries.Current);

                if (drawStyle != null)
                {
                    materialDefinition.DrawStyles.Add(drawStyle);
                }
            }

            return materialDefinition;
        }
开发者ID:SlyvanGames,项目名称:ps2ls,代码行数:32,代码来源:MaterialDefinition.cs


示例9: XmlNodeTaskItem

        /// <summary>
        /// Initializes a new instance of an XmlNodeTaskItem
        /// </summary>
        /// <param name="xpathNavigator">The selected XmlNode</param>
        /// <param name="reservedMetaDataPrefix">The prefix to attach to the reserved metadata properties.</param>
        public XmlNodeTaskItem(XPathNavigator xpathNavigator, string reservedMetaDataPrefix)
        {
            this.ReservedMetaDataPrefix = reservedMetaDataPrefix;

            switch (xpathNavigator.NodeType)
            {
                case XPathNodeType.Attribute:
                    itemSpec = xpathNavigator.Value;
                    break;
                default:
                    itemSpec = xpathNavigator.Name;
                    break;
            }
            metaData.Add(ReservedMetaDataPrefix + "value", xpathNavigator.Value);
            metaData.Add(ReservedMetaDataPrefix + "innerXml", xpathNavigator.InnerXml);
            metaData.Add(ReservedMetaDataPrefix + "outerXml", xpathNavigator.OuterXml);

            if (xpathNavigator.MoveToFirstAttribute())
            {
                do
                {
                    metaData.Add(xpathNavigator.Name, xpathNavigator.Value);
                } while (xpathNavigator.MoveToNextAttribute());
            }
        }
开发者ID:trippleflux,项目名称:jezatools,代码行数:30,代码来源:XmlNodeTaskItem.cs


示例10: AssertSequencePointsInFirstType

        private static void AssertSequencePointsInFirstType(XPathNavigator navigator)
        {
            var entries = navigator.Select(
                "./symbols/methods/method[@name=\"AssemblyWithTwoTypes.FirstClass.ReflectArgument\"]/sequencepoints/entry");
            Assert.Equal(2, entries.Count);

            int visitedCount = 0;

            foreach (XPathNavigator entry in entries)
            {
                if (entry.GetAttribute("il_offset", string.Empty) == "0x0")
                {
                    Assert.Equal("16", entry.GetAttribute("start_row", string.Empty));
                    Assert.Equal("16", entry.GetAttribute("end_row", string.Empty));
                    Assert.Equal("4", entry.GetAttribute("start_column", string.Empty));
                    Assert.Equal("21", entry.GetAttribute("end_column", string.Empty));
                    visitedCount++;
                }
                else if (entry.GetAttribute("il_offset", string.Empty) == "0x1")
                {
                    Assert.Equal("17", entry.GetAttribute("start_row", string.Empty));
                    Assert.Equal("17", entry.GetAttribute("end_row", string.Empty));
                    Assert.Equal("4", entry.GetAttribute("start_column", string.Empty));
                    Assert.Equal("17", entry.GetAttribute("end_column", string.Empty));
                    visitedCount++;
                }
            }

            Assert.Equal(2, visitedCount);
        }
开发者ID:JasonBock,项目名称:EmitDebugging,代码行数:30,代码来源:DebuggingWithTwoTypesTests.cs


示例11: ApplyTransformPipeline

        public static CardViewModel ApplyTransformPipeline(XPathNavigator powerElement,
			IEnumerable<Func<PowerPipelineState, PowerPipelineState>> pipeline, XmlDocument character)
        {
            var state = new PowerPipelineState(powerElement, character.CreateNavigator());
            state = pipeline.Aggregate(state, (current, op) => op(current));
            return state.ViewModel;
        }
开发者ID:arlobelshee,项目名称:BlogExamples,代码行数:7,代码来源:_5_code_becomes_data.cs


示例12: Parse

 public static ChannelLink Parse(XPathNavigator navigator)
 {
     ChannelLink result = null;
     Guid channelId = Guid.Empty;
     string id = navigator.GetAttribute("id", String.Empty);
     if (!String.IsNullOrEmpty(id))
     {
         channelId = new Guid(id);
     }
     int mpChannelId = -1;
     string mpId = navigator.GetAttribute("mpId", String.Empty);
     if (!String.IsNullOrEmpty(id))
     {
         mpChannelId = Int32.Parse(mpId);
     }
     if (channelId != Guid.Empty
         && mpChannelId >= 0)
     {
         string channelName = navigator.GetAttribute("name", String.Empty);
         ChannelType channelType;
         string type = navigator.GetAttribute("type", String.Empty);
         if (String.IsNullOrEmpty(type))
         {
             channelType = ChannelType.Television;
         }
         else
         {
             channelType = (ChannelType)Enum.Parse(typeof(ChannelType), type);
         }
         string mpChannelName = navigator.GetAttribute("mpName", String.Empty);
         result = new ChannelLink(channelType, channelId, channelName, mpChannelId, mpChannelName);
     }
     return result;
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV,代码行数:34,代码来源:ChannelLink.cs


示例13: Initialize

        //=====================================================================

        /// <inheritdoc />
        /// <remarks>Multiple <c>branch</c> elements are specified as the configuration.  Each <c>branch</c>
        /// element can contain one or more <c>component</c> definitions that will be created and executed when
        /// this component is applied.  Each branch receives a clone of the document.  This may be useful for
        /// generating multiple help output formats in one build configuration.</remarks>
        public override void Initialize(XPathNavigator configuration)
        {
            XPathNodeIterator branchNodes = configuration.Select("branch");

            foreach(XPathNavigator branchNode in branchNodes)
                branches.Add(this.BuildAssembler.LoadComponents(branchNode));
        }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:14,代码来源:CloneComponent.cs


示例14: LoadTheme

        public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex)
        {
            string item = XmlPath + "/" + ElementName;
            _ThemeLoaded = true;

            _ThemeLoaded &= CHelper.TryGetEnumValueFromXML<EBackgroundTypes>(item + "/Type", navigator, ref _Theme.Type);
            
            bool vid = CHelper.GetValueFromXML(item + "/Video", navigator, ref _Theme.VideoName, String.Empty);
            bool tex = CHelper.GetValueFromXML(item + "/Skin", navigator, ref _Theme.TextureName, String.Empty);
            _ThemeLoaded &= vid || tex || _Theme.Type == EBackgroundTypes.None;
                
            if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty))
            {
                _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color);
            }
            else
            {
                bool success = true;
                success &= CHelper.TryGetFloatValueFromXML(item + "/R", navigator, ref Color.R);
                success &= CHelper.TryGetFloatValueFromXML(item + "/G", navigator, ref Color.G);
                success &= CHelper.TryGetFloatValueFromXML(item + "/B", navigator, ref Color.B);
                success &= CHelper.TryGetFloatValueFromXML(item + "/A", navigator, ref Color.A);

                if (_Theme.Type != EBackgroundTypes.None)
                    _ThemeLoaded &= success;
            }

            if (_ThemeLoaded)
            {
                _Theme.Name = ElementName;
                LoadTextures();
            }            
            return _ThemeLoaded;
        }
开发者ID:HansMaiser,项目名称:Vocaluxe,代码行数:34,代码来源:CBackground.cs


示例15: Create

        static public XPathNavigatorReader Create(XPathNavigator navToRead)
        {
            XPathNavigator nav = navToRead.Clone();
            IXmlLineInfo xli = nav as IXmlLineInfo;
            IXmlSchemaInfo xsi = nav as IXmlSchemaInfo;
#if NAVREADER_SUPPORTSLINEINFO
            if (null == xsi) {
                if (null == xli) {
                    return new XPathNavigatorReader(nav, xli, xsi);
                }
                else {
                    return new XPathNavigatorReaderWithLI(nav, xli, xsi);
                }
            }
            else {
                if (null == xli) {
                    return new XPathNavigatorReaderWithSI(nav, xli, xsi);
                }
                else {
                    return new XPathNavigatorReaderWithLIAndSI(nav, xli, xsi);
                }
            }
#else
            if (null == xsi)
            {
                return new XPathNavigatorReader(nav, xli, xsi);
            }
            else
            {
                return new XPathNavigatorReaderWithSI(nav, xli, xsi);
            }
#endif
        }
开发者ID:Corillian,项目名称:corefx,代码行数:33,代码来源:XPathNavigatorReader.cs


示例16: ProcessBeforePosition

 private XPathNavigator ProcessBeforePosition(XPathNavigator res1, XPathNavigator res2){
     nextNode = res2;
     advance2 = false;
     advance1 = true;
     currentNode = res1;
     return res1;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:UnionExpr.cs


示例17: ProcessAfterPosition

 private XPathNavigator ProcessAfterPosition(XPathNavigator res1, XPathNavigator res2){
     nextNode = res1;
     advance1 = false;
     advance2 = true;
     currentNode = res2;
     return res2;
 } 
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:UnionExpr.cs


示例18: MSXslScript

			public MSXslScript (XPathNavigator nav, Evidence evidence)
			{
				this.evidence = evidence;
				code = nav.Value;
				if (nav.MoveToFirstAttribute ()) {
					do {
						switch (nav.LocalName) {
						case "language":
							switch (nav.Value.ToLower (CultureInfo.InvariantCulture)) {
							case "jscript":
							case "javascript":
								language = ScriptingLanguage.JScript; break;
							case "vb":
							case "visualbasic":
								language = ScriptingLanguage.VisualBasic;
								break;
							case "c#":
							case "csharp":
								language = ScriptingLanguage.CSharp;
								break;
							default:
								throw new XsltException ("Invalid scripting language!", null);
							}
							break;
						case "implements-prefix":
							implementsPrefix = nav.Value;
							break;
						}
					} while (nav.MoveToNextAttribute ());
					nav.MoveToParent ();
				}
				
				if (implementsPrefix == null)
					throw new XsltException ("need implements-prefix attr", null);
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:35,代码来源:MSXslScriptManager.cs


示例19: XrdsNode

		/// <summary>
		/// Initializes a new instance of the <see cref="XrdsNode"/> class.
		/// </summary>
		/// <param name="document">The document's root node, which this instance represents.</param>
		protected XrdsNode(XPathNavigator document) {
			Requires.NotNull(document, "document");
			Requires.True(document.NameTable != null, null);

			this.Node = document;
			this.XmlNamespaceResolver = new XmlNamespaceManager(document.NameTable);
		}
开发者ID:437072341,项目名称:dotnetopenid,代码行数:11,代码来源:XrdsNode.cs


示例20: Load

        public bool Load(XPathNavigator source, XmlNamespaceManager manager)
        {
            //------------------------------------------------------------
            //	Validate parameter
            //------------------------------------------------------------
            Guard.ArgumentNotNull(source, "source");

            //------------------------------------------------------------
            //	Attempt to extract syndication information
            //------------------------------------------------------------
            ResourceName = source.LocalName;
            Namespace = source.NamespaceURI;

            string value;
            Key = source.TryGetAttribute("key", Framework.Common.SData.Namespace, out value) ? value : null;
            Uri = source.TryGetAttribute("uri", Framework.Common.SData.Namespace, out value) && !string.IsNullOrEmpty(value) ? new Uri(value) : null;
            Uuid = source.TryGetAttribute("uuid", Framework.Common.SData.Namespace, out value) && !string.IsNullOrEmpty(value) ? new Guid(value) : (Guid?) null;
            Descriptor = source.TryGetAttribute("descriptor", Framework.Common.SData.Namespace, out value) ? value : null;
            Lookup = source.TryGetAttribute("lookup", Framework.Common.SData.Namespace, out value) ? value : null;
            IsDeleted = source.TryGetAttribute("isDeleted", Framework.Common.SData.Namespace, out value) && !string.IsNullOrEmpty(value) ? XmlConvert.ToBoolean(value) : (bool?) null;

            return source.SelectChildren(XPathNodeType.Element)
                .Cast<XPathNavigator>()
                .GroupBy(item => item.LocalName)
                .All(group => LoadItem(group.Key, group, manager));
        }
开发者ID:jasonhuber,项目名称:SDataUpdateNestedEntities,代码行数:26,代码来源:SDataPayload.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XPath.XPathNodeIterator类代码示例发布时间:2022-05-26
下一篇:
C# XPath.XPathItem类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap