public class XPath extends Object
Modifier and Type | Field and Description |
---|---|
static Map<String,String> |
dp2ns
Default namespace for the Pipeline 2 Web API.
|
Map<String,String> |
namespaces |
Modifier and Type | Method and Description |
---|---|
static Node |
selectNode(String expr,
Node doc,
Map<String,String> ns)
Select the nodes matching `expr` and return it.
|
static List<Node> |
selectNodes(String expr,
Node doc,
Map<String,String> ns)
Select all nodes matching `expr` and return them as a List.
|
static String |
selectText(String expr,
Node doc,
Map<String,String> ns)
Select the node matching `expr` and return its text content.
|
public static List<Node> selectNodes(String expr, Node doc, Map<String,String> ns) throws Pipeline2Exception
expr
- XPath expressiondoc
- XML nodens
- Namespace map (Map<String prefix, String namespace>
)Pipeline2Exception
- thrown when an error occurspublic static String selectText(String expr, Node doc, Map<String,String> ns) throws Pipeline2Exception
expr
- XPath expressiondoc
- XML nodens
- Namespace map (Map<String prefix, String namespace>
)Pipeline2Exception
- thrown when an error occurspublic static Node selectNode(String expr, Node doc, Map<String,String> ns) throws Pipeline2Exception
expr
- XPath expressiondoc
- XML nodens
- Namespace map (Map<String prefix, String namespace>
)Pipeline2Exception
- thrown when an error occursCopyright © 2012–2022 The DAISY Consortium. All rights reserved.