Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#62 XML import doesn't preserve spaces (1.x)

closed
nobody
None
5
2010-01-16
2009-12-21
Daz Butcher
No

Using KP 1.17 + VariousImport 1.2.0.0 plugin

The built-in Export to XML preserves white-space but Import condenses it.

The following patch allows restoring of pre-formatted <notes> etc.

--- .\VariousImport-v1.2-Src.zip\Libs\TinyXML\tinyxml.cpp 2007-05-06 16:41:24.000000000 -0000
+++ .\VariousImport-v1.2-Src\Libs\TinyXML\tinyxml.cpp 2009-12-21 07:06:22.000000000 -0000
@@ -29,13 +29,13 @@
#include <iostream>
#endif

#include "tinyxml.h"

-bool TiXmlBase::condenseWhiteSpace = true;
+bool TiXmlBase::condenseWhiteSpace = false;

// Microsoft compiler security
FILE* TiXmlFOpen( const char* filename, const char* mode )
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
FILE* fp = 0;

Tested on my 100KB database by the sequence ...
1) Export to File 1
2) Import File 1 to empty .kdb
3) Export this .kdb to File 2
4) Binary comparison of Files 1 & 2 [equal]

Thanks very much for Keepass, Dominik :)

Daxx

Discussion

  • Daz Butcher
    Daz Butcher
    2009-12-21

    Don't condense white-space

     
    Attachments
  • Dominik Reichl
    Dominik Reichl
    2010-01-16

    The next VariousImport release will contain a TiXmlBase::SetCondenseWhiteSpace(false) call, which sets TiXmlBase::condenseWhiteSpace to false (this way we don't need to hack the TinyXML library).

    Thanks and best regards,
    Dominik

     
  • Dominik Reichl
    Dominik Reichl
    2010-01-16

    • status: open --> closed