Autore Topic: Errore con i tag XmlWriter in gb.xml  (Letto 10857 volte)

Offline sotema

  • Maestro Gambero
  • ****
  • Post: 467
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #60 il: 02 Luglio 2012, 15:02:00 »
L'uomo ha inventato la bomba atomica, ma nessun topo al mondo costruirebbe una trappola per topi.
Albert Einstein

Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #61 il: 02 Luglio 2012, 18:28:18 »
Oops, sorry, I wasn't looking at the good element.
It works for me with the revision #4868.

Ok, now seems to work XmlReader.  :ok:
For XmlWriter I do more testing...

The tests I made them with build 4882.

Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #62 il: 02 Luglio 2012, 18:38:49 »
The writing does not work.

Enclosed I send you two files:
1) pgdesigner3.conf is the original file, I use to read the configuration of my program
2) pgdesigner3.conf2 is the file that is created by the XmlWriter (gb.xml).

With the library gb.libxml the second file is created exactly equal to the first. With gb.xml the file is saved with the same structure, but with incorrect indentation and spaces are not required.

Offline Prokopy

  • Gamberetto
  • *
  • Post: 19
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #63 il: 03 Luglio 2012, 19:18:33 »
Is it better with the last revision ?

Offline sotema

  • Maestro Gambero
  • ****
  • Post: 467
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #64 il: 03 Luglio 2012, 21:59:52 »
It is ok for me with rev. 4891
thanks Adrien
L'uomo ha inventato la bomba atomica, ma nessun topo al mondo costruirebbe una trappola per topi.
Albert Einstein

Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #65 il: 04 Luglio 2012, 00:01:18 »
Is it better with the last revision ?

I still have to download it ...
The last was the build # 4882.  :-\


Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #66 il: 04 Luglio 2012, 00:27:11 »
Is it better with the last revision ?

I still have to download it ...
The last was the build # 4882.  :-\



Build #4893... PERFECT!!!  :ok:

Now the input files and output are identical. XmlWriter writes exactly what he reads XmlReader.

Offline sotema

  • Maestro Gambero
  • ****
  • Post: 467
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #67 il: 04 Luglio 2012, 08:15:52 »
Wanting to be precisely accurate, perhaps finicky, on the first line xmlwriter should indicate the Encoding as for the standard.
Anyway...it works. :2birre:
L'uomo ha inventato la bomba atomica, ma nessun topo al mondo costruirebbe una trappola per topi.
Albert Einstein

Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #68 il: 07 Luglio 2012, 15:38:30 »
Hello Procopy,

After testing the latest changes, I noticed a big difference in starting the program, depending on if you use the library gb.libxml or gb.xml.
With gb.xml, the program will start after several seconds, as if something heavy load.
With gb.libxml, the startup is faster.
In both cases, the program performs a number of readings in the xml configuration files.
You can verify this anomaly?

Offline Prokopy

  • Gamberetto
  • *
  • Post: 19
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #69 il: 08 Luglio 2012, 16:54:16 »
Outch ... I noticed that too. I see with the Gambas profiler that around 8 seconds are taken only by xmlreader.read(). I know that the XmlReader class is not made for little configuration files (XmlDocument and XmlExplorer are very faster for this), but there is obviously a huge problem.

I'm still running valgrind to find what the problem is, but even on my fastest CPU, it takes a long ...  :sleepy:

Offline Prokopy

  • Gamberetto
  • *
  • Post: 19
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #70 il: 08 Luglio 2012, 17:37:40 »
I made a few more optimizations and solved a bug with UTF-8 text. With the last revision this is really faster on my machine :

Read() Non-optimized : 8139546 µsec (8.1 sec) / 1336 calls
Read() Optimized : 53112 µsec (0.05 sec) / 1336 calls

Please tell me if it is better for you too.

Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #71 il: 08 Luglio 2012, 18:26:04 »
Which version?

Offline Prokopy

  • Gamberetto
  • *
  • Post: 19
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #72 il: 08 Luglio 2012, 19:17:37 »
This is the revision 4910.

Offline md9327

  • Moderatore
  • Senatore Gambero
  • *****
  • Post: 2.840
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #73 il: 08 Luglio 2012, 19:42:41 »
I downloaded the 4912 version.
Now the speed is equal with the two libraries.
I noticed, however, in the header of the xml file is no longer stored the encoding:
Codice: [Seleziona]
<?xml version="1.0" encoding="UTF-8"?>   #with gb.libxml

<?xml version="1.0"?>   #with gb.xml

Offline sotema

  • Maestro Gambero
  • ****
  • Post: 467
    • Mostra profilo
Re: Errore con i tag XmlWriter in gb.xml
« Risposta #74 il: 08 Luglio 2012, 19:45:49 »
...as i said in rplay #67  :P
L'uomo ha inventato la bomba atomica, ma nessun topo al mondo costruirebbe una trappola per topi.
Albert Einstein