use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project n2o-framework by i-novus-llc.
the class SelectiveUtil method read.
@SuppressWarnings("unchecked")
public static <N> N read(String source, ElementReaderFactory readerFactory) {
try (Reader stringReader = new StringReader(source)) {
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(stringReader);
Element root = doc.getRootElement();
return (N) readerFactory.produce(root).read(root);
} catch (JDOMException | IOException e) {
throw new RuntimeException(e);
}
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project plexus-containers by codehaus-plexus.
the class ComponentsXmlMergerTest method testMergeRoleComponents.
public void testMergeRoleComponents() throws Exception {
SAXBuilder saxBuilder = new SAXBuilder();
String source1 = "<component-set>\n" + " <components>\n" + " <component>\n" + " <role>org.codehaus.plexus.metadata.component.DockerComposeConfigHandler</role>\n" + " <implementation>org.codehaus.plexus.metadata.component.DominantComponent</implementation>\n" + " </component>\n" + " <component>\n" + " <role>org.codehaus.plexus.metadata.component.PropertyConfigHandler</role>\n" + " <implementation>org.codehaus.plexus.metadata.component.DominantComponent</implementation>\n" + " </component>\n" + " </components>\n" + "</component-set>";
Document doc1 = saxBuilder.build(new StringReader(source1));
String source2 = "<component-set>\n" + " <components>\n" + " <component>\n" + " <role>org.codehaus.plexus.metadata.component.ExternalConfigHandler</role>\n" + " <implementation>org.codehaus.plexus.metadata.component.DominantComponent</implementation>\n" + " </component>\n" + " </components>\n" + "</component-set>";
Document doc2 = saxBuilder.build(new StringReader(source2));
PlexusXmlMerger merger = new PlexusXmlMerger();
Document mergedDoc = merger.merge(doc1, doc2);
List<Element> components = mergedDoc.detachRootElement().getChild("components").getChildren();
assertEquals(3, components.size());
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project step by STEPBible.
the class NaveXmlDataProcessor method process.
private void process(final SAXBuilder builder, final String line, final Tree<String> t) throws JDOMException, IOException {
final StringReader stringReader = new StringReader(line);
final Document doc;
try {
doc = builder.build(stringReader);
} catch (final Exception x) {
// quietly exit and log
System.out.println("Unable to process line: " + line);
return;
}
final List<Content> content = doc.getContent();
for (final Content c : content) {
// look for paragraphs
if (c instanceof Element) {
final Element element = (Element) c;
if (element.getName().equals("entryFree")) {
processEntryFree(t, doc, element);
}
}
}
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project step by STEPBible.
the class JSwordPassageServiceImplTest method testInterleave.
/**
* Justs shows XML on the stdout
*
* @throws BookException an exceptioon
* @throws NoSuchKeyException an exception
* @throws IOException an exception
* @throws JDOMException an exception
*/
@Test
public void testInterleave() throws BookException, NoSuchKeyException, JDOMException, IOException {
final XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat());
final String ref = "John 4:1";
// do the test
final String[] versions = new String[] { "Byz", "Tisch" };
final BookData data = new BookData(new Book[] { Books.installed().getBook(versions[0]), Books.installed().getBook(versions[1]) }, Books.installed().getBook(versions[0]).getKey(ref), true);
LOGGER.debug("Original is:\n {}", xmlOutputter.outputString(data.getOsisFragment()));
final OsisWrapper interleavedVersions = this.jsi.getInterleavedVersions(versions, ref, new ArrayList<LookupOption>(), InterlinearMode.COLUMN_COMPARE, "en");
final SAXBuilder sb = new SAXBuilder();
final Document d = sb.build(new StringReader(interleavedVersions.getValue()));
LOGGER.debug("\n {}", xmlOutputter.outputString(d));
}
use of com.forgerock.openbanking.common.model.openbanking.obie.pain00200109.Document in project step by STEPBible.
the class JSwordPassageServiceImplTest method testSegVariants.
/**
* Justs shows XML on the stdout
*
* @throws BookException an exceptioon
* @throws NoSuchKeyException an exception
* @throws IOException an exception
* @throws JDOMException an exception
*/
@Test
public void testSegVariants() throws BookException, NoSuchKeyException, JDOMException, IOException {
final XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat());
final String ref = "Mat.9.4";
final String version = "WHNU";
final Book book = Books.installed().getBook(version);
// do the test
final BookData data = new BookData(book, book.getKey(ref));
LOGGER.info("Original is:\n {}", xmlOutputter.outputString(data.getOsisFragment()));
final OsisWrapper interleavedVersions = this.jsi.getOsisText(version, ref);
final SAXBuilder sb = new SAXBuilder();
final Document d = sb.build(new StringReader(interleavedVersions.getValue()));
final String outputString = xmlOutputter.outputString(d);
LOGGER.info(outputString);
assertTrue(outputString.contains("ειδως"));
assertTrue(outputString.contains("title=\"ιδων"));
}
Aggregations