Parses the children of an XML node.

@param {Element} xmlNode the xml node which will be parsed
@param {boolean} bRoot
@param {boolean} bIgnoreToplevelTextNodes
@returns {Promise[]} each resolving to the according child nodes content
337895
function parseChildren(xmlNode, bRoot, bIgnoreToplevelTextNodes) {
			var children = xmlNode.childNodes;
			for (var i = 0; i < children.length; i++) {
				parseNode(children[i], bRoot, bIgnoreToplevelTextNodes);
			}
		}
23846
function parseStringSync (xml) {
  var doc = new DOMParser().parseFromString(xml);
  var plist;
  if (doc.documentElement.nodeName !== 'plist') {
    throw new Error('malformed document. First element should be <plist>');
  }
  plist = parsePlistXML(doc.documentElement);

  // if the plist is an array with 1 element, pull it out of the array
  if (plist.length == 1) {
    plist = plist[0];
  }
  return plist;
}
1214481
private static void parseXMLAttributes(NamedNodeMap attrMap, List<UNode> childUNodeList) {
        for (int index = 0; index < attrMap.getLength(); index++) {
            Attr attr = (Attr)attrMap.item(index);
            UNode childNode = createValueNode(attr.getName(), attr.getValue(), true);
            childUNodeList.add(childNode);
        }
    }
1301539
function _parseWithXml2js(xmlContent) {
  return new Promise(function(resolve, reject) {
    // parse the pom, erasing all
    xml2js.parseString(xmlContent, XML2JS_OPTS, function(err, pomObject) {
      if (err) {
        // Reject with the error
        reject(err);
      }

      // Replace the arrays with single elements with strings
      removeSingleArrays(pomObject);

      // Response to the call
      resolve({
        pomXml: xmlContent, // Only add the pomXml when loaded from the file-system.
        pomObject: pomObject // Always add the object
      });
    });
  });
}
145464
function findRegionlessElms(virtualNode) {
	const node = virtualNode.actualNode;
	// End recursion if the element is a landmark, skiplink, or hidden content
	if (
		isRegion(virtualNode) ||
		(dom.isSkipLink(virtualNode.actualNode) &&
			dom.getElementByReference(virtualNode.actualNode, 'href')) ||
		!dom.isVisible(node, true)
	) {
		return [];

		// Return the node is a content element
	} else if (dom.hasContent(node, /* noRecursion: */ true)) {
		return [node];

		// Recursively look at all child elements
	} else {
		return virtualNode.children
			.filter(({ actualNode }) => actualNode.nodeType === 1)
			.map(findRegionlessElms)
			.reduce((a, b) => a.concat(b), []); // flatten the results
	}
}
72966
function serializeChildren(node) {
	var children = node.childNodes;
	if (children.length === 0) {
		return null;
	}
	
	if (children.length === 1 && children[0].nodeType === 3) {
		return children[0].nodeValue;
	}
	
	var result = "";
	var serializer = new XMLSerializer();
	for (var i = 0; i < children.length; i++) {
		result += serializer.serializeToString(children[i]);
	}
	return result;
}
699093
protected void parse(Node node) {
		NamedNodeMap attributes = node.getAttributes();
		type = getValueRecursive(attributes.getNamedItem("type"));

		NodeList childNodes = node.getChildNodes();
		for (int i = 0; i < childNodes.getLength(); i++) {
			Node child = childNodes.item(i);
			String nodeName = child.getNodeName();
			if ("Format".equalsIgnoreCase(nodeName)) {
				format = getValueRecursive(child);
			} else if ("OnlineResource".equalsIgnoreCase(nodeName)) {
				onlineResource = createOnlineResource(child);
			}
		}
	}
1032715
function(sValue) {
			if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
				alert("ObjTree.js not loaded.");
				return null;
			}
			var xotree = new XML.ObjTree();
		  	var tree = xotree.parseXML( sValue );
			return tree;
		}
1024088
public static List<Element> getElements(final Node nd) throws SAXException {
    final List<Element> al = new ArrayList<>();

    NodeList children = nd.getChildNodes();

    for (int i = 0; i < children.getLength(); i++) {
      Node curnode = children.item(i);

      if (curnode.getNodeType() == Node.TEXT_NODE) {
        String val = curnode.getNodeValue();

        if (val != null) {
          for (int vi= 0; vi < val.length(); vi++) {
            if (!Character.isWhitespace(val.charAt(vi))) {
              throw new SAXException("Non-whitespace text in element body for " +
                                     nd.getLocalName() +
                                     "\n text=" + val);
            }
          }
        }
      } else if (curnode.getNodeType() == Node.COMMENT_NODE) {
        // Ignore
      } else if (curnode.getNodeType() == Node.ELEMENT_NODE) {
        al.add((Element)curnode);
      } else {
        throw new SAXException("Unexpected child node " + curnode.getLocalName() +
                               " for " + nd.getLocalName());
      }
    }

    return al;
  }
