- Milyen videókártyát?
- TCL LCD és LED TV-k
- Kormányok / autós szimulátorok topikja
- OLED TV topic
- Soundbar, soundplate, hangprojektor
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- Komoly SEAVIV egybegép brutális mennyiségű memóriával
- Gaming notebook topik
- Milyen billentyűzetet vegyek?
- Életlen svájcibicska: Teszten az LG 45GX90SA okos gamer monitor
Új hozzászólás Aktív témák
-
artiny
őstag
a toXml az emloyee ban igy nez ki most,
public String toXml() {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();Document doc = db.newDocument();
Element employeee = doc.createElement("employee");
doc.appendChild(employeee);Element employee = doc.createElement("employee");
employee.setAttribute("rodneCislo", String.valueOf(rodneCislo));
employee.appendChild(employeee);Element nameE = doc.createElement("meno");
employee.appendChild(nameE);
Text nameEHodnota = doc.createTextNode(this.name);
nameE.appendChild(nameEHodnota);Element oddelenieE = doc.createElement("oddelenie");
employee.appendChild(oddelenieE);
Text oddelenieEHodnota = doc.createTextNode(this.oddelenie);
oddelenieE.appendChild(oddelenieEHodnota);TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File("xmldoc.xml"));
t.transform(source, result);
return result.toString();} catch (Exception e) {
System.out.println(e.getMessage());
}
return null;}
return null; a netbeans rakta be, ha ide is a return result.toString(); raktam akkor hibat irt,ha nem volt akkor pedig hianyzott a toXml nek a return statement.
xml.append(employee.toXml()); most nem jelez pirossan."Ja és még valami, ne itt rakd az XML-t fájlba, hanem az oraj osztályban."
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File("xmldoc.xml"));
t.transform(source, result);
return result.toString();
-akkor ez a resze a toXml nek nem ide valo hanem az orej osztalyba,ide:public String toXml() {
StringBuilder xml = new StringBuilder();
if ( this.emp!=null && !this.emp.isEmpty() ) {
for (Employee employee: this.emp) {
// employee to xml, ahogy tetszik.
xml.append(employee.toXml());
}
}
return xml.toString();
}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Sigma 12-24mm f/4.5-5.6 EX DG HSM
- Eladó 4GB DDR4 laptop RAM-ok (SO-DIMM) többféle órajellel ( 10 darab )
- OHH! MSI CYBORG 15 Gamer Tervező Laptop 15,6" -30% i7-13620H 10Mag 16/512 RTX 4060 8GB FHD 144Hz
- ELADÓ 4 darab 8GB DDR4 ECC Registered (RDIMM) Szerver RAM modul
- Építőipari csomag (vakológépek, targoncák, építőipari eszközök és kellékek, egyéb, sok más)
- Samsung Galaxy S23 Ultra 5G 12/512GB zöld használt, megkímélt 6 hónap garancia
- iKing.Hu - OnePlus 15 12/256GB használt, karcmentes 6 hónap garancia
- MSI Prestige A16 AI+ Ryzen AI 9, 32GB DDR5 7500, QHD+ 165Hz csúcskategóriás ultralaptop!
- Bomba ár! Dell Latitude E7240 - i5-4GEN I 8GB I 128SSD I 12,5" HD I HDMI I W10 I Garancia!
- Samsung Galaxy S23 5G 128GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


