/** * Called by the root element to leave DTD mode and if any * DTD parts were printer, will return a string with their * textual content. */ public String leaveDTD() throws IOException { // Only works if we're going out of DTD mode. if ( _writer == _dtdWriter ) { flushLine( false ); _writer = _docWriter; return _dtdWriter.toString(); } else return null; }
/** * Called by the root element to leave DTD mode and if any * DTD parts were printer, will return a string with their * textual content. */ public String leaveDTD() throws IOException { // Only works if we're going out of DTD mode. if ( _writer == _dtdWriter ) { flushLine( false ); _writer = _docWriter; return _dtdWriter.toString(); } else return null; }
/** * Called by any of the DTD handlers to enter DTD mode. * Once entered, all output will be accumulated in a string * that can be printed as part of the document's DTD. * This method may be called any number of time but will only * have affect the first time it's called. To exist DTD state * and get the accumulated DTD, call {@link #leaveDTD}. */ public void enterDTD() throws IOException { // Can only enter DTD state once. Once we're out of DTD // state, can no longer re-enter it. if ( _dtdWriter == null ) { flushLine( false ); _dtdWriter = new StringWriter(); _docWriter = _writer; _writer = _dtdWriter; } }
/** * Called by any of the DTD handlers to enter DTD mode. * Once entered, all output will be accumulated in a string * that can be printed as part of the document's DTD. * This method may be called any number of time but will only * have affect the first time it's called. To exist DTD state * and get the accumulated DTD, call {@link #leaveDTD}. */ public void enterDTD() throws IOException { // Can only enter DTD state once. Once we're out of DTD // state, can no longer re-enter it. if ( _dtdWriter == null ) { flushLine( false ); _dtdWriter = new StringWriter(); _docWriter = _writer; _writer = _dtdWriter; } }