Here you can find the source of getFirstExtensionNodeFromWorkingSet(Node extensionsNode, String workingSetName)
Parameter | Description |
---|---|
extensionsNode | extension node |
workingSetName | name of working set |
private static Node getFirstExtensionNodeFromWorkingSet(Node extensionsNode, String workingSetName)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /**/*from w w w .jav a2s . c o m*/ * Returns first node after the comment node with working set name * * @param extensionsNode * extension node * @param workingSetName * name of working set */ private static Node getFirstExtensionNodeFromWorkingSet(Node extensionsNode, String workingSetName) { final String extensionTag = "extension"; final String commentTag = "#comment"; Node child; NodeList nodes = extensionsNode.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { child = nodes.item(i); if (commentTag.equals(child.getNodeName()) && workingSetName.equals(child.getNodeValue())) for (int j = i; j < nodes.getLength(); j++) { child = nodes.item(j); if (extensionTag.equals(child.getNodeName())) return child; } } return null; } }