[sword-svn] r2519 - trunk/utilities
scribe at crosswire.org
scribe at crosswire.org
Fri Jun 4 01:51:18 MST 2010
Author: scribe
Date: 2010-06-04 01:51:17 -0700 (Fri, 04 Jun 2010)
New Revision: 2519
Modified:
trunk/utilities/osis2mod.cpp
Log:
rolled back a step toward new interverse material until engine works correctly with it.
Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp 2010-05-24 16:34:07 UTC (rev 2518)
+++ trunk/utilities/osis2mod.cpp 2010-06-04 08:51:17 UTC (rev 2519)
@@ -586,7 +586,7 @@
// Flags indicating whether we are processing the content of to be prepended to a verse
static bool inPreVerse = false;
- static int genID = 1;
+// static int genID = 1;
// Flag indicating whether we are in "Words of Christ"
static bool inWOC = false;
@@ -765,9 +765,9 @@
// Did we have pre-verse material that needs to be marked?
if (inPreVerse) {
- char genBuf[200];
- sprintf(genBuf, "<div type=\"x-milestone\" subType=\"x-preverse\" eID=\"pv%d\"/>", genID++);
- text.append(genBuf);
+// char genBuf[200];
+// sprintf(genBuf, "<div type=\"x-milestone\" subType=\"x-preverse\" eID=\"pv%d\"/>", genID++);
+// text.append(genBuf);
}
// Get osisID for verse or annotateRef for commentary
@@ -912,9 +912,9 @@
}
if (inPreVerse) {
- char genBuf[200];
- sprintf(genBuf, "<div type=\"x-milestone\" subType=\"x-preverse\" sID=\"pv%d\"/>", genID);
- text.append(genBuf);
+// char genBuf[200];
+// sprintf(genBuf, "<div type=\"x-milestone\" subType=\"x-preverse\" sID=\"pv%d\"/>", genID);
+// text.append(genBuf);
}
}
@@ -1179,33 +1179,38 @@
}
}
else {
- XMLTag topToken = bspTagStack.top();
+ if (!bspTagStack.empty()) {
+ XMLTag topToken = bspTagStack.top();
- if (debug & DEBUG_XFORM) {
- cout << "DEBUG(XFORM): " << currentOsisID << ": xform pop(" << bspTagStack.size() << ") " << topToken << endl;
- }
+ if (debug & DEBUG_XFORM) {
+ cout << "DEBUG(XFORM): " << currentOsisID << ": xform pop(" << bspTagStack.size() << ") " << topToken << endl;
+ }
- bspTagStack.pop();
+ bspTagStack.pop();
- // Look for the milestoneable container tags handled above.
- if (tagName == "chapter" ||
- tagName == "closer" ||
- tagName == "div" ||
- tagName == "l" ||
- tagName == "lg" ||
- tagName == "p" ||
- tagName == "q" ||
- tagName == "salute" ||
- tagName == "signed" ||
- tagName == "speech" ||
- tagName == "verse"
- ) {
- // make this a clone of the start tag with sID changed to eID
- // Note: in the case of </p> the topToken is a <div type="paragraph">
- t = topToken;
- t.setAttribute("eID", t.getAttribute("sID"));
- t.setAttribute("sID", 0);
+ // Look for the milestoneable container tags handled above.
+ if (tagName == "chapter" ||
+ tagName == "closer" ||
+ tagName == "div" ||
+ tagName == "l" ||
+ tagName == "lg" ||
+ tagName == "p" ||
+ tagName == "q" ||
+ tagName == "salute" ||
+ tagName == "signed" ||
+ tagName == "speech" ||
+ tagName == "verse"
+ ) {
+ // make this a clone of the start tag with sID changed to eID
+ // Note: in the case of </p> the topToken is a <div type="paragraph">
+ t = topToken;
+ t.setAttribute("eID", t.getAttribute("sID"));
+ t.setAttribute("sID", 0);
+ }
}
+ else {
+ cout << "FATAL(TAGSTACK): " << currentOsisID << ": closing tag without opening tag" << endl;
+ }
}
return t;
More information about the sword-cvs
mailing list