aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/xml
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-13 23:02:55 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-13 23:02:55 +0000
commitddde81cf806a5534a01483b563651bd84cf7452d (patch)
tree228d3debc22faf3ec1d18cb026300e9ded565ada /src/main/java/org/zwobble/mammoth/xml
parent26ac5524f3667d44bb53fd19d8a770d900847210 (diff)
Read embedded blips in wp:inline
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/xml')
-rw-r--r--src/main/java/org/zwobble/mammoth/xml/XmlElementList.java11
1 files changed, 11 insertions, 0 deletions
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<XmlElement> {
public Iterator<XmlElement> iterator() {
return elements.iterator();
}
+
+ public XmlElementList findChildren(String name) {
+ Iterable<XmlElement> children = Iterables.concat(
+ Iterables.transform(
+ elements,
+ element -> element.findChildren(name)));
+ return new XmlElementList(ImmutableList.copyOf(children));
+ }
}