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


C# XPathNodeType类代码示例

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


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

示例1: DecideXPNodeTypeForTextNodes

        internal bool DecideXPNodeTypeForTextNodes(XmlNode node, ref XPathNodeType xnt)
        {
            while (node != null)
            {
                switch (node.NodeType)
                {
                    case XmlNodeType.Text:
                    case XmlNodeType.CDATA:
                        xnt = XPathNodeType.Text;
                        return false;

                    case XmlNodeType.EntityReference:
                        if (this.DecideXPNodeTypeForTextNodes(node.FirstChild, ref xnt))
                        {
                            break;
                        }
                        return false;

                    case XmlNodeType.Whitespace:
                        break;

                    case XmlNodeType.SignificantWhitespace:
                        xnt = XPathNodeType.SignificantWhitespace;
                        break;

                    default:
                        return false;
                }
                node = node.NextSibling;
            }
            return true;
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:XmlCharacterData.cs

示例2: XPathSelfQuery

 internal XPathSelfQuery(
                        IQuery  qyInput,
                        String Name,
                        String Prefix,
                        String URN,
                        XPathNodeType Type) : base(qyInput, Name,  Prefix, URN,  Type) {
 }
开发者ID:ArildF,项目名称:masters,代码行数:7,代码来源:xpathselfquery.cs

示例3: ChildrenQuery

 internal ChildrenQuery(
                       IQuery qyInput,
                       String name,
                       String prefix,
                       String urn,
                       XPathNodeType type) : base (qyInput, name, prefix, urn, type) {
 }
开发者ID:ArildF,项目名称:masters,代码行数:7,代码来源:childrenquery.cs

示例4: MapNodeType

        //public enum XmlNodeType {
        //    None,
        //    Element,
        //    Attribute,
        //    Text,
        //    CDATA,
        //    EntityReference,
        //    Entity,
        //    ProcessingInstruction,
        //    Comment,
        //    Document,
        //    DocumentType,
        //    DocumentFragment,
        //    Notation,
        //    Whitespace,
        //    SignificantWhitespace,
        //    EndElement,
        //    EndEntity,
        //    XmlDeclaration
        //}

        //public enum XPathNodeType {
        //    Root,
        //    Element,
        //    Attribute,
        //    Namespace,
        //    Text,
        //    SignificantWhitespace,
        //    Whitespace,
        //    ProcessingInstruction,
        //    Comment,
        //    All,
        //}

        // xpath defines its own NodeType
        // it should use the XmlNodeType instead
        // we just map between them for now
        // so that the construct query will have
        // the XmlNodeType instead of XPathNodeType

        XmlNodeType MapNodeType(XPathNodeType type) {

            XmlNodeType ret = XmlNodeType.None;
            switch (type) {
                case XPathNodeType.Element:
                    ret = XmlNodeType.Element;
                    break;
                case XPathNodeType.Attribute:
                    ret = XmlNodeType.Attribute;
                    break;
                case XPathNodeType.Text:
                    ret = XmlNodeType.Text;
                    break;
                case XPathNodeType.ProcessingInstruction:
                    ret = XmlNodeType.ProcessingInstruction;
                    break;
                case XPathNodeType.Comment:
                    ret = XmlNodeType.Comment;
                    break;
                default:
                    break;
            }

            return ret;
        }
开发者ID:cornelius90,项目名称:InnovatorAdmin,代码行数:65,代码来源:queryBuilder.cs

示例5: AttributeQuery

 internal AttributeQuery(
                        IQuery qyParent,
                        String Name, 
                        String Prefix,
                        String URN,
                        XPathNodeType Type) : base(qyParent, Name, Prefix, URN, Type) {
 }
开发者ID:ArildF,项目名称:masters,代码行数:7,代码来源:attributequery.cs

示例6: XmlQueryOutput

 /// <summary>
 /// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately).
 /// Initialize output state to accept Rtf content (top-level sequences are therefore prohibited).
 /// </summary>
 internal XmlQueryOutput(XmlQueryRuntime runtime, XmlEventCache xwrt) {
     this.runtime = runtime;
     this.xwrt = xwrt;
     this.xstate = XmlState.WithinContent;
     this.depth = 1;
     this.rootType = XPathNodeType.Root;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:11,代码来源:XmlQueryOutput.cs

示例7: DecideXPNodeTypeForTextNodes

        public static bool DecideXPNodeTypeForTextNodes(this XmlNode thisObj, XmlNode node, ref XPathNodeType xnt)
        {
            //returns true - if all siblings of the node are processed else returns false.
            //The reference XPathNodeType argument being passed in is the watermark that
            //changes according to the siblings nodetype and will contain the correct
            //nodetype when it returns.

            Debug.Assert(IsTextNode(node.NodeType) || (node.ParentNode != null && node.ParentNode.NodeType == XmlNodeType.EntityReference));
            while (node != null)
            {
                switch (node.NodeType)
                {
                    case XmlNodeType.Whitespace:
                        break;
                    case XmlNodeType.SignificantWhitespace:
                        xnt = XPathNodeType.SignificantWhitespace;
                        break;
                    case XmlNodeType.Text:
                    case XmlNodeType.CDATA:
                        xnt = XPathNodeType.Text;
                        return false;
                    case XmlNodeType.EntityReference:
                        if (!thisObj.DecideXPNodeTypeForTextNodes(node.FirstChild, ref xnt))
                        {
                            return false;
                        }
                        break;
                    default:
                        return false;
                }
                node = node.NextSibling;
            }
            return true;
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:34,代码来源:XmlNodeEx.cs

示例8: XPathNodeMatch

 /// <summary>
 /// Creates an XPathNodeMatch from the navigator which should be position on the
 /// node.
 /// </summary>
 /// <remarks>
 /// We deliberately use the OuterXml when we find a Namespace since the
 /// navigator location returned starts from the xmlns attribute.
 /// </remarks>
 public XPathNodeMatch(XPathNavigator currentNavigator)
 {
     SetLineNumbers(currentNavigator as IXmlLineInfo);
     nodeType = currentNavigator.NodeType;
     switch (nodeType) {
         case XPathNodeType.Text:
             SetTextValue(currentNavigator);
             break;
         case XPathNodeType.Comment:
             SetCommentValue(currentNavigator);
             break;
         case XPathNodeType.Namespace:
             SetNamespaceValue(currentNavigator);
             break;
         case XPathNodeType.Element:
             SetElementValue(currentNavigator);
             break;
         case XPathNodeType.ProcessingInstruction:
             SetProcessingInstructionValue(currentNavigator);
             break;
         case XPathNodeType.Attribute:
             SetAttributeValue(currentNavigator);
             break;
         default:
             value = currentNavigator.LocalName;
             displayValue = value;
             break;
     }
 }
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:37,代码来源:XPathNodeMatch.cs

示例9: XPathNodeMatch

 public XPathNodeMatch(string nodeValue, string displayValue, int? lineNumber, int linePosition, XPathNodeType nodeType)
 {
     this.nodeValue = nodeValue;
     this.displayValue = displayValue;
     this.lineNumber = lineNumber;
     this.linePosition = linePosition;
     this.nodeType = nodeType;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:8,代码来源:XPathNodeMatch.cs

示例10: Axis

 // constructor
 internal Axis(AxisType axistype, AstNode input) {
     _axistype = axistype;
     _input = input;
     _prefix = String.Empty;
     _name = String.Empty;
     _nodetype =  XPathNodeType.All;
     this.abbrAxis = true;
 }
开发者ID:cornelius90,项目名称:InnovatorAdmin,代码行数:9,代码来源:axis.cs

示例11: FollSiblingQuery

 internal FollSiblingQuery(
     IQuery qyInput,
     String name,
     String prefix,
     String urn,
     XPathNodeType type) : base (qyInput, name, prefix, urn, type)
 {
 }
开发者ID:ArildF,项目名称:masters,代码行数:8,代码来源:followingsibling.cs

示例12: XslTemplateContent

		public XslTemplateContent (Compiler c,
			XPathNodeType parentType, bool xslForEach)
			: base (c) 
		{
			this.parentType = parentType;
			this.xslForEach = xslForEach;
			Compile (c);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:XslTemplateContent.cs

示例13: StartTree

 /// <summary>
 /// Start construction of a new Xml tree (document or fragment).
 /// </summary>
 public override XmlRawWriter StartTree(XPathNodeType rootType, IXmlNamespaceResolver nsResolver, XmlNameTable nameTable) {
     // Build XPathDocument
     // If rootType != XPathNodeType.Root, then build an XQuery fragment
     this.doc = new XPathDocument(nameTable);
     this.writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames | (rootType == XPathNodeType.Root ? XPathDocument.LoadFlags.None : XPathDocument.LoadFlags.Fragment), string.Empty);
     this.writer.NamespaceResolver = nsResolver;
     return this.writer;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:XmlSequenceWriter.cs

示例14: XmlQueryOutput

 /// <summary>
 /// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately).
 /// Initialize output state to accept Rtf content (top-level sequences are therefore prohibited).
 /// </summary>
 internal XmlQueryOutput(XmlQueryRuntime runtime, XmlEventCache xwrt)
 {
     _runtime = runtime;
     _xwrt = xwrt;
     _xstate = XmlState.WithinContent;
     _depth = 1;
     _rootType = XPathNodeType.Root;
 }
开发者ID:Corillian,项目名称:corefx,代码行数:12,代码来源:XmlQueryOutput.cs

示例15: BaseAxisQuery

 protected BaseAxisQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest)
 {
     this.qyInput = qyInput;
     this.name = name;
     this.prefix = prefix;
     this.typeTest = typeTest;
     this.nameTest = (prefix.Length != 0) || (name.Length != 0);
     this.nsUri = string.Empty;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:BaseAxisQuery.cs


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