From ddde81cf806a5534a01483b563651bd84cf7452d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 13 Feb 2016 23:02:55 +0000 Subject: Read embedded blips in wp:inline --- src/main/java/org/zwobble/mammoth/xml/XmlElementList.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/org/zwobble/mammoth/xml') diff --git a/src/main/java/org/zwobble/mammoth/xml/XmlElementList.java b/src/main/java/org/zwobble/mammoth/xml/XmlElementList.java index 9e46314..b6a68ad 100644 --- a/src/main/java/org/zwobble/mammoth/xml/XmlElementList.java +++ b/src/main/java/org/zwobble/mammoth/xml/XmlElementList.java @@ -1,5 +1,8 @@ package org.zwobble.mammoth.xml; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; + import java.util.Iterator; import java.util.List; @@ -14,4 +17,12 @@ public class XmlElementList implements Iterable { public Iterator iterator() { return elements.iterator(); } + + public XmlElementList findChildren(String name) { + Iterable children = Iterables.concat( + Iterables.transform( + elements, + element -> element.findChildren(name))); + return new XmlElementList(ImmutableList.copyOf(children)); + } } -- cgit v1.2.3