AddToList() private method

private AddToList ( object toAdd ) : void
toAdd object
return void
Example #1
0
		internal virtual void AddMatchingChildren(XMLList result, Rhino.Xmlimpl.XmlNode.Filter filter)
		{
			System.Xml.XmlNode node = this.dom;
			XmlNodeList children = node.ChildNodes;
			for (int i = 0; i < children.Count; i++)
			{
				System.Xml.XmlNode childnode = children.Item(i);
				Rhino.Xmlimpl.XmlNode child = Rhino.Xmlimpl.XmlNode.CreateImpl(childnode);
				if (filter.Accept(childnode))
				{
					result.AddToList(child);
				}
			}
		}
Example #2
0
		internal virtual void AddMatchingAttributes(XMLList list, XML target)
		{
			Rhino.Xmlimpl.XMLName name = this;
			if (target.IsElement())
			{
				XML[] attributes = target.GetAttributes();
				for (int i = 0; i < attributes.Length; i++)
				{
					if (name.Matches(attributes[i]))
					{
						list.AddToList(attributes[i]);
					}
				}
			}
		}
Example #3
0
		internal virtual void AddMatches(XMLList rv, XML target)
		{
			if (IsDescendants())
			{
				AddDescendants(rv, target);
			}
			else
			{
				if (IsAttributeName())
				{
					AddAttributes(rv, target);
				}
				else
				{
					XML[] children = target.GetChildren();
					if (children != null)
					{
						for (int i = 0; i < children.Length; i++)
						{
							if (this.Matches(children[i]))
							{
								rv.AddToList(children[i]);
							}
						}
					}
					rv.SetTargets(target, this.ToQname());
				}
			}
		}
Example #4
0
		private void AddDescendantChildren(XMLList list, XML target)
		{
			Rhino.Xmlimpl.XMLName xmlName = this;
			if (target.IsElement())
			{
				XML[] children = target.GetChildren();
				for (int i = 0; i < children.Length; i++)
				{
					if (xmlName.Matches(children[i]))
					{
						list.AddToList(children[i]);
					}
					AddDescendantChildren(list, children[i]);
				}
			}
		}