XmlHandler extends edu.harvard.hul.ois.jhove.HandlerBase { protected void showTextMDMetadata(TextMDMetadata textMD) { String margin = getIndent(++_level); String margn2 = margin + " "; String margn3 = margn2 + " "; String[][] attrs = { { "xmlns:textmd", TextMDMetadata.NAMESPACE }, { "xmlns:xsi", "http: { "xsi:schemaLocation", TextMDMetadata.NAMESPACE + " " + TextMDMetadata.DEFAULT_LOCATION }, }; _writer.println(margin + elementStart("textmd:textMD", attrs)); _writer.println(margn2 + elementStart("textmd:character_info")); _writer.println(margn3 + element("textmd:charset", textMD.getCharset())); _writer.println(margn3 + element("textmd:byte_order", textMD.getByte_orderString())); _writer.println(margn3 + element("textmd:byte_size", textMD.getByte_size())); if ("variable".equals(textMD.getCharacter_size())) { String[][] attrs1 = { { "encoding", textMD.getCharset() } }; _writer.println(margn3 + element("textmd:character_size", attrs1, "variable")); } else if (textMD.getCharacter_size() != null && textMD.getCharacter_size().length() != 0) { _writer.println(margn3 + element("textmd:character_size", textMD.getCharacter_size())); } _writer.println(margn3 + element("textmd:linebreak", textMD.getLinebreakString())); _writer.println(margn2 + elementEnd("textmd:character_info")); if (textMD.getLanguage() != null && textMD.getLanguage().length() != 0) { _writer.println(margn2 + element("textmd:language", textMD.getLanguage())); } if (textMD.getMarkup_basis() != null && textMD.getMarkup_basis().length() != 0) { if (textMD.getMarkup_basis_version() != null) { String[][] attrs1 = { { "version", textMD.getMarkup_basis_version() } }; _writer.println(margn2 + element("textmd:markup_basis", attrs1, textMD.getMarkup_basis())); } else { _writer.println(margn2 + element("textmd:markup_basis", textMD.getMarkup_basis())); } } if (textMD.getMarkup_language() != null && textMD.getMarkup_language().length() != 0) { if (textMD.getMarkup_language_version() != null) { String[][] attrs1 = { { "version", textMD.getMarkup_language_version() } }; _writer.println(margn2 + element("textmd:markup_language", attrs1, textMD.getMarkup_language())); } else { _writer.println(margn2 + element("textmd:markup_language", textMD.getMarkup_language())); } } _writer.println(margin + elementEnd("textmd:textMD")); _level--; } XmlHandler();  XmlHandler(String name, String release, int[] date, String note,
			String rights); @Override void show(); @Override void show(App app); @Override void show(OutputHandler handler); @Override void show(Module module); @Override void show(RepInfo info); @Override void showFooter(); @Override void showHeader(); void rationalToString(StringBuffer buf, String tag, String margin,
			Rational r);  }
@Test public void testShowTextMDMetadata() throws IOException { File textMD30File = new File(this.getClass() .getResource("text30_output.xml").getPath()); LOGGER.info("testShowTextMDMetadata with file " + textMD30File); assertTrue(textMD30File.isFile()); String expectedText30 = readXmlFile(textMD30File); this.handler.showTextMDMetadata(TEST_TEXTMD); this.handler.close(); String generatedTextMD = readXmlFile(outputFile); assertEquals("TextMD v3.0 generated not conformant", expectedText30, generatedTextMD); }