/** * Given a DICOM object encoded as an XML document in a named file convert it to a list of * attributes. * * @param name the input file containing the XML document * @return the list of DICOM attributes * @exception IOException * @exception SAXException * @exception DicomException */ public AttributeList getAttributeList(String name) throws IOException, SAXException, DicomException { InputStream fi = new FileInputStream(name); BufferedInputStream bi = new BufferedInputStream(fi); AttributeList list = null; try { list = getAttributeList(bi); } finally { bi.close(); fi.close(); } return list; }
public static void main(String args[]) { try { URL url = new URL(args[0]); InputStream is = url.openStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; String buffer = ""; while ((line = br.readLine()) != null) buffer += line; br.close(); is.close(); Object[] obj = {buffer}; HTMLtoXML me = new HTMLtoXML(); me.invoke(obj); obj = me.getOutputValues(); System.out.println((String) obj[0]); } catch (Exception e) { e.printStackTrace(); System.exit(1); } return; }