Visualizzazione dei risultati da 1 a 8 su 8
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2004
    Messaggi
    196

    Jdom

    salve ho trovato il seguente codice per creare un file xml
    alseguente link http://www.javaportal.it/docs/filexml.htm

    seguo le istruzioni ma quando compilo mi dice che


    C:\>javac CreaXML.java
    CreaXML.java:92: cannot find symbol
    symbol : method setIndent(boolean)
    location: class org.jdom.output.XMLOutputter
    xout.setIndent(true);
    ^
    CreaXML.java:93: cannot find symbol
    symbol : method setNewlines(boolean)
    location: class org.jdom.output.XMLOutputter
    xout.setNewlines(true);
    ^
    2 errors

    naturalmente ho inserito nel file classpath le libreire xerces e jdom.jar.

    non riesco a capire dove sbaglio.grazie in anticipo a chi mi aiuta.

  2. #2
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,301

    Moderazione

    Ricordati di specificare il linguaggio di programmazione anche nel titolo della discussione, come da Regolamento.

    Ciao!
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

  3. #3
    non c'è una documentazione per ste librerie?
    Si può vincere o perdere, l'importante è vincere o perdere da uomini...

    Neverland - Il mio Forum

  4. #4
    Originariamente inviato da Matteo982
    non c'è una documentazione per ste librerie?
    Vedi questo link:

    http://www.jdom.org/docs/apidocs/

  5. #5
    Utente di HTML.it L'avatar di anx721
    Registrato dal
    Apr 2003
    Messaggi
    2,352
    hai incluso la libreria nel classpath quando compili?

    Sun Certified Java Programmer

    EUCIP Core Level Certified

    European Certification of Informatics Professionals

  6. #6
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    1,202
    jdom.jar l'hai presa dal sito ufficiale o dal link del tutorial? Quella del sito (1.0) non contiene quei due metodi, quella del tutorial (1.0b7) sì
    Debian GNU/Linux sid
    Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
    Kernel 2.6.14-ck1

  7. #7
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    1,202
    Con jdom 1.0 usa questo metodo:
    codice:
    import org.jdom.output.Format;
    [...]
    // utilizzo un oggetto XMLOuttputter per formattare il file xml
    		Format format = Format.getPrettyFormat();
    		xout = new XMLOutputter();
    		xout.setFormat(format);
    Debian GNU/Linux sid
    Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
    Kernel 2.6.14-ck1

  8. #8
    Il setIndent con jdom 1.0 non esiste più se ben ricordo, devi usare il metodo che ti ha suggerito Kamui

    Ciauz
    Lang=Java
    Ambiente = Eclipse forever
    Ubuntu & Win XP Pro

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.