POLITECHNIKA RZESZOWSKA - Wydział Elektrotechniki i Informatyki
XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLEventFactory eventFactory = XMLEventFactory.newInstance(); try { XMLEventWriter writer = factory.oreateXMLEventWriter(
new FileWriter("output.wnl")); XMLEvent event = eventFactory.createStartDocument(); writer.add(event);
event = eventFactory.oreateStartElement("docvunent"); writer.add(event);
event = eventFactory.oreateAttribute("attr", "attr_value"); writer.add(event);
event = eventFactory.createEndElement("document"); writer.add(event); writer.flush(); writer.close();
} catch (XMLStreamException e) { e.printStackTraceO;
} catch (IOException e) { e.printStackTraceO;
JAVA Wykład 11
Copyright © 2012 Jan PROKOP
70/2.