BufferedReader f; String line = null; try {  f = new BufferedReader( new FileReader(MDSGlobals.RESOURCES_PATH + "fixedContent.dtd")); while ((line = f.readLine()) != null) { dtd += line + "\n"; } f.close(); } catch (Exception e) { e.printStackTrace(); }
	public MDSFile mapMDS2DTD(MDSModel mdsModel) throws XMIHandlerException {		String dtd = "";		classes = new ArrayList();		associations = new ArrayList();		generalizations = new ArrayList();		ArrayList classAssociations = new ArrayList();		MDSElement element = null;		Iterator i, j;		MDSClass mdsClass = null, subClass = null;		i = mdsModel.getElements().iterator();		while (i.hasNext()) {			element = (MDSElement) i.next();			if (element instanceof MDSClassImpl) {				classes.add(element);			} else if (element instanceof MDSGeneralizationImpl) {				subClass = ((MDSGeneralizationImpl) element).getSubClass();				j = classes.iterator();				while (j.hasNext()) {					mdsClass = (MDSClassImpl) j.next();					if (mdsClass.getId().equals(subClass.getId())) {						break;					}				}				generalizations.add(element);			} else {				associations.add(element);			}		}		String intro = "<!-- dtd generated by metadata.server -->\n";		i = classes.iterator();		while (i.hasNext()) {			dtdElementList = new ArrayList();			dtdAttList = new ArrayList();			mdsClass = (MDSClassImpl) i.next();			// rules 6,6a,6b			dtd += intro + "<!ELEMENT " + mdsClass.getLabel() + " (";			intro = "\n";			// rules 6e,6f			j = getClassAssociations(mdsClass, "all").iterator();			while (j.hasNext()) {				dtd += (String) j.next() + " | ";			}			// rule 6c			dtd += "XMI.extension)*>\n";			if (dtdAttList.size() > 0) {				dtd += "<!ATTLIST " + mdsClass.getLabel() + " ";				j = dtdAttList.iterator();				while (j.hasNext()) {					dtd += "\n\t\t\t" + (String) j.next() + " IDREF #IMPLIED";				}				dtd += "\n\t\t\t%XMI.element.att; %XMI.link.att; >\n";			}			j = dtdElementList.iterator();			while (j.hasNext()) {				dtd += (String) j.next();			}					}		MDSFile mdsFile = new MDSFileImpl();		mdsFile.setContent(dtd);		return mdsFile;	}