diff --git a/src/main/java/w2phtml/xhtml/ODFPageSplitter.java b/src/main/java/w2phtml/xhtml/ODFPageSplitter.java
index 78f3019..0d317e4 100644
--- a/src/main/java/w2phtml/xhtml/ODFPageSplitter.java
+++ b/src/main/java/w2phtml/xhtml/ODFPageSplitter.java
@@ -671,14 +671,16 @@ public class ODFPageSplitter {
int i = 0;
while (childs.getLength() > i) {
Node child = childs.item(i);
+ String childName = child.getNodeName();
if (child.getNodeType() == Node.ELEMENT_NODE) {
if (containsSPB(child)) {
- if (child.getNodeName().equals(TEXT_NOTE)) {
+ if (childName.equals(TEXT_NOTE)) {
splitText(((Element)child).getElementsByTagName(TEXT_NOTE_BODY).item(0), officeReader);
- } else if (child.getNodeName().equals(TEXT_SPAN)){
+ } else if (childName.equals(TEXT_SPAN)){
handleSpan(child);
} else {
- System.out.println("SPB INSIDE SPAN! HELP!");
+ System.out.println("Error. SPB in unknown element " + childName);
+ System.exit(1);
}
}
}