+ XMLDeclAttribs.get("dtdName") + "\">");
+ XMLDeclAttribs.get("dtdName") +"\"");   ArrayList hrefObjList = findAllChildHrefObjects();  StringBuffer entityString = new StringBuffer (); StringBuffer notationString = new StringBuffer ();   if (hrefObjList.size() > 0) {  if (Specification.getInstance().isPrettyXDFOutput()) entityString.append(Constants.NEW_LINE);   synchronized (hrefObjList) { Iterator iter = hrefObjList.iterator(); while (iter.hasNext()) { Href hrefObj = (Href) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) entityString.append(Specification.getInstance().getPrettyXDFOutputIndentation());  entityString.append("<!ENTITY " + hrefObj.getName()); if (hrefObj.getPubId() != null) entityString.append(" PUBLIC \"" + hrefObj.getPubId() + "\""); if (hrefObj.getSysId() != null) entityString.append(" SYSTEM \"" + hrefObj.getSysId() + "\""); if (hrefObj.getNdata() != null) entityString.append(" NDATA " + hrefObj.getNdata()); entityString.append(">");  if (Specification.getInstance().isPrettyXDFOutput()) entityString.append(Constants.NEW_LINE); } }  }   synchronized (XMLNotationHash) { Iterator iter = XMLNotationHash.iterator();  while (iter.hasNext()) { Hashtable notationHash = (Hashtable) iter.next(); if (notationHash.containsKey("name")) {  if (Specification.getInstance().isPrettyXDFOutput()) notationString.append(Specification.getInstance().getPrettyXDFOutputIndentation());  notationString.append("<!NOTATION " + notationHash.get("name"));  if (notationHash.containsKey("publicId")) notationString.append(" PUBLIC \"" + notationHash.get("publicId") + "\"");  if (notationHash.containsKey("systemId")) notationString.append(" SYSTEM \"" + notationHash.get("systemId") + "\"");  notationString.append(">");  if (Specification.getInstance().isPrettyXDFOutput()) notationString.append(Constants.NEW_LINE);  } else { Log.warnln("Notation entry lacks name, ignoring entry\n"); } } }  if(entityString.length() > 0 || notationString.length() > 0 ) { writeOut(outputstream, " ["); if(entityString.length() > 0) writeOut(outputstream, entityString.toString()); if (notationString.length() > 0 ) writeOut(outputstream, notationString.toString()); writeOut(outputstream, "]"); }  writeOut(outputstream, ">");
  private void writeXMLDeclToOutputStream ( OutputStream outputstream,                                            Hashtable XMLDeclAttribs                                          )  {    // initial statement    writeOut(outputstream, "<?xml");    writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\"");    // print attributes    Enumeration keys = XMLDeclAttribs.keys();    while ( keys.hasMoreElements() )    {      String attribName = (String) keys.nextElement();      if (attribName.equals("version") ) {         Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring.");      } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) {         // skip over it      } else         writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\"");    }    writeOut(outputstream, " ?>");    if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE);    // Print the DOCTYPE DECL only if right info exists    if (XMLDeclAttribs.containsKey("rootName")        && XMLDeclAttribs.containsKey("dtdName"))    {        // print the DOCTYPE DECL IF its a structure node        if(classXDFNodeName != null && classXDFNodeName.equals(Specification.getInstance().getXDFStructureNodeName()) ) {            writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \""                                   + XMLDeclAttribs.get("dtdName") + "\">");        }      if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE);    } else      Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout");  }