Hirdetés
- Azt hittük, a GeForce RTX 3060 már leköszönt, de úgy látszik, hogy mégsem!
- Porvihar, zuhogó eső és hó, de az Akasa passzív háza kitart
- Párduc a gépben: teszten az ASUS ExpertBook Ultra
- Mostantól nem kell az Intel segítsége a többképkockás képgeneráláshoz
- Máris frissítette az ipari felhasználásra szánt Ryzen Embedded szériáját az AMD
- Melyik tápegységet vegyem?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Házi barkács, gányolás, tákolás, megdöbbentő gépek!
- Vezetékes FEJhallgatók
- Micro Four Thirds
- A TCL egyebek mellett egy 1040 Hz-re képes monitorral készül az idei évre
- Apple asztali gépek
- Milyen monitort vegyek?
- Bambu Lab 3D nyomtatók
- Vezeték nélküli fülhallgatók
Ú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?:))
- CÉGEK FIGYELEM!! iPhone 11 64GB Black -1 ÉV GARANCIA - 27% ÁFA-S SZÁMLA Kártyafüggetlen, 100% Akksi
- A Legújabb! Dobozos Új DELL XPS 13 9340/ULTRA 7-155H/32 GB Ram/1TB SSD/AI BOOST+INTEL ARC
- Hp 830 G8 Core i7 1185U 16Gb Ram Intel Iris FullHD IPS Boltból számlával Garanciával
- Eladó újszerű Redmi Note 14 Pro 5G 8/256GB levendula / 12 hónap jótállás
- 261 - Lenovo LOQ (17IRX10) - Intel Core i7-14700HX, RTX 5070
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

