Hirdetés

Keresés

Új hozzászólás Aktív témák

  • TBG
    senior tag

    TBG:Helo...gondolom mar az idegeidre megyek...

    De legyszi meg ezt,...

    A employee osztalyban a toXml metodus az ugy jo lessz,vagy a return null az nem lessz jo?
    return result.toString(); nem fogadja el ahol van most a return null;

    Az hogy nm itt rakom fajlba az xml-t hanem majd az orej osztalyban,azt a toXml metodusban kene,...
    Hogy beillesztem ?
    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();

    Ezt próbáld meg!

    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    DOMSource source = new DOMSource(doc);
    Writer outWriter = new StringWriter();
    StreamResult result = new StreamResult( outWriter );
    t.transform(source, result);
    StringBuffer sb = outWriter .getBuffer();
    return sb.toString();

Új hozzászólás Aktív témák