Package org.dspace.authority.util
Class XMLUtils
java.lang.Object
org.dspace.authority.util.XMLUtils
- Author:
- Antoine Snyers (antoine at atmire.com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Documentstatic Nodestatic NodeListgetNodeList(Node xml, String nodeListXPath) getNodeListIterator(NodeList nodeList) Creates an iterator for all direct child nodes within a given NodeList that are element nodes: node.getNodeType() == Node.ELEMENT_NODE node instanceof ElementgetNodeListIterator(Node xml, String NodeListXPath) static StringgetTextContent(Node xml, String singleNodeXPath)
-
Method Details
-
getTextContent
public static String getTextContent(Node xml, String singleNodeXPath) throws XPathExpressionException - Parameters:
xml- The starting context (a Node or a Document, for example).singleNodeXPath- xpath- Returns:
- node.getTextContent() on the node that matches singleNodeXPath null if nothing matches the NodeListXPath
- Throws:
XPathExpressionException- if xpath error
-
getNode
- Parameters:
xml- The starting context (a Node or a Document, for example).nodeListXPath- xpath- Returns:
- A Node matches the NodeListXPath null if nothing matches the NodeListXPath
- Throws:
XPathExpressionException- if xpath error
-
getNodeList
- Parameters:
xml- The starting context (a Node or a Document, for example).nodeListXPath- xpath- Returns:
- A NodeList containing the nodes that match the NodeListXPath null if nothing matches the NodeListXPath
- Throws:
XPathExpressionException- if xpath error
-
getNodeListIterator
public static Iterator<Node> getNodeListIterator(Node xml, String NodeListXPath) throws XPathExpressionException - Throws:
XPathExpressionException
-
getNodeListIterator
Creates an iterator for all direct child nodes within a given NodeList that are element nodes: node.getNodeType() == Node.ELEMENT_NODE node instanceof Element- Parameters:
nodeList- NodeList- Returns:
- iterator over nodes
-
convertStreamToXML
-