/** * The text of non-reference notes. * * @param root the whole OSIS document * @return The references in the text */ public static String getHeadings(Element root) { StringBuilder buffer = new StringBuilder(); for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_TITLE)) { Element ele = (Element) content; if (buffer.length() > 0) { buffer.append(' '); } buffer.append(OSISUtil.getTextContent(ele.getContent())); } return buffer.toString(); }
/** * The text of non-reference notes. * * @param root the whole OSIS document * @return The references in the text */ public static String getNotes(Element root) { StringBuilder buffer = new StringBuilder(); for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_NOTE)) { Element ele = (Element) content; String attr = ele.getAttributeValue(OSISUtil.OSIS_ATTR_TYPE); if (attr == null || !attr.equals(NOTETYPE_REFERENCE)) { if (buffer.length() > 0) { buffer.append(' '); } buffer.append(OSISUtil.getTextContent(ele.getContent())); } } return buffer.toString(); }
StringBuilder buffer = new StringBuilder(); for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_W)) { Element ele = (Element) content; String attr = ele.getAttributeValue(OSISUtil.ATTRIBUTE_W_LEMMA);
for (Content content : OSISUtil.getDeepContent(osis, OSISUtil.OSIS_ELEMENT_W)) {
/** * A space separate string containing osisID from the reference element. * We pass book and key because the xref may not be valid and it needs to be reported. * * @param book the book to which the references refer * @param key the verse containing the cross references * @param v11n the versification * @param root the osis element in question * @return The references in the text */ public static String getReferences(Book book, Key key, Versification v11n, Element root) { PassageKeyFactory keyf = PassageKeyFactory.instance(); Key collector = keyf.createEmptyKeyList(v11n); for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_REFERENCE)) { Element ele = (Element) content; String attr = ele.getAttributeValue(OSISUtil.OSIS_ATTR_REF); if (attr != null) { try { collector.addAll(keyf.getKey(v11n, attr)); } catch (NoSuchKeyException e) { DataPolice.report(book, key, "Unable to parse: " + attr + " - No such reference:" + e.getMessage()); } } } return collector.getOsisID(); }