Class XMLParser
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.demand.XMLParser
-
public final class XMLParser extends java.lang.ObjectCopyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Jul 23, 2015
- Author:
- Alexander Verbraeck
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<org.w3c.dom.Node>getNodes(org.w3c.dom.NodeList nodeList, java.lang.String tag)static java.util.List<org.w3c.dom.Node>getNodesSorted(org.w3c.dom.NodeList nodeList, java.lang.String tag, java.lang.String... sortAttributes)Returns nodes sorted by attributes and/or value.
-
-
-
Method Detail
-
getNodes
public static java.util.List<org.w3c.dom.Node> getNodes(org.w3c.dom.NodeList nodeList, java.lang.String tag)- Parameters:
nodeList- NodeList; the list of nodes to processtag- String; the tag to look for, e.g., LINK- Returns:
- the nodes (which can contain nodeLists themselves) with the given tag
-
getNodesSorted
public static java.util.List<org.w3c.dom.Node> getNodesSorted(org.w3c.dom.NodeList nodeList, java.lang.String tag, java.lang.String... sortAttributes)Returns nodes sorted by attributes and/or value. Nodes are sorted according to the given attribute order. In this order the node value can used by providingnull.- Parameters:
nodeList- NodeList; the list of nodes to processtag- String; the tag to look for, e.g., LINKsortAttributes- String...; list of attributes, which may containnullto use the node value- Returns:
- sorted nodes by attributes and/or value
-
-