Hirdetés
Új hozzászólás Aktív témák
-
artiny
őstag
orej.class ben a toXml metodus igy nez ki:
@SuppressWarnings("unchecked")
public String toXml() {
StringBuilder xml = new StringBuilder();
if ( this.emp!=null && !this.emp.isEmpty() ) {
for (Employee employee: this.emp) {
xml.append(employee.toXml());
}
}
return xml.toString();
}meg igy is jelzett a Employee.class ben a toXml nel a getBuffernál ,hogy:
StringBuffer sb = outWriter .getBuffer();
symbol: method getBuffer()
location: variable outWriter of type WriterTransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
DOMSource source = new DOMSource(doc);
StringWriter outWriter = new StringWriter();
//Writer outWriter = new StringWriter(); ha ezt a sort lecserltem ami most folotte van sor akkkor eltunt a hiba a getBuffer nál,de mikor lefutattom a programot nem hoz letre semmit..
a (new File("xmldoc.xml")) - valami hasonlo kene neki,hogy megadni hova mit mentsen .....
StreamResult result = new StreamResult( outWriter );
t.transform(source, result);
StringBuffer sb = outWriter .getBuffer();
return sb.toString();
} catch (Exception e) {
System.out.println(e.getMessage());
}
return null;
}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- GYÖNYÖRŰ iPhone 12 Mini 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3648, 96% Akkumulátor
- Azonnali A320 B350 X370 B450 X470 A520 B550 X570 chipset alaplap felvásárlás személyes/csomagküldés
- ÁRGARANCIA!Épített KomPhone i7 14700KF 32/64GB RAM RTX 5090 32GB GAMER PC termékbeszámítással
- LG 27UL550-W - 27" IPS / 3840x2160 4K / 60Hz 5ms / HDR10 / AMD FreeSync
- Intel Core i9 12900K 16mag/24 szál BOX új, bontatlan processzor garanciával!
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő