diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-04-19 22:48:09 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-04-19 22:48:09 +0000 |
commit | 48d3c6827086c2d0209852c08be37ef502fb4b0d (patch) | |
tree | 85b1cfa4e84803889ce3e532ee29cd50b85f308b /poi-integration/src/test | |
parent | cf045a86b0614318b74309d48241c955493007c4 (diff) | |
download | poi-48d3c6827086c2d0209852c08be37ef502fb4b0d.tar.gz poi-48d3c6827086c2d0209852c08be37ef502fb4b0d.zip |
TIKA-3164 - add more .xsb and classes needed for TIKAs extractor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888985 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-integration/src/test')
-rw-r--r-- | poi-integration/src/test/java/org/apache/poi/stress/POIXMLDocumentHandler.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/poi-integration/src/test/java/org/apache/poi/stress/POIXMLDocumentHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/POIXMLDocumentHandler.java index 930c904a77..c99ebcb201 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/POIXMLDocumentHandler.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/POIXMLDocumentHandler.java @@ -59,14 +59,26 @@ public final class POIXMLDocumentHandler { protected static void cursorRecursive(XmlObject base) { XmlCursor cur = base.newCursor(); try { - if (!cur.toFirstChild()) { - return; - } - do { - cursorRecursive(cur.getObject()); - } while (cur.toNextSibling()); + cursorRecursive(cur); } finally { cur.dispose(); } } + + private static void cursorRecursive(XmlCursor cur) { + do { + assertNotNull(cur.getObject()); + cur.push(); + for (boolean b = cur.toFirstAttribute(); b; b = cur.toNextAttribute()) { + assertNotNull(cur.getObject()); + } + cur.pop(); + cur.push(); + + if (cur.toFirstChild()) { + cursorRecursive(cur); + } + cur.pop(); + } while (cur.toNextSibling()); + } } |