233353
function(node) {
        var data = []

        for (var i = 0, len = node.childNodes.length; i < len; i++) {
            var child = node.childNodes[i]
            if (child.nodeType != ELEMENT_NODE) {
                continue
            }

            data.push(this._parseNode(child))
        }

        return data
    }
800015
function getNodes(tags, context) {
  var keys = objectKeys(tags);
  var returns = [];

  // keys to uppercase to compare to nodeName
  for(var i=0; i<keys.length; i++) keys[i]=keys[i].toUpperCase();

  // if context is tag
  if(keys.indexOf(context.nodeName.toUpperCase()) >= 0) {
    return [context];
  };

  //Mount all top-level child tags within context
  var nodes, el, mount, n;
  for(var i=0; i<keys.length; i++) {
    nodes = context.getElementsByTagName(keys[i]);
    for(n=0; n<nodes.length; n++) {
      el = nodes[n];
      mount = true;
      while(el = el.parentNode) {
        if(keys.indexOf(el.nodeName.toUpperCase()) >= 0) {
          mount = false;
          break;
        }
        if(el === context) break;
      }
      if(mount) returns.push(nodes[n]);
    }
  }  
  return returns;
}
741887
function(node, text) {
                if (!(node instanceof kityminder.Node)) {
                    return;
                }
                var children = [], jsonMap = {}, level = 0;
                var LINE_SPLITTER = /\r|\n|\r\n/, TAB_REGEXP = /^(\t|\x20{4})/;
                var lines = text.split(LINE_SPLITTER), line = "", jsonNode, i = 0;
                var minder = this;
                function isEmpty(line) {
                    return line === "" && !/\S/.test(line);
                }
                function getNode(line) {
                    return {
                        data: {
                            text: line.replace(/^(\t|\x20{4})+/, "").replace(/(\t|\x20{4})+$/, "")
                        },
                        children: []
                    };
                }
                function getLevel(text) {
                    var level = 0;
                    while (TAB_REGEXP.test(text)) {
                        text = text.replace(TAB_REGEXP, "");
                        level++;
                    }
                    return level;
                }
                function addChild(parent, node) {
                    parent.children.push(node);
                }
                function importChildren(node, children) {
                    for (var i = 0, l = children.length; i < l; i++) {
                        var childNode = minder.createNode(null, node);
                        childNode.setData("text", children[i].data.text || "");
                        importChildren(childNode, children[i].children);
                    }
                }
                while ((line = lines[i++]) !== undefined) {
                    line = line.replace(/&nbsp;/g, "");
                    if (isEmpty(line)) continue;
                    level = getLevel(line);
                    jsonNode = getNode(line);
                    if (level === 0) {
                        jsonMap = {};
                        children.push(jsonNode);
                        jsonMap[0] = children[children.length - 1];
                    } else {
                        if (!jsonMap[level - 1]) {
                            throw new Error("Invalid local format");
                        }
                        addChild(jsonMap[level - 1], jsonNode);
                        jsonMap[level] = jsonNode;
                    }
                }
                importChildren(node, children);
                minder.refresh();
            }
980115
function nodeStream(node) {
    var result = [];
    (function (node, offset) {
      for (var i = 0; i < node.childNodes.length; i++) {
        if (node.childNodes[i].nodeType == 3)
          offset += node.childNodes[i].nodeValue.length;
        else if (node.childNodes[i].nodeName == 'BR')
          offset += 1;
        else if (node.childNodes[i].nodeType == 1) {
          result.push({
            event: 'start',
            offset: offset,
            node: node.childNodes[i]
          });
          offset = arguments.callee(node.childNodes[i], offset);
          result.push({
            event: 'stop',
            offset: offset,
            node: node.childNodes[i]
          });
        }
      }
      return offset;
    })(node, 0);
    return result;
  }
