System.Xml.Schema.AxisStack.Equal C# (CSharp) Méthode

Equal() static private méthode

static private Equal ( string thisname, string thisURN, string name, string URN ) : bool
thisname string
thisURN string
name string
URN string
Résultat bool
        internal static bool Equal (string thisname, string thisURN, string name, string URN) {
            // which means "b" in xpath, no namespace should be specified
            if (thisURN == null) {
                if ( !((URN == null) || (URN.Length == 0))) {
                    return false;
                }
            }
            // != "*"
            else if ((thisURN.Length != 0) && (thisURN != URN)) {
                return false; 
            }
            // != "a:*" || "*"
            if ((thisname.Length != 0) && (thisname != name)) {
                return false; 
            }
            return true;
        }

Usage Example

Exemple #1
0
        // equal & ! attribute then move
        // "a/b/c"     pointer from a move to b
        // return true if reach c and c is an element and c is the axis
        internal bool MoveToChild(string name, string?URN, int depth, ForwardAxis parent)
        {
            // an attribute can never be the same as an element
            if (Asttree.IsAttribute(this.curNode))
            {
                return(false);
            }

            // either moveToParent or moveToChild status will have to be changed into unmatch...
            if (this.isMatch)
            {
                this.isMatch = false;
            }

            if (!AxisStack.Equal(this.curNode.Name, this.curNode.Urn, name, URN))
            {
                return(false);
            }

            if (this.curDepth == -1)
            {
                SetDepth(depth);
            }
            else if (depth > this.curDepth)
            {
                return(false);
            }

            // matched ...
            if (this.curNode == parent.TopNode)
            {
                this.isMatch = true;
                return(true);
            }

            // move down this.curNode
            DoubleLinkAxis nowNode = (DoubleLinkAxis)(this.curNode.Next !);

            if (Asttree.IsAttribute(nowNode))
            {
                this.isMatch = true;                    // for attribute
                return(false);
            }

            this.curNode = nowNode;
            this.curDepth++;
            return(false);
        }
All Usage Examples Of System.Xml.Schema.AxisStack::Equal