Mercurial > dive4elements > framework
comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java @ 387:111d4e28c45e
Added method to create a document from string to XMLUtils.
artifacts/trunk@4352 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 07 May 2012 13:30:08 +0000 |
parents | 823752e3d392 |
children | cdc8b7c64856 |
comparison
equal
deleted
inserted
replaced
386:fd32dc33a24c | 387:111d4e28c45e |
---|---|
209 } | 209 } |
210 } | 210 } |
211 return null; | 211 return null; |
212 } | 212 } |
213 | 213 |
214 /** | |
215 * Parses a String to a xml document. | |
216 * | |
217 * @param string The xml string | |
218 * @return the XML document or null if something went wrong. | |
219 */ | |
220 public static final Document parseDocument(String string) { | |
221 InputStream inputStream = new ByteArrayInputStream(string.getBytes()); | |
222 return parseDocument(inputStream); | |
223 } | |
224 | |
214 | 225 |
215 public static final Document parseDocument(InputStream inputStream) { | 226 public static final Document parseDocument(InputStream inputStream) { |
216 return parseDocument(inputStream, Boolean.TRUE); | 227 return parseDocument(inputStream, Boolean.TRUE); |
217 } | 228 } |
218 | 229 |