1096299
function xmlImportNode(doc, node) {
  if (node.nodeType == DOM_TEXT_NODE) {
    return domCreateTextNode(doc, node.nodeValue);

  } else if (node.nodeType == DOM_CDATA_SECTION_NODE) {
    return domCreateCDATASection(doc, node.nodeValue);

  } else if (node.nodeType == DOM_ELEMENT_NODE) {
    var newNode = domCreateElement(doc, node.nodeName);
    for (var i = 0; i < node.attributes.length; ++i) {
      var an = node.attributes[i];
      var name = an.nodeName;
      var value = an.nodeValue;
      domSetAttribute(newNode, name, value);
    }

    for (var c = node.firstChild; c; c = c.nextSibling) {
      var cn = arguments.callee(doc, c);
      domAppendChild(newNode, cn);
    }

    return newNode;

  } else {
    return domCreateComment(doc, node.nodeName);
  }
}
961137
function(oNodeList) {
		var aNodeValues = [];
		var xPath = AnnotationParser._oXPath;

		for (var i = 0; i < oNodeList.length; i += 1) {
			var oNode = xPath.nextNode(oNodeList, i);
			var oValue = {};
			var sText = xPath.getNodeText(oNode);
			// TODO: Is nodeName correct or should we remove the namespace?
			oValue[oNode.nodeName] = AnnotationParser._parserData.aliases ? AnnotationParser.replaceWithAlias(sText) : sText;
			aNodeValues.push(oValue);
		}

		return aNodeValues;
	}
95326
function parsePlistXML (node) {
  var i, new_obj, key, val, new_arr, res, d;

  if (!node)
    return null;

  if (node.nodeName === 'plist') {
    new_arr = [];
    for (i=0; i < node.childNodes.length; i++) {
      // ignore comment nodes (text)
      if (!shouldIgnoreNode(node.childNodes[i])) {
        new_arr.push( parsePlistXML(node.childNodes[i]));
      }
    }
    return new_arr;

  } else if (node.nodeName === 'dict') {
    new_obj = {};
    key = null;
    for (i=0; i < node.childNodes.length; i++) {
      // ignore comment nodes (text)
      if (!shouldIgnoreNode(node.childNodes[i])) {
        if (key === null) {
          key = parsePlistXML(node.childNodes[i]);
        } else {
          new_obj[key] = parsePlistXML(node.childNodes[i]);
          key = null;
        }
      }
    }
    return new_obj;

  } else if (node.nodeName === 'array') {
    new_arr = [];
    for (i=0; i < node.childNodes.length; i++) {
      // ignore comment nodes (text)
      if (!shouldIgnoreNode(node.childNodes[i])) {
        res = parsePlistXML(node.childNodes[i]);
        if (null != res) new_arr.push(res);
      }
    }
    return new_arr;

  } else if (node.nodeName === '#text') {
    // TODO: what should we do with text types? (CDATA sections)

  } else if (node.nodeName === 'key') {
    return node.childNodes[0].nodeValue;

  } else if (node.nodeName === 'string') {
    res = '';
    for (d=0; d < node.childNodes.length; d++) {
      res += node.childNodes[d].nodeValue;
    }
    return res;

  } else if (node.nodeName === 'integer') {
    // parse as base 10 integer
    return parseInt(node.childNodes[0].nodeValue, 10);

  } else if (node.nodeName === 'real') {
    res = '';
    for (d=0; d < node.childNodes.length; d++) {
      if (node.childNodes[d].nodeType === 3) {
        res += node.childNodes[d].nodeValue;
      }
    }
    return parseFloat(res);

  } else if (node.nodeName === 'data') {
    res = '';
    for (d=0; d < node.childNodes.length; d++) {
      if (node.childNodes[d].nodeType === 3) {
        res += node.childNodes[d].nodeValue.replace(/\s+/g, '');
      }
    }

    // decode base64 data to a Buffer instance
    return new Buffer(res, 'base64');

  } else if (node.nodeName === 'date') {
    return new Date(node.childNodes[0].nodeValue);

  } else if (node.nodeName === 'true') {
    return true;

  } else if (node.nodeName === 'false') {
    return false;
  }
}
281263
function(node, textNodeMap) {
                if (canExpando || node.nodeType !== 3) {
                    return node[expando];
                } else {
                    // The nodeList has a specific collection for HTMLTextNodes for 
                    // (older) browsers that do not support expando properties.
                    for (var textNodeID in textNodeMap) {
                        if (textNodeMap[textNodeID] === node) {
                            return textNodeID;
                        }
                    }
                }
            }