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?:))
- Motorolaj, hajtóműolaj, hűtőfolyadék, adalékok és szűrők topikja
- Kedvenc zene a mai napra
- Star Wars rajongók
- Anno 117: Pax Romana teszt
- Milyen okostelefont vegyek?
- Xiaomi 15T Pro - a téma nincs lezárva
- Épített vízhűtés (nem kompakt) topic
- Ingatlanos topic!
- PH!otósok beszélgetős, offolós topikja
- Hardcore pizza és kenyér topik
- További aktív témák...
- DELL PowerEdge R730xd 16LFF 160TB+400GB 2U rack - 2xE5-2683v4 (16c/32t),256GB RAM,2x10G NET,HBA330
- Sanyo akkutöltő + 2 használható akku
- Dell Precision 7550 i7-10850H 32GB 512GB Nvidia RTX3000 6GB 1 év garancia
- Dell Latitude 5290 i5 8350U, 8GB RAM, SSD, jó akku, EU bill., szép állapot, számla, 6 hó gar - 12.18
- Gamer PC-Számítógép! Csere-Beszámítás! I3 14100F / RTX 3060Ti / 16GB DDR5 / 1TB SSD
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


