Package ubic.gemma.core.util
Class XMLUtils
- java.lang.Object
- 
- ubic.gemma.core.util.XMLUtils
 
- 
 public class XMLUtils extends Object Handy methods for dealing with XML.- Author:
- pavlidis
 
- 
- 
Constructor SummaryConstructors Constructor Description XMLUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static DocumentBuildercreateDocumentBuilder()static List<String>extractMultipleChildren(Node parent, String elementName)static NodeextractOneChild(Node parent, String elementName)static StringextractOneChildText(Node parent, String elementName)static Collection<String>extractTagData(Document doc, String tag)static StringgetTextValue(Element ele)Make the horrible DOM API slightly more bearable: get the text value we know this element contains.static DocumentopenAndParse(InputStream is)
 
- 
- 
- 
Method Detail- 
extractMultipleChildrenpublic static List<String> extractMultipleChildren(Node parent, String elementName) 
 - 
extractTagDatapublic static Collection<String> extractTagData(Document doc, String tag) - Parameters:
- doc- - the xml document to search through
- tag- -the name of the element we are looking for
- Returns:
- a collection of strings that represent all the data contained within the given tag (for each instance of that tag)
 
 - 
getTextValuepublic static String getTextValue(Element ele) Make the horrible DOM API slightly more bearable: get the text value we know this element contains. Borrowed from the Spring API. Using Node.getTextContent() to fix failing tests, if there is a problem, see history before Feb 22. 2018 Also, this is the previous note (related to the code I removed): * Note that we can't really use the alternative Node.getTextContent() because it isn't supported by older Xerces * implementations (1.x), which tend to leak into the classloader. Causes recurring problems with tests.- Parameters:
- ele- element
- Returns:
- text value
 
 - 
createDocumentBuilderpublic static DocumentBuilder createDocumentBuilder() throws ParserConfigurationException - Throws:
- ParserConfigurationException
 
 - 
openAndParsepublic static Document openAndParse(InputStream is) throws IOException, ParserConfigurationException, SAXException 
 
- 
 
-