@Override Object getDocumentType(Object node) { return node instanceof Document ? ((Document) node).getDocType() : null; }
/** <p>This will print the <code>Document</code> to the current Writer.</p> * * <p> Warning: using your own Writer may cause the writer's * preferred character encoding to be ignored. If you use * encodings other than UTF8, we recommend using the method that * takes an OutputStream instead. </p> * * <p>Note: as with all Writers, you may need to flush() yours * after this method returns.</p> * * @param doc <code>Document</code> to format. * @throws IOException - if there's any problem writing. **/ public void write(Document doc) throws IOException { writeDeclaration(); if (doc.getDocType() != null) { indent(); writeDocType(doc.getDocType()); } for ( int i = 0, size = doc.nodeCount(); i < size; i++ ) { Node node = doc.node(i); writeNode( node ); } writePrintln(); if ( autoFlush ) { flush(); } }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
protected void entityResolver(Document document) throws SAXException { if (entityResolver != null) { DocumentType docType = document.getDocType(); if (docType != null) { String publicID = docType.getPublicID(); String systemID = docType.getSystemID(); if ((publicID != null) || (systemID != null)) { try { entityResolver.resolveEntity(publicID, systemID); } catch (IOException e) { throw new SAXException("Could not resolve publicID: " + publicID + " systemID: " + systemID, e); } } } } }
public void endDTD() throws SAXException { insideDTDSection = false; DocumentType docType = getDocument().getDocType(); if (docType != null) { if (internalDTDDeclarations != null) { docType.setInternalDeclarations(internalDTDDeclarations); } if (externalDTDDeclarations != null) { docType.setExternalDeclarations(externalDTDDeclarations); } } internalDTDDeclarations = null; externalDTDDeclarations = null; }
writeDeclaration(); if (doc.getDocType() != null) { indent(); writeDocType(doc.getDocType());
DocumentType docType = document.getDocType();
Object getDocumentType(Object node) { return node instanceof Document ? ((Document)node).getDocType() : null; }
@Override Object getDocumentType(Object node) { return node instanceof Document ? ((Document) node).getDocType() : null; }
@Override Object getDocumentType(Object node) { return node instanceof Document ? ((Document) node).getDocType() : null; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
public int compare(Document n1, Document n2) { int answer = compare(n1.getDocType(), n2.getDocType()); if (answer == 0) { answer = compareContent(n1, n2); } return answer; }
protected void assertNodesEqual(Document n1, Document n2) { // assertEquals( "Document names", n1.getName(), n2.getName() ); assertNodesEqual(n1.getDocType(), n2.getDocType()); assertNodesEqualContent(n1, n2); }
protected void testDocument(Document document) throws Exception { assertEquals(document.getNodeTypeName(), "Document"); DocumentType docType = document.getDocType(); if (docType != null) { assertEquals(docType.getNodeTypeName(), "DocumentType"); } testElement(document.getRootElement()); }