示例#1
0
 /// <summary>
 /// XML.prototype.processingInstructions ( [ name ] )
 /// 
 /// When the processingInstructions method is called with one 
 /// parameter name, it returns an XMLList containing all the 
 /// children of this XML object that are processing-instructions 
 /// with the given name. When the processingInstructions method 
 /// is called with no parameters, it returns an XMLList containing 
 /// all the children of this XML object that are processing-instructions
 /// regardless of their name.
 /// 
 /// See ECMA 13.4.4.28
 /// </summary>
 /// <returns></returns>
 internal XMLList ProcessingInstructions(XMLName xmlName)
 {
     XMLList list = new XMLList (lib);
     foreach (XmlNode child in UnderlyingNode.ChildNodes) {
         if (child is XmlProcessingInstruction) {
             if (xmlName == null || xmlName.Matches (child))
                 list.Add (new XML (lib, child));
         }
     }
     return list;
 }
示例#2
0
 public void MatchChildren(XMLList list, XMLName xmlName, XmlNode parent, bool recursive)
 {
     foreach (XmlNode child in parent.ChildNodes) {
         if (xmlName.Matches (child))
             list.Add (new XML (lib, child));
         if (recursive)
             MatchChildren (list, xmlName, child, recursive);
     }
 }
示例#3
0
        internal void MatchAttributes(XMLList list, XMLName xmlName, XmlNode parent, bool recursive)
        {
            if (parent is XmlDocument)
                parent = ((XmlDocument)parent).DocumentElement;

            if (!(parent is XmlElement))
                return;

            foreach (XmlAttribute attr in parent.Attributes) {
                if (xmlName == null || xmlName.Matches (attr))
                    list.Add (new XML (lib, attr));
            }

            if (recursive) {
                foreach (XmlNode node in parent.ChildNodes)
                    MatchAttributes (list, xmlName, node, recursive);
            }
        }