Skip to content
Snippets Groups Projects
Commit 84e3bef9 authored by Goik Martin's avatar Goik Martin
Browse files

More flexible implementation

parent 9d52c801
Branches
No related tags found
No related merge requests found
...@@ -34,9 +34,8 @@ public class ReadCatalog { ...@@ -34,9 +34,8 @@ public class ReadCatalog {
* *
* @param filename The catalog's filename to be parsed * @param filename The catalog's filename to be parsed
* *
* @throws JDOMException * @throws JDOMException XML input parsing error.
* * @throws IOException XML input access error.
* @throws IOException
*/ */
public void process(final String filename) throws JDOMException, IOException { public void process(final String filename) throws JDOMException, IOException {
...@@ -49,9 +48,9 @@ public class ReadCatalog { ...@@ -49,9 +48,9 @@ public class ReadCatalog {
final Element docRoot = docInput.getRootElement(); final Element docRoot = docInput.getRootElement();
// Accessing the <item> children of parent element <catalog> // Accessing the <item> children of parent element <catalog>
docRoot.getChildren().forEach(item -> docRoot.getChildren().stream().
System.out.println( map(item -> "Article: " + item.getText() +
"Article: " + item.getText() + ", order number: " + item.getAttributeValue("orderNo")).
", order number: " + item.getAttributeValue("orderNo"))); forEach(System.out::println);